After enabling Dynamic Memory on 7 Hyper-V 2008 R2 SP1 host servers, we were able to free up 75 Gigabytes of RAM! This effectively enables us to add anywhere from 10 to 150 virtual machines depending on RAM configuration (512mb to 8196mb).

image

We have 15 other Hyper-V servers we will be enabling dynamic memory on and I will post the results as soon as possible.

Here are four SharePoint 2010 Virtual Machines in the Hyper-V MMC console. You can see that the actual memory demand of a VM can vary significantly and in the case of one of these can even alert you when you have assigned too much memory (Memory Status = Low). That is the case when the demand is less than the actual assigned memory.

image

Microsoft Technet recommends to set the startup memory to 512mb for 2008 and up (only 128mb for 2003). I know that seems low but I went ahead and followed their guidance and I can now see why they make that recommendation. Sometimes a VM really only needs a few hundred megabytes of RAM but it can then balloon up as needed.

Implementing Dynamic Memory can be accomplished by the following steps.

  • Apply Service Pack 1 to your host Windows Server 2008 R2 server
  • Make sure your VM operating system meets the requirements for Dynamic Memory (VistawSP1/Win7wSP1/2003wSP2/2003R2wSP2/2008wSP2/2008R2wSP1)
  • If your VM operating system is supported, then upgrade the VM’s integration service to SP1
  • You can then shut down the virtual machine and then configure the Memory to Dynamic. Set the startup to 512 and set the maximum RAM to whatever you previously were using as the Static value. I left the memory buffer to its default value of 20%. In most cases I left the memory weight to the default setting as well.

image

In the case of Microsoft Operations Manager, it usually seems to perform better with lots of RAM – in our case, around 10GB. So I set the maximum RAM to 10GB but the startup to 1GB.

image

What I found interesting is that inside the machine itself, the host is only presented with what it actually needs. For example, the host memory demand is 3.8GB but the Hyper-V buffer memory setting of 20% makes sure that the standby (611MB) + free memory (343MB) allows for quick memory allocation. When it exceeds the 20% buffer then it will request another ‘hot-add’ from the Hyper-V host.

image

As the memory demand grows, the VM requested more memory from Hyper-V. Notice how the total physical memory was hot-added to 5GB, and the standby (703MB) plus free (488MB) equals the new reflection of the 20% of 5GB Memory buffer setting in Hyper-V (5GB x 20% = 1002MB)

image