In VM from disk2vhd, resize to respect actual size of host drive? RRS feed

  • Question

  • I have created a Hyper-V VM from a physical machine using disk2vhd. One drive in the physical machine had approx 4TB free of 5TB. Where the VM is hosted has nothing like this amount of free space (when viewed from the host OS), yet the VM reports this huge amount of free space. One user unwittingly created a situation where the whole setup ran out of space, because of this 'misleading' free space indication in the VM. Hyper-V Manager shows, for this VM, 2 IDE Controllers and 3 VHDX files. All is working fine, but I would prefer to resize the discs in the VM (if that is a solution) to accurately reflect the actual storage available on the host. How can I do this resizing successfully? Also, I would like to limit the growth of the VM on the host. If I do this, how will I know the real and actual free space on the VM (from within the VM)?
    Thursday, January 31, 2019 9:06 AM

All replies

  • Anyone have any ideas?
    Monday, October 14, 2019 9:05 AM
  • create a new vhdx using powershell of the size needed..


    Then using software like Macrium Reflect, copy the content of the actual disk on the new one with the right desired size..


    Monday, October 14, 2019 12:27 PM
  • Thanks - really appreciate your reply and that is a good link. Unfortunately I have the VM set up and in use, and so any changes have to be done to this 'live' system. Ideally, I would like to, within the VM, resize the drives (there are three) to match the physical reality e.g. I have a drive in the VM which reports 4TB free. That was true on the physical machine, but completely wrong (too big) in the VM.

    Maybe the only way is by hand - working out the max drive sizes based on the VHDX sizes...

    Tuesday, October 15, 2019 2:17 AM
  • Then you can use Macrium Reflect to resize the vhdx to the size you need.

    Then stop the VM, and with the tool choose edit disk and compact. This should reduce the size to the desired one.


    Tuesday, October 15, 2019 7:07 AM
  • Thanks, and sorry for the long delay, but I don't have a need to resize the vhdx (by which I mean the actual .vhdx file). If this file is, say, 200G on a drive with a physical size of 500G, the question is how to resize the internal drives to match this physical size. For example, say this VM had an internal drive which, when viewed from within the VM, was seen to have a size of 600G, due to it originating from some disk2vhd process on a bigger machine. Clearly, it would be preferable to be able to trim this to more closely match the physical limits.
    Thursday, December 12, 2019 2:22 AM