Microsoft Hyper-V administration requires a good working knowledge of the Hyper-V infrastructure to be able to troubleshoot, identify and manage issues as well as configurations in the Hyper-V environment. One area of understanding Hyper-V infrastructure is, knowing the various files and file types that are utilized by Hyper-V and how each of these come into play with running production workloads.
With Windows Server 2016 Hyper-V there have also been new types of files that have been introduced into the Hyper-V architecture.
In this post, we will take a closer look at the various files that make up a Hyper-V virtual infrastructure and the role each plays in the functionality of a virtual machine and relevant technologies.
New Windows Server 2016 Hyper-V Files
To begin with, Hyper-V files architecture, let’s begin by taking a look at the files that are new to Hyper-V as of Windows Server 2016. There are several new files that make up Windows Server 2016 Hyper-V configuration.
Virtual Machine Configuration files. Starting with Windows Server 2016, Microsoft has made the move away from XML files as the virtual machine configuration file. The new VMCX file is a binary file format which has several advantages over the older XML format.
First of all, the binary format is more difficult to edit. That may sound like a disadvantage, however, the easy ability to edit the file outside of the proper means to do so could lead to issues. The text-based nature of the file in the XML format is also more vulnerable to corruption, especially in a sudden power outage.
To properly interact with the file in a low-level way you need to use the Hyper-V management tools or PowerShell.
Stands for Virtual Machine Runtime State files. These are runtime state data files which contain the volatile state of the running virtual machine for VM configuration versions later than version5 (Hyper-V 2016). This file type replaces the .bin and .vsv file.
Other Hyper-V Files for Legacy Hyper-V and Hyper-V 2016
There are other Hyper-V file types that are used by Hyper-V as part of the Hyper-V virtual machine file system infrastructure. They include the following:
Pre-Windows Server 2016 Hyper-V
Including Windows Server 2016
- VHD and VHDX
- AVHD and AVHDX
As we have already mentioned, with Windows Server 2016, the BIN, VSV, and XML files have been replaced. However, let’s consider these file types as they apply to pre-Windows Server 2016 Hyper-V versions.
Hyper-V saved state is the state of a virtual machine that is not running but has its memory and disk contents stored in files. The BIN file is the file that legacy Hyper-V versions (Windows Server 2012 R2 and older) utilize to place virtual machine memory into a saved state. The BIN file size is equivalent to the Hyper-V virtual machine’s allocated memory. This file is pre-allocated for the best performance and speed of saving the saved memory state and this also ensures the needed space is already committed, for saving the memory state.
The VSV file is also part of the “saved state” architecture used in Hyper-V. The VSV file contains information about the virtual machine’s hardware. All of this information is encapsulated into a file that is quite small (only a few megabytes).
We have already covered this to some degree while discussing the newer Windows Server 2016 VMCX configuration file format. The XML file format is used in Windows Server 2012 R2 Hyper-V and earlier as the configuration file format. The XML file format is easily edited (either a pro or con depending on how you look at it) and encapsulates the active and snapshot configuration of virtual machines.
The SLP file format is utilized by Windows Server 2012 and newer Hyper-V to implement a technology called Smart Paging. With Smart Paging, Windows Server Hyper-V implements a secondary paging mechanism that helps to alleviate memory stress induced from virtual machine boot up. This is generally triggered either with a guest operating system reboot or an entire host restart. Smart Paging is somewhat of a last resort as Hyper-V will attempt to utilize other means to alleviate memory pressure such as Dynamic Memory releases on other VMs, etc.
The VFD image file or Virtual Floppy Disk image is used to emulate floppy disk drives on a virtual machine.
VHD and VHDX
The VHD and VHDX files are perhaps the most well-known file type among those familiar and even not so familiar with Hyper-V file infrastructure.
The VHD and VHDX files are the actual virtual hard disk files utilized by Hyper-V to store virtual machine data. The VHD and VHDX files will by far take up the most space in the Hyper-V storage.
Since VHD and VHDX are both virtual hard disks, what are the differences between the two?
VHD files are the older of the two formats and were the original virtual disks that were utilized when Hyper-V was first introduced. It is known as the first generation of Microsoft’s hypervisor virtual disk formats. There are certainly differences in the two virtual hard disk formats in terms of configuration maximums. VHD files have an upper size limit of 2 terabytes.
The next generation of Hyper-V virtual disk format is the VHDX format. It extends the configuration maximum for hard disk size to 64 terabytes. Additionally, there is the added benefit of power loss protection with VHDX files. VHDX is not supported in operating systems prior to Hyper-V 2012 and Windows 8. VHDX files can also support 4K sectors on the newest HDDs available.
In addition to being able to utilize either the VHD or VHDX virtual disk formats, Hyper-V administrators have the choice between utilizing fixed, dynamic, or differencing disks.
What are the use cases for each of these different types?
Fixed disks are either VHD or VHDX virtual disks that are provisioned up front with the full intended amount of storage space on the Hyper-V storage volume. This is referred to as “thick provisioning”.
As the name indicates, the fixed Hyper-V disk generally does not change size for the life of the virtual disk. However, “fixed” virtual disks can be extended using the Hyper-V manager or using PowerShell. Fixed Hyper-V disks provide the best performance of all the virtual disk types since the zero operation has already been performed. Prior to Windows Server 2016, creating a fixed size virtual disk took tremendously longer than dynamic virtual disks due to the zeroing operation on the virtual disk being performed up front.
With Windows Server 2016, there is a new feature called Accelerated VHDX Operations that rely on the new ReFS file system with Hyper-V. With Accelerated VHDX Operations, ReFS is able to perform operations such as creating VHD and VHDX files, extending VHD and VHDX and growing dynamic VHD and VHDX virtual disks instantaneously. This is because ReFS only updates the metadata and does not have to zero out the actual blocks of storage.
Dynamic disks are disks that are provisioned with the intended size up front, however, the underlying space on the physical storage is only provisioned as space is used. This is known as “thin provisioning”. The “zeroing” operation happens on the fly as space is taken. Dynamic disks are a great way to overprovision the actual physical storage space that exists to squeeze out even more efficiency. However, there is also the added danger with dynamic disks of storage space being exhausted. If a massive amount of data is copied to a virtual file server all at once, the perceived “free space” can quickly be taken and storage can be knocked offline. Hyper-V will pause all virtual machines when storage is exhausted on a physical volume.
Differencing disk (AVHD and AVHDX)
The last type of VHD or VHDX file is called a differencing disk. The differencing disk is a special kind of virtual disk that exists in the format of (AVHD or AVHDX). When a Hyper-V checkpoint is created, the AVHD or AVHDX file that is created is a differencing disk. The AVHD or AVHDX virtual disk records write operations once the checkpoint is created. When a read operation happens, the differencing disk is checked to see if it has a newer version of the file. If it doesn’t the parent VHD or VHDX file is checked for the file in the read operation. It is important to note, that differencing disks can be utilized in conjunction with either a fixed or a dynamic disk type in Hyper-V.
As you can see, there are many different types of files that are utilized in Microsoft Windows Server Hyper-V infrastructure. The various disk types all serve a purpose in the proper functionality of a Hyper-V virtual machine. Additionally, with Windows Server 2016, there are new file types that have been introduced along with the Accelerated VHDX Operations that can be used with the new ReFS file system version. The Accelerated VHDX Operations allow for almost instantaneous “zeroing” operations due to the operation being performed on the metadata and not the actual file level blocks.