Information Technology Reference
In-Depth Information
I/O in a Virtual Environment
A hardware virtual machine (HVM) performs I/O emulation at the chip level. With
HVMs,thevirtualmachine'soperatingsystemthinksthereis,forexample,anactualSATA
hard drive controller installed. This lets the virtual machine use an unmodified operating
system. However, such emulation is rather slow. On an HVM, every time the OS tries to
access the SATA controller, the CPU's virtualization feature detects this access, stops the
virtualmachine,andgivescontroltotheVMM.TheVMMperformsthediskrequest,emu-
lating a real SATA controller and placing the result where the actual chip would have. The
virtual machine is then allowed to continue where it left off. It sees the result and is none
the wiser.
Paravirtualization (PV) performs I/O emulation at the device level. PV requires the
operating system to be modified so that the I/O calls it would normally perform are instead
donebyrequeststotheVMM.TheVMMhandlestheI/Oandreturnstheresult.Themodi-
fications usually take the form of device drivers that look like standard hard disks, video
displays, keyboards, and so on, but are actually talking to the VMM. PV is able to perform
the requests more efficiently since it captures the request at a higher level of abstraction.
Virtual machines are allocated a fixed amount of disk space, memory, and CPU from
the physical machine. The hard drive a VM sees actually may be a single large file on the
physical machine.
Disadvantages of Virtual Machines
Some resources, such as CPU cores, are shared. Suppose a physical machine has a four-
core CPU. Three virtual cores may be allocated to one virtual machine and three virtual
coresmaybeallocatedtoanothervirtualmachine.TheVMMwillload-sharethesixvirtual
coresonthefourphysicalcores.Theremaybetimeswhenonevirtualmachineisrelatively
idle and does not need all three virtual cores it was allocated. However, if both virtual ma-
chines are running hard and require all six virtual cores, each will receive a fraction of the
CPU's attention and so will run more slowly.
A virtual machine can detect CPU contention. In Linux and the Xen hyper-visor, this is
called “steal time”: it is the amount of CPU time that your virtual machine is missing be-
causeitwasallocatedtoothervirtualmachines( Haynes2013 ) .IaaSprovidersusuallycan-
notprovideguaranteesofhowmuchstealtimewillexist,norcantheyprovidemechanisms
to control it. Netflix found the only way it could deal with this issue was to be reactionary.
If high steal time was detected on a virtual machine in Amazon Web Services (AWS), Net-
flix would delete the virtual machine and have it re-created. If the company was lucky, the
new virtual machine would be created on a physical machine that was less oversubscribed.
This is a sorry state of affairs ( Link 2013 ).
Search WWH ::




Custom Search