W2008 R2 SP1 Dynamic Memory Explained

Dynamic Memory can be a little confusing at first so I thought I’d give it a go.  It’s a new feature in Windows Server 2008 R2 Service Pack 1, the beta of which will appear some time in July 2010.  Dynamic Memory will support virtual machines running:

  • Windows Server 2003, 2003 R2, 2008, and 2008 R2 Web, Standard, Enterprise, and Datacenter editions.
  • Windows Vista/7 Ultimate and Enterprise editions.

The process is a mixture of memory hot-add and ballooning.  First …

Each VM will have a bunch of settings:

  • Do you want statically defined or dynamic memory for the VM?
  • What will be the minimum amount of memory in the VM?
  • What will be the maximum amount of memory in the VM?
  • How much free memory/buffer should the VM have?

OK.  Now the tricky bit.  How does it work?

The VM will boot up with the minimum amount of RAM.  Let’s say this is 1GB.  As the VM’s requirements grow, a VSC (Virtual Server Client) driver running in kernel mode in the VM will pull in memory from the host and supply it to the VM.  This consumes more physical memory from the host.

It is important to note that memory doesn’t magically appear from thin air.  The host must have the memory that is required by the VM – otherwise we get into a nasty performance situation.

What happens on the way down when the memory requirements of the VM reduce?

As the VM no longer needs memory, the ballooning process kicks in.  Memory cannot be physically removed from the VM.  Windows wouldn’t like that!  Instead, the VSC “tricks” it.  This driver simultaneously:

  • Reports to the VM that it is consuming the RAM that is being freed up.  It isn’t really.  But this prevents Windows in the VM from trying to allocate those blocks of memory that won’t really be there.  This is the balloon.
  • The VSC returns the free/ballooned memory to the host so that it can be made available for other memory hungry VM’s.

As you can see in some of the demo’s that I’ve linked to recently, it’s a pretty simple, rapid and easy thing to use.

The trick here is not to abuse what Dynamic Memory can do.  There’s no point in over committing host servers.  If you know that you have an average of 75% memory utilisation across your VM’s then don’t try to get twice as much out of the host.

I think the sizing of the settings will be tricky.  I think OpsMgr reporting will prove very useful in figuring out what is best to do and how to configure the settings.

Where will Dynamic Memory be useful?

  • VDI: No doubt!  The big cost here are the GB’s of RAM and that’s usually the bottleneck in a host, not the CPU.
  • VM Sizing: Just like in the physical world, it’s hard to accurately size memory for VM’s.  Software vendors can be very conservative with requirements and you can end up with too much RAM in a VM.  Now you can set a range and let the VM consume what it really needs.
  • Labs: We usually have limited budgets so squeezing that little bit more for a couple extra VM’s will be very nice.  I wish I could do this right now for my book lab!!!

As the Service Pack 1 beta and RC releases develop, I’m sure MS will release more information about Dynamic Memory and engineering recommendations.

7 thoughts on “W2008 R2 SP1 Dynamic Memory Explained”

  1. According to the session I went to at MMS, Standard and Web Server SKUs will NOT support dynamic memory. It uses the “plug-in play RAM” feature built into Enterprise and Datacenter Kernal SKUs. They basically said they recommend their customers to buy DataCenter for their hosts and just install all VMs as datacenter since there is no price difference (that came from the MS presenter). at this time, they don’t have a recommendation for customers that have standard servers already in prod…

    1. The slide deck that you saw being presented was probably out of date. The (correct) announcement is that Web and Standard guests will support Dynamic Memory.

  2. Hi,
    I’m ok with Dan, Could you give us your source ?
    Because for example if i’m going on http://www.microsoft.com/windowsserver2008/en/us/r2-compare-specs.aspx
    Windows 2008 R2 is not compatible with Hot-add memory !?

    And for windows 2003 (http://technet.microsoft.com/fr-fr/library/cc758523%28WS.10%29.aspx) standard and 64bit edition are not compatible.

    What the good version of windows 2003 and 2008 are supported ?

    Thanks
    Tony

    PS : Sorry for my english

    1. The source is quite simple and very public: Ben Armstrong (The Virtual PC Guy) who presented on the topic at TechEd 2010, and the actual keynote presentation at TechEd 2010. MS kinda made a big deal about it. It was stated that Web and Standard would have support for Dynamic Memory as guests.

      Forget what is on microsoft.com at the moment. SP1 is still not released as a public beta.

    1. The placeholder (BIN file) for save states will match the size of allocated memory in the VM. You need to account for this potential when sizing your physical storage.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.