Asked by:

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

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)?

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

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.