Hyper-V Dynamic Memory Overview
Letzte Aktualisierung: Februar 2012
Betrifft: Windows Server 2012
If you have idle or low-load virtual machines, as in pooled Virtual Desktop Infrastructure (VDI) environments, Dynamic Memory additions in Hyper-V in Windows Server 2012 enable you to increase consolidation and improve reliability for restart operations. You also gain agility in responding to requirement changes with these new capabilities.
With the Dynamic Memory improvements for Hyper-V in Windows Server 2012, you can attain higher consolidation numbers with improved reliability for restart operations. This can lead to lower costs, especially in environments that have many idle or low-load virtual machines, such as pooled VDI environments. Dynamic Memory run-time configuration changes can reduce downtime and provide increased agility to respond to requirement changes.
Dynamic Memory, introduced in Windows Server 2008 R2 Service Pack 1 (SP1), defined startup memory as the minimum amount of memory that a virtual machine can have. However, Windows requires more memory during startup than the steady state. As a result, administrators sometimes assign extra memory to a virtual machine because Hyper-V cannot reclaim memory from these virtual machines after startup. In Windows Server 2012, Dynamic Memory introduces a minimum memory setting, which allows Hyper-V to reclaim the unused memory from the virtual machines. This is reflected as increased virtual machine consolidation numbers, especially in Virtual Desktop Infrastructure (VDI) environments.
Windows Server 2012 also introduces Smart Paging for reliable virtual machine restart operations. Although minimum memory increases virtual machine consolidation numbers, it also brings a challenge. If a virtual machine has a smaller amount of memory than its startup memory and if it is restarted, Hyper-V needs additional memory to restart the virtual machine. Due to host memory pressure or virtual machine states, Hyper-V may not always have additional memory available. This can cause sporadic virtual machine restart failures. Smart Paging is used to bridge the memory gap between minimum memory and startup memory, and allow virtual machines to restart reliably.
As in the previous version of Dynamic Memory, you can configure a minimum memory amount for virtual machines in Windows Server 2012, and Hyper-V continues to ensure that this amount is always assigned to running virtual machines.
To provide a reliable restart experience for the virtual machines configured with less minimum memory than startup memory, Hyper-V in Windows Server 2012 uses Smart Paging. This memory management method uses disk resources as additional, temporary memory when more memory is required to restart a virtual machine. This approach has advantages and drawbacks. It provides a reliable way to keep the virtual machines running when there is no available physical memory. However, it can degrade virtual machine performance because disk access speeds are much slower than memory access speeds.
To minimize the performance impact of Smart Paging, Hyper-V uses it only when all of the following occurs:
The virtual machine is being restarted.
There is no available physical memory.
No memory can be reclaimed from other virtual machines running on the host.
Smart Paging is not used when:
A virtual machine is being started from an “off state” (instead of a restart).
Oversubscribing memory for a running virtual machine is required.
A virtual machine is failing over in Hyper-V clusters.
When host memory is oversubscribed, Hyper-V continues to rely on the paging operation in the guest operating system because it is more effective than Smart Paging. The paging operation in the guest operating system is performed by Windows Memory Manager. Windows Memory Manager has more information than the Hyper-V host about memory usage within the virtual machine, which means it can provide Hyper-V with better information to use when choosing the memory to be paged. Because of this, less overhead to the system is incurred compared to Smart Paging.
To further reduce the impact of Smart Paging, Hyper-V removes memory from the virtual machine after it completes the start process. It accomplishes this by coordinating with Dynamic Memory components inside the guest operating system (a process sometimes referred to as “ballooning”), so the virtual machine stops using Smart Paging. With this technique, the use of Smart Paging is temporary and is not expected to be longer than 10 minutes.
Also note the following about how Smart Paging is used:
Smart Paging files are created only when needed for a virtual machine.
After the additional amount of memory is removed, Smart Paging files are deleted.
Smart Paging is not used for this virtual machine again until another restart occurs and there is not enough physical memory.
Hyper-V in Windows Server 2012 enables users to make the following configuration changes to Dynamic Memory when the virtual machine is running:
Increase the maximum memory.
Decrease the minimum memory.