locked
Can we Expand a VHD or VHDX Without a Reboot in Hyper-V 3? RRS feed

  • Question

  • Will it be possible to resize a VHD/VHDX in Hyper-V 3 while the VM is online?

    Wednesday, July 18, 2012 6:50 PM

Answers

  • The maximum size of the virtual disk (VHD or VHDX) can only be increased when the server to which it attached is offline.
    • Marked as answer by Vincent Hu Thursday, July 19, 2012 1:40 AM
    Wednesday, July 18, 2012 8:00 PM
  • Richard is right.

    While Server 2012 Hyper-V allows deleted shapshots be be merged while a VM is running you cannot modify the structure of the VHD file itself. 

    Thre are lots of reasons for this, mostly having to do with the OS in the VM perceiving the VHDx as a phsyical disk, and the OS file system not dealing with that.

    In spite of that I thought I would try to see what happens...

    Use the edit disk wizard to exapnd and there is a big warning on the GUI that says not to do it as data loss may occur (washing their hands of your actions).

    I pushed on and "the server encountered an error trying to edit the virtual disk"

    The disk is being used by another process.  This is while the VM is running.

    Mind you, you can create a snapshot / differencing disk and modify the root virtual disk - but then the chain is broken because the disk geometry changes.

    I just tried Optimize-VHD and the same result, the VHDX is locked.


    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.
    Disclaimer: Attempting change is of your own free will.

    • Marked as answer by BrianEhMVP Thursday, July 19, 2012 3:05 AM
    Wednesday, July 18, 2012 8:26 PM

All replies

  • The maximum size of the virtual disk (VHD or VHDX) can only be increased when the server to which it attached is offline.
    • Marked as answer by Vincent Hu Thursday, July 19, 2012 1:40 AM
    Wednesday, July 18, 2012 8:00 PM
  • Richard is right.

    While Server 2012 Hyper-V allows deleted shapshots be be merged while a VM is running you cannot modify the structure of the VHD file itself. 

    Thre are lots of reasons for this, mostly having to do with the OS in the VM perceiving the VHDx as a phsyical disk, and the OS file system not dealing with that.

    In spite of that I thought I would try to see what happens...

    Use the edit disk wizard to exapnd and there is a big warning on the GUI that says not to do it as data loss may occur (washing their hands of your actions).

    I pushed on and "the server encountered an error trying to edit the virtual disk"

    The disk is being used by another process.  This is while the VM is running.

    Mind you, you can create a snapshot / differencing disk and modify the root virtual disk - but then the chain is broken because the disk geometry changes.

    I just tried Optimize-VHD and the same result, the VHDX is locked.


    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.
    Disclaimer: Attempting change is of your own free will.

    • Marked as answer by BrianEhMVP Thursday, July 19, 2012 3:05 AM
    Wednesday, July 18, 2012 8:26 PM
  • Thanks for the fast response on that!  I was just about to remote in to a Win 2012 machine and check it out myself, but you saved me the legwork!

    Wednesday, July 18, 2012 9:05 PM
  • I wasn't going to try.

    And then I got curious as the wizard was not blocking me.


    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.
    Disclaimer: Attempting change is of your own free will.

    Wednesday, July 18, 2012 9:09 PM
  • A Windows guest (that supports extending volumes) running on VMware vSphere can be expanded whilst running so why can't it be done in Hyper-V 2012?    Considering all the improvements of Hyper-V 3 with live storage migration and merging snapshots online I would have thought it be possible.
    Tuesday, November 13, 2012 8:55 AM
  • A Windows guest (that supports extending volumes) running on VMware vSphere can be expanded whilst running so why can't it be done in Hyper-V 2012?    Considering all the improvements of Hyper-V 3 with live storage migration and merging snapshots online I would have thought it be possible.

    Same question here... Whit out this i think that Hyper-V isn't even close to vMware.

    Wednesday, January 9, 2013 9:34 AM
  • Same question here... Whit out this i think that Hyper-V isn't even close to vMware.

    To say that hv3 isnt anywhere close to vmware because you can't live resize a disk is a little shortsighted in the overall scheme of things, imo. With that said, however, this would top my feature request list. :)
    Thursday, May 23, 2013 6:59 PM
  • A Windows guest (that supports extending volumes) running on VMware vSphere can be expanded whilst running so why can't it be done in Hyper-V 2012?    Considering all the improvements of Hyper-V 3 with live storage migration and merging snapshots online I would have thought it be possible.

    Every enterprise SAS controller or SAN can expand a LUN while Windows is running. A simple refresh of the disk in Windows will show the extra space. If I'm correct online disk expanding was introduced in Windows 2008. Online VHD expanding is on top of my wish list.

    Gert MCITP SA, EA & VA

    Thursday, June 27, 2013 8:14 PM
  • 2012 R2 (it has been announced)

    VM SCSI controller attached virtual disks can be dynamically resized (grown).

    This can be data disks with generation1 VMs, or the OS disk and data disks with Generation2 VMs.  They just have to be SCSI attached (following the SAS comment above).


    Brian Ehlert
    http://ITProctology.blogspot.com
    Learn. Apply. Repeat.
    Disclaimer: Attempting change is of your own free will.

    • Proposed as answer by Gert Hylkema Friday, June 28, 2013 11:57 AM
    Thursday, June 27, 2013 8:22 PM
  • Great, thank you for your help.

    Gert MCITP SA, EA & VA

    Friday, June 28, 2013 11:57 AM