Tuesday, March 1, 2011

Considerations using Hyper-V with Dynamic Memory in Failover Clustering

Ok, so you have had your VM`s running for a while with the dynamic memory feature enabled.
Everything works great, and you plan to put one of your nodes in maintenance mode since there are some important and recommended new available Windows Updates to install.
To place your node in maintenance mode, you need to migrate (Quick Migration or/and Live Migration) your VMs to a node which has available resources.
You are familiar that with SP1 and Dynamic Memory, the only considerations when it comes to capacity planning as far as RAM concern, is the ‘startup RAM’ on each VM.
If a VM is using 20GB RAM, and the destination node has less available, how would this affect the various migrations?



Since the VM now have a certain amount of memory assigned, it would not easily let go of it.
It also depends on the workloads running within the VM, and how much memory the VM actually demand from the parent.

Workaround:

1.       Try to decrease the memory buffer on the VMs running on the destination node
2.       Try to decrease the memory buffer on the VM that is using much memory
3.       Try to decrease the priority on the VM that is using much memory, and decrease the VMs running on the destination node
4.       Are there any possibilities to decrease the memory within the VM? If your VM is running SQL server, you could try to decrease the maximum server memory
5.       If none of the above helps, you may need to power off some of the running VMs to allow the migration (if the node is running some non –critical workloads and you can live with service interruption), or in worst case – power off the VM you intend to migrate, and let it start up on the destination node with the defined startup RAM.


Here is some guidance`s for how you should plan for Dynamic Memory:

1.       Do not configure too high value for the startup RAM setting on your VMs. The whole idea with Dynamic Memory, is that the VM should communicate with the parent (VSP/VMBus/VSC) to determine the memory need. Remember that the value specified on startup RAM is allocated from the host when the VM is powered on, and cant decrease below this value. The Dynamic Memory algorithm will always strive to make this minimum amount of memory available to the VM.
2.       If your VMs are running some heavy workloads (SQL server etc) then there is a good chance that the VM is using too much memory from the host. It`s always important to know your workload, also when you`re using Dynamic Memory. You might find it valuable to specify the maximum RAM setting on these VMs.
3.       Do not increase the memory buffer if it`s not necessary. If your VM is using 20GB RAM, and the memory buffer is configured with 50%, you are actually telling the parent that it should try to allocate an additional of 10GB RAM to this VM, and it may affect the other VMs.
4.       Documentation – it`s important to have an updated documentation, as well as to monitor your VMs after enabling Dynamic Memory.
It can be a lot more complex than this, especially if you`re using preferred nodes, and other ratings. As a best practice, try to document every setting on the VMs – including vNICs, numbers of vCPU, startup RAM/maximum RAM, vhd`s. You may need to restore a VM from time to time, and I have found these documentations very helpful.

Cheers,

No comments: