question

KuppusamyS-8795 avatar image
0 Votes"
KuppusamyS-8795 asked DSPatrick answered

Shrinked free space from Hyper-V VM is not appearing in host machine

Hello All,

I have a VM server running on Hyper-V 2012 R2. I want to reduce the space from D-Drive around 1TB out of 1.8TB. I have shrink the space after shutdown the VM and it was done. VM server showing the new size of 800GB, but the free space of 1TB is not showing in my host server. Still the VM size is 1.8TB showing in Windows file explorer.

Please help us to get the unallocated space from VM into the Hyper-V host server.

Thanks in advance...

S.K. Samy

windows-server-hyper-v
· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi,

I would like to check if the issue has been fixed? If yes, please help accept answer, so that others meet a similar issue can find useful information quickly. If you have any other concerns or questions, please feel free to feedback.

Best Regards,
Danny

0 Votes 0 ·

Hi,

I would like to check if the issue has been fixed? If yes, please help accept answer, so that others meet a similar issue can find useful information quickly. If you have any other concerns or questions, please feel free to feedback.

Best Regards,
Danny

0 Votes 0 ·
DSPatrick avatar image
0 Votes"
DSPatrick answered DSPatrick edited

After you Resize-VHD then you'll need to Optimize-VHD.

--please don't forget to upvote and Accept as answer if the reply is helpful--






5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

YuhanDeng-MSFT avatar image
0 Votes"
YuhanDeng-MSFT answered

Hi Samy,
To shrink a volume you can refer to this:
https://docs.microsoft.com/en-us/windows-server/storage/disk-management/shrink-a-basic-volume

Also as Patrick has mentioned, to apply the changes you made to the disk, you need to optimize it after resizing.
For resizing:
https://docs.microsoft.com/en-us/powershell/module/hyper-v/resize-vhd?view=windowsserver2019-ps

And for optimizing:
https://docs.microsoft.com/en-us/powershell/module/hyper-v/optimize-vhd?view=windowsserver2019-ps

Thanks for your Time.
Best regards,
Danny


If the Answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

KuppusamyS-8795 avatar image
0 Votes"
KuppusamyS-8795 answered DSPatrick commented

Thanks Patrick & Yuhan,

I was already shrink the VHDX disk inside VM using DISK MGMT and it was showing the free space as unallocated. I have shutdown the VM and resized (shrink again) the disk from Hyper-V manager using VM disk edit settings. It was completed successfully, but still that actual size of the VM after shrink (800GB) was not reflected in file size when I checked in the file properties (1.8TB).

Also the shrink space of 1TB is not appearing/adding into my host server HDD space.

Thanks in advance if anyone provide me the solution.

· 2
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Did you check my reply above? After you resize you must then optimize.
https://docs.microsoft.com/en-us/powershell/module/hyper-v/optimize-vhd?view=windowsserver2019-ps

--please don't forget to upvote and Accept as answer if the reply is helpful--


0 Votes 0 ·
YuhanDeng-MSFT avatar image
0 Votes"
YuhanDeng-MSFT answered

Hi Samy,
Maybe you can refer to this:
https://www.altaro.com/hyper-v/shrink-hyper-v-virtual-disk-vhd-vhdx/
Please note: Information posted in the given link is hosted by a third party. Microsoft does not guarantee the accuracy and effectiveness of information.

If it doesn’t work, you might want to try Powershell commands:
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/shrink

Thanks for your Time.
Best regards,
Danny


If the Answer is helpful, please click "Accept Answer" and upvote it.

Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

DSPatrick avatar image
0 Votes"
DSPatrick answered

Just checking if there's any progress or updates?

--please don't forget to upvote and Accept as answer if the reply is helpful--








5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.