Mastering Windows Server 2016 Hyper-V

(Romina) #1

Memory Resources


When you’re looking at resources used in virtual environments, memory is the other
major type of resource, along with the processor, that typically dictates the number of
virtual machines that can be supported on a host. While logical processors are shared
by virtual processors via rapid context switching, the same technique does not work
with memory. The context—the content of memory itself—cannot be swapped in and
out fast enough to simulate simultaneous execution.


For Windows 2008 and Windows Server 2008 R2 before Service Pack 1, the amount of
memory that was assigned to a virtual machine could not be modified while the
virtual machine was running. If a Hyper-V server had 16GB of memory, and assuming
1GB was kept for the Windows Server parent partition, then 15GB could be assigned to
virtual machines running on the server. That 15GB could be consumed by 1 virtual
machine with 15GB of memory assigned, or 30 virtual machines each using 512MB of
memory.


In this model, each virtual machine must be assigned the most memory it will ever
need. At any specific point in time, however, much of this memory may be unneeded.
For example, half of the VMs on a host may require their full assignment, but the
other half may be experiencing an idle period and not require anywhere near their full
allotment of memory. This can lead to a lot of wasted memory during normal
utilization, which reduces the number of virtual machines that can be hosted on each
server.


Dynamic Memory


Windows Server 2008 R2 Service Pack 1 introduced a new memory optimization
feature, Dynamic Memory. This new technology allows the amount of memory
allocated to a virtual machine to increase and decrease based on the amount of
memory the processes running in the guest operating system need at any given
moment in time. Dynamic Memory is different from memory overcommit used by
other hypervisors. Memory overcommit strategies tell the VM that it has a very large
amount of memory in the hopes that not all VMs try to write to all of the visible
memory. If that were to happen, memory would have to be swapped with other
storage—say compressed memory, shared memory, or disk data—which can drastically
impact VM performance.


Dynamic Memory uses three settings for each virtual machine: an initial, a maximum,
and (in Windows Server 2012 and beyond) a minimum amount of memory. Hyper-V
can intelligently add or remove memory to or from a virtual machine based on its real-
time demand for memory and memory availability on the host. The virtual machine is
initially allocated the amount of memory defined as the startup RAM, and then based
on how the processes inside the virtual machine are using the memory, additional
memory is allocated if available, possibly reallocated from other virtual machines with

Free download pdf