none
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..

    https://www.altaro.com/hyper-v/creating-generation-2-disk-powershell/

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

    HTH
    _mario

    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.

    HTH
    _mario

    Tuesday, October 15, 2019 7:07 AM