In windows server 2022, which virtual image file provides for the largest size?

Just like a physical machine, a virtual machine running on Hyper-V would also require a hard disk to function.

In today’s blog post, we’ll discuss what virtual file formats are supported by Hyper-V and their types. We’ll cover in detail, the different types of VHD/VHDX, and how to choose the right one for your business requirements.

What is a VHD?

A VHD is a type of file format for the virtualized infrastructure, just like a physical hard disk. It has the functionalities of a typical hard drive but is installed and managed in a virtual setup. It often contains the same partitions and sectors as found on a physical drive, like partitioning and the file system. It can be stored in such a place where the physical host can access it.

Compared to physical drives/disks, VHDs can be created in, added to, or removed from a virtual machine much more easily and quickly. They also allow configurations that help you use the available physical disk space efficiently.

What is a VHDX?

VHDX is another virtual file format in Hyper-V, and it came with the release of Windows Server 2012. Before VHDX, Hyper-V virtual hard disks had a capacity of 2TB. VHDX offers a 64TB capacity. They have a 4KB logical sector size which contributes to better performance, and they are designed to be compatible with today’s modern hardware.

In windows server 2022, which virtual image file provides for the largest size?

Know more: VHD and VHDX disk overview and conversion

Types of VHD/VHDX

Be it a VHD or VHDX, there are basically three types of disks available that you can choose from:

  • Fixed Disk
  • Dynamic Disk
  • Differencing Disk

What is a Fixed Disk

A fixed-size VHD simply takes up the entire space that is allotted to it during VM creation. The VHD size does not change when data is created or deleted.

For example, if you create a 127 GB fixed VHD, then it means 127 GB disk space of the host storage will be dedicated for this VHD alone.

The fixed type disk is zeroed out when it is created. This, in turn, leads to better performance as Hyper-V doesn’t have to perform a ‘zero operation’ when the first write to the disk takes place. The disks are zeroed out as a security measure so that any underlying data in the physical storage area cannot be accessed by a disk-scanning tool in the virtual machine.

Disk fragmentation occurs when files are written and deleted over time. When you delete a file, it is marked as write-over. So the next time when a new file is created, it simply writes over the space, and if this file happens to be larger than the existing file, then the remaining portion is written in the next available space. Eventually, you will be left with many files broken up into multiple locations across the hard drive. Thus, the files will be available as non-contiguous clusters, which increases the read time.

When it comes to fixed-size VHDs, disk fragmentation is not a major concern, though it occurs if you manually expand the disk or if the disk is created in an already full volume.

Pros:

  • Fastest among the VHD types
  • Better performance for workloads that are sensitive to disk performance
  • Not prone to disk fragmentation

Cons:

  • Creating a fixed disk is a time-consuming process
  • They do not have dynamic growth
  • If the VHD created is too large, there’s no way to re-allocate it any other resource
  • Potential for wasted disk space

In most cases, it is recommended to you use fixed disk since it has better resiliency and performance characteristics compared to the other disk types.

What is a Dynamically expanding Disk

This type of disk expands as data is written to it. The virtual hard disk file that is created at first is small, and it grows as and when data is added to it.

This is the default type that’s selected when you create a VHD.

The file starts out very small with a preset maximum size. This file size grows in chunks as data is added, and the file stops growing when the preset maximum size is reached. When creating a dynamic volume, you must still specify the initial disk size, but the host disk usage is based on how much data is actually being stored in that volume.

For example, if you initially create a 127 GB VHD but the virtual machine only requires 40GB, then only 40GB will be consumed from the host physical disk storage, and the disk will grow in size later as data gets written to it.

In dynamically expanding disks, disk space is zeroed only as and when data is written to it. Also, these disks require a lot of planning and monitoring, as disk space could easily fill up the datastore and take production loads offline unexpectedly.

Though the obvious issue with dynamic disks seems to be the gradual growth of data, the real issue actually lies with the read speeds. Consider the case where 20 small dynamic virtual hard disks on the same volume are each separately growing a block at a time. They cause fragmentation across volumes. This affects the sequential reads as the underlying physical spindles have to spend time bouncing from one block to another within the volume to read the required data.

Pros:

  • Better usage of physical storage space
  • Occupies lesser than 1GB of space initially
  • Offers better growth performance
  • Easy to copy virtual disk files between machines

Cons:

  • Possibility of disk space filling up the datastore
  • Slower read rates
  • Prone to disk fragmentation

Dynamic disk types are recommended for cases where storage is a major concern because it offers resiliency in addition to space savings.

What is Differencing Disk

A differencing disk is a virtual hard disk that is basically a dynamic volume that’s chained to a parent disk. They can be configured with a parent-child relationship to form a hierarchy of VHDs.

A differencing/child disk contains block-level data that represents changes to a parent VHD. Each differencing disk can have only one parent, and the parent can be either a fixed, dynamic, or another differencing virtual disk. The parent can’t be a LUN, remote share, file systems, pass-through disks, etc. Hyper-V can merge all the differencing disks back to the parent, thereby destroying the child disks. For Hyper-V versions above 2008 R2, the merging operation can take place while the disk is in use.

The child disks are usually small, however, they can grow up to the size of the root parent. A differencing disk attached to a dynamic parent can outgrow it, if that disk isn’t fully expanded.

This type of VHD is usually intended for VMs that will have a short life, like pooled Virtual Desktop Infrastructure (VDIs), or test labs. A single parent VHD can be created with a generalized OS, and multiple VMs can be provisioned with differencing VHDs. The new VMs use the shared OS from the parent disk to boot. The differencing VHDs start out small and will grow as data is added to them. The parent disk will have multiple input operations as it is the common denominator. This type of pooled operation is not suitable for personal VDI VMs because you cannot inherit the changes and you have to delete and start again.

You can create a differencing disk based on any parent virtual hard disk using PowerShell or Hyper-V Manager. They are usually created during backup operations and deleted immediately once the backup is complete. However, manual creation is also possible, and it might be useful in the case of the above-mentioned scenarios like creating pooled VDI. But, management could be a little more difficult than expected and there are no other tools to aid you.

When differencing disks are used for the long term, there arises steady performance drop and storage problems, hence it is not ideal for use in production servers.

Pros:

  • Helps in keeping the consistency of base image
  • Good performance for short-lived machines
  • Ability to isolate changes on parent disk, useful for troubleshooting and analysis

Cons:

  • Not suitable for VMs with a long life span
  • Unpredictable storage utilization patterns
  • Possibility of over-provisioning host storage
  • Added complexity when relocating parent disk

Concluding thoughts

While each disk type has its own benefits, it is advisable to choose the disk type based on your specific use case. This way, you can derive the maximum benefit out of it, and make it beneficial for your environment.

When it comes to the production environment, it boils down to the below:

  • If performance is of more concern than storage space, then go with Fixed disks
  • If storage space is more of a concern than performance, then opt for Dynamic disks
  • If you’re looking to run a test environment or create pooled VDIs, then go for Differencing disks

How can Vembu help you?

Vembu’s flagship product – BDRSuite, is a comprehensive Backup & DR solution designed to protect your business-critical data across Virtual (VMware, Hyper-V), Physical Servers (Windows, Linux), SaaS (Microsoft 365, Google Workspace), AWS EC2 Instances, Endpoints (Windows, Mac) and Applications & Databases (MS Active Directory, MS Exchange, MS Outlook, SharePoint, MS SQL, MySQL).

To protect your workloads running on Hyper-V, check out our BDRSuite for Hyper-V. You can backup your Hyper-V VMs at the Host level and Cluster Level running on local Storage, Cluster Shared Volumes (CSV), Storage Spaces Direct (S2D), SMB share – Standalone File Server, Clustered File Server & Scale-Out File Server (SOFS).

Download a full-featured 30-days Free Trial of the latest version of BDRSuite and try it in your environment.

If you are an IT administrator, a student, or a beginner who would like to learn more about the Hyper-V platform, please check out our series of blogs on Hyper-V:

What's the biggest changes in Windows Server 2022?

The new security capabilities in Windows Server 2022 combine other security capabilities in Windows Server across multiple areas to provide defense-in-depth protection against advanced threats. Advanced multi-layer security in Windows Server 2022 provides the comprehensive protection that servers need today.

How many virtual machines can I run on Windows Server 2022 Standard?

It has a total of 6 VMs. I was reviewing that the limitation in HYPER-V with WS2022 Standard is that it only allows you to create two virtual machines with the licensed host. As WS2022 has 180 days of free license, I could do the migration of the 6 virtual machines without problems?.

What virtual disk is one whose maximum size is allocated at the time of creation?

There are three main classifications of virtual hard drive files -- fixed, dynamic and differencing. A fixed virtual hard disk file is a file that claims the maximum possible amount of physical disk space at the time of creation.

What is VHD and VHDX?

As enterprise workloads for virtual environments grow in size and in performance demands, virtual hard disk (VHD) formats need to accommodate them. Hyper-V in Windows Server 2012 introduces a new version of the VHD format called VHDX, which is designed to handle current and future workloads.