Mastering Windows Server 2016 Hyper-V

(Romina) #1

Virtual Storage


I previously covered the IDE controller and the SCSI controller, which support storage
to be attached. There are primarily two types of storage: virtual hard disks and pass-
through storage. Before I even start discussing the technologies, I want to be clear:
always use virtual hard disks! While pass-through storage was required in some
scenarios in Windows Server 2008 R2 Hyper-V, it should never be needed with the
new VHDX format in Windows Server 2012 Hyper-V, so don’t use it. I will, however,
cover it briefly for completeness.


Processor and memory are important resources to virtual machines, but storage is
also critical. There are ways to enable a Windows Server 2008 R2 and above Hyper-V
virtual machine to boot from a SAN by attaching to the LUN from the Hyper-V host
and then mapping the disk directly to the VM using the pass-through disk capability of
Hyper-V. In most cases, though, virtual machines will have some dedicated storage.


VHD


The most common and recommended storage for a virtual machine is the use of a
virtual hard disk, which prior to Windows Server 2012 was the VHD format. In
Windows Server 2008 R2, the VHD format is a core part of the operating system, and
from a performance analysis, there is only a negligible difference from using a pass-
through disk. VHDs can be mounted using Windows Server 2008 R2 and above disk
management tools, and physical computers can boot from VHDs using the Boot from
VHD feature available in Server 2008 R2 and Enterprise and above versions of
Windows 7.


A VHD can be up to 2TB in size, and several types of VHDs are available:


Dynamically Expanding   This    is  the most    popular format. The virtual hard    disk
is created using a minimal amount of disk space. As the disk is used, the file
expands on the filesystem to accommodate the data written to the disk, up to the
size specified as the size for the virtual hard disk. This option is the most efficient
use of the disk space, because space is not used on the physical hard drives unless
needed. In Windows Server 2008, there was a performance penalty with dynamic
disks, such as when a write was performed, the file had to grow. However, the VHD
implementation was rewritten in Windows Server 2008 R2, and this performance
penalty is negligible. A dynamically expanding disk does not shrink if data is
deleted unless a compact operation is performed. This type of disk is also
commonly referred to as thinly provisioned, because it starts off thin and grows as
data is written to it.
Fixed Size In this case, the size specified for the virtual hard disk is allocated and
used when the disk is created. If a 127GB fixed-size virtual hard disk is created, a
127GB VHD file is created on the Hyper-V server. This is likely to lead to a less
Free download pdf