I tried "Edit/Compact" on VHD file, but the physical size remained the same (only 1MB lower).
I also tried to define a new VM without vhd, then I added a new vhd file and used "Copy the content of the specified virtual hard disk". And again the physical size was the same.
----------------------------
I solved the problem with disk2vhd
(https://technet.microsoft.com/en-us/library/ee656415.aspx?f=255&MSPPError=-2147217396).
I started disk2vhd inside VM and created a new vhd file on a network location.
BINGO !!!
The physical size of the new vhd was decreased from 537GB to 160GB.
Then I replaced the vhd in VM. (I renamed the files only)
Then there was an access problem of the new vhd and the VM didn't start.
I used this to fix this acces problem -->
https://support.microsoft.com/en-us/kb/2249906
And BINGO again !!!
The VM with the new small vhd started the OS and was fully operational.
WARNING !!!
As I said, there was an access problem. Read the document first (https://support.microsoft.com/en-us/kb/2249906)
And also, do not use this info directly in case your VM is a domain member. Think twice before starting the VM with the new small vhd. It is possible to be forced to join the VM to the domain again and be sure, you have such rights.
----------------------------
I apologize for my poor English.
-
Edited by
DimiterS
Friday, July 24, 2015 9:49 PM
-
Proposed as answer by
Boudewijn Plomp
Saturday, July 25, 2015 8:22 AM