March 8, 2017
How to Create a Fixed-Size Hard Disk for a Hyper-V VM
In the previous post, we took a look at creating a virtual machine in Hyper-V and the various settings and considerations for choosing options for our new virtual machine. One of the topics mentioned that we want to take a closer look at here is how to create a fixed size hard disk on a guest Hyper-V VM. There are still a lot of differing opinions and conflicting documentation out there between when and when not to use dynamic disks vs fixed size disks.
For VHD formats, fixed size disks are definitely recommended for production use. However, with VHDX formats now, the differences between the two are less pronounced. Even with VHDX formats, there are reasons that many are still leaning towards using fixed size disks in production environments.
Even with VHDX files, there is still an IOPs hit when dynamic disks expand. This is not seen in fixed size disks. Many may initially use dynamic disks to save space, however, since dynamic disks expand on the fly, they are prone to fragmentation which can impact performance.
Another important factor in considering the disk type, when thinking about managing available free space on a SAN or other storage medium, dynamic disks pose the danger of filling up available storage and take VMs offline. This is especially true since when creating dynamic disks, storage can be overprovisioned. This means you can allocate more disk space to VMs than you have available. If the dynamic disks begin to expand due to storage space requested, available free space on a SAN or other storage medium can quickly diminish. Free space can disappear and take all VMs offline.
Creating a fixed size hard disk for Hyper-V VM
Let’s look at the process to create a fixed disk on a Hyper-V virtual machine that we have created. When we run the New Virtual Machine Wizard and choose the third option, we are telling the New Virtual Machine Wizard not to create a hard disk for the VM – we intend to do it later.
After we finish out the wizard to create the Hyper-V VM, we can go back into the properties of the VM and add a hard disk. By choosing to add a hard disk later, we have the option to choose to add a fixed size disk. In the properties of your Hyper-V VM, choose SCSI Controller and then select Hard Drive and click the Add button.
Click the New button.
This will begin the New Virtual Hard Disk Wizard.
Here we can choose Fixed size, Dynamically expanding, or differencing. Since we want to create a fixed size or thick provisioned disk, we select that option below.
We name the Hyper-V VHD (virtual hard disk) and choose the location.
We set the size of the Hyper-V VHD.
Finally, we finish out the configuration and provisioning of the new virtual hard disk.
Creating a fixed size disk for Hyper-V VM has many benefits in thinking about performance, disk fragmentation, and storage manageability. For many in production environments, fixed size disks may still be the preferred type in provisioning production VM disks. Performance and storage space manageability are critical elements in thinking about production virtual machine resources. Both of these are better satisfied with fixed disk types.