Answered by:

Expanding a fixed VHDX file - Is data preserved?

Question

I want to expand a fixed .VHDX. It's currently 2 TB and I want to make it 3 TB. I would edit the VHDX with the Edit Wizard in the Settings for the VHDX. Will the data remain safe? Could anyone approximate how long it will take?

Answers

Beginning with Windows Server 2012 R2 you can expand a VM’s VHDX files online while the VM is still running. However, there are a couple of requirements. The virtual hard disk must use the
VHDX format – it can’t be a VHD. Plus, the virtual hard has to be attached to the virtual SCSI controller – it can’t be attached to the virtual IDE controller.

To expand a VHDX use the Hyper-V Manager and click on Edit Disk on the Actions pane. This will launch the Edit Virtual Hard Disk Wizard. First, you use the Locate Disk page to browse to the
location where your VHDX is stored. Next, the Choose Action page to either Compact or Expand the VHDX. To increase the size of the VHDX select the Expand option.

Enter the new size for the VHDX and then click Finish to resize the disk. After resizing the VHDX file you need to go into the VM itself and use Disk Manager to expand the VM’s disk storage.
The new space will be shown as an unallocated disk volume. Use Disk Manager’s Extend Volume Wizard to expand the existing volume to include the new space.

And I don't think expanding VHDX will affect the data in
it, but considering the security of the data, I recommend backing up the important data before expanding VHDX.

All replies

Beginning with Windows Server 2012 R2 you can expand a VM’s VHDX files online while the VM is still running. However, there are a couple of requirements. The virtual hard disk must use the
VHDX format – it can’t be a VHD. Plus, the virtual hard has to be attached to the virtual SCSI controller – it can’t be attached to the virtual IDE controller.

To expand a VHDX use the Hyper-V Manager and click on Edit Disk on the Actions pane. This will launch the Edit Virtual Hard Disk Wizard. First, you use the Locate Disk page to browse to the
location where your VHDX is stored. Next, the Choose Action page to either Compact or Expand the VHDX. To increase the size of the VHDX select the Expand option.

Enter the new size for the VHDX and then click Finish to resize the disk. After resizing the VHDX file you need to go into the VM itself and use Disk Manager to expand the VM’s disk storage.
The new space will be shown as an unallocated disk volume. Use Disk Manager’s Extend Volume Wizard to expand the existing volume to include the new space.

And I don't think expanding VHDX will affect the data in
it, but considering the security of the data, I recommend backing up the important data before expanding VHDX.

One other thing you need to ensure before you start is how you initialized the volume. If you initialized it as an MBR volume, that allows you to create a maximum volume of 2TB. If you want a volume over 2TB in size, the volume must be initialized
as a GPT disk. Microsoft does not provide a way to online change an MBR volume to a GPT volume. You must back up the volume, recreate the volume and initialize it as GPT, then restore the data.

Thanks for the replies. The VHDX is attached to a virtual IDE controller but I wasn't going to do this online. I was going to shut the VM down. I can do it this way correct? The volume is initialized as a GPT so I'm good there.
It's about 6TB.