Skip navigation

Can I extend a virtual hard disk file in use by a Windows Server 2012 Hyper-V virtual machine?

A: It's not possible to extend an in-use virtual hard disk (VHD) or VHDX file in Windows Server 2012 Hyper-V. Several alternative actions exist that minimize the potential impact of not being able to extend a VHD on a running virtual machine (VM).

  • Use dynamically expanding VHD files with a large maximum size. Space is only allocated as used and there is really no performance difference between a fixed and dynamic VHDX. The only caveat is to ensure there is some disk monitoring solution on the host to ensure physical disk space doesn't run out as the VHD files expand
  • Add additional disks to the running VM on the SCSI bus. Hot-add of disks on the SCSI bus has been supported since Windows Server 2008 R2 and enables an easy way to add more storage to a running VM (you can't hot-add to the IDE bus)

There are other more creative options available that I wouldn't recommend but might work. One example would be to add more VHDs to a VM on the SCSI bus, then within the VM create a spanned disk using the new disk.

If the guest is Windows Server 2012, you could create a Storage Space within the VM, as it's easy to just add additional disks to an existing Storage Space extending its size. Do NOT try and create a Storage Space in a VM using passthrough disks, as when the host reboots, the host would see the disks have a Storage Pool and try to claim it.

I would also point out Storage Spaces is designed to be used on the host with physical disks and is really not supported in a VM, but I wanted to at least include it here to cover all bases. Another option would be to use disk passthrough to a LUN on a SAN that supported extension.  However, using a passthrough disk means not using a VHD and therefore you lose the benefits of VHD for the VM such as snapshot, backup, VM migration and the use of Hyper-V Replica.

Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish