none
Expanding a fixed VHDX file - Is data preserved? RRS feed

  • 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?
    Wednesday, April 24, 2019 4:06 PM

Answers

  • Hi,

    Thanks for posting in our forum!

    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.

    For more information, you can see here:

    https://docs.microsoft.com/en-us/windows-server/administration/performance-tuning/role/hyper-v-server/storage-io-performance

    Also you can see it:

    https://www.altaro.com/hyper-v/understanding-working-vhdx-files/

    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.

    Hope this information can help you, if you have any question, please feel free to let me know.

    Best Regards,

    Daniel


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Thursday, April 25, 2019 2:30 AM
    Moderator

All replies

  • Hi,

    Thanks for posting in our forum!

    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.

    For more information, you can see here:

    https://docs.microsoft.com/en-us/windows-server/administration/performance-tuning/role/hyper-v-server/storage-io-performance

    Also you can see it:

    https://www.altaro.com/hyper-v/understanding-working-vhdx-files/

    Please Note: Since the web site is not hosted by Microsoft, the link may change without notice. Microsoft does not guarantee the accuracy of this information.

    Hope this information can help you, if you have any question, please feel free to let me know.

    Best Regards,

    Daniel


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Thursday, April 25, 2019 2:30 AM
    Moderator
  • 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.

    tim

    Thursday, April 25, 2019 12:45 PM
  • 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.
    Thursday, April 25, 2019 3:50 PM
  • At least i think so, we cannot modify anything on a VHDX connected to the virtual IDE bus while the virtual machine is online. The virtual SCSI bus allows for online modification.

    When we let this VM offline, i think we can do this.

    Best Regards,

    Daniel


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Friday, April 26, 2019 1:30 AM
    Moderator
  • Hi,

    This is Daniel and wish you all the best!

    Sorry to bother you, but I just hope you can help me mark useful replies as answers to help other people with the same questions find the answers quickly.

    Thank you very much!

    Best Regards,

    Daniel


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, April 29, 2019 8:12 AM
    Moderator
  • Hi Daniel.  I am going to try this today if I get the time.  I will post back.  Thank you.
    Monday, April 29, 2019 11:54 AM
  • OK, please let me know if you have any question.

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Tuesday, April 30, 2019 1:46 AM
    Moderator
  • Thanks all.  It worked.  Data was left intact.
    Thursday, May 9, 2019 3:59 PM
  • You are welcome!


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Friday, May 10, 2019 1:09 AM
    Moderator