Hello,
I have some un-allocated disk space that I don't use in a VM with Windows OS and I would like to use it for other purposes, how to release un-allocated disk spare back to the datastore?
*I have vCenter too.
Thank you.
Hi @eugenx
Shrink the disk size of the virtual machine to make this space available for your other purpose.
Thank you. But what is the best way to accomplish it using GUI?
Log in ESXi or vCenter
Right click VM then edit
The image is not available.
No, you should not reduce the size of the vmdk from VM edit settings option.
You may use any of the given method in the following article to do that
continuum is the best person to suggest.
Check
Shrink a VMware Virtual Machine Disk (VMDK) – virtualman
That article may be wrong . check this, for one user, OS never loaded after following the steps in the article .
Best way to shrink a VMDK file (D Drive) of a VM ?
You can verify the steps on a test VM to be sure then do it on your required VM
Hi Eugen
just wrote a blog about a task like this
How to use dd to work with VMDKs stored on VMFS | VM-Sickbay
Scary stuff - but if you want I can assist you.
Ulli
This is way to complicated for me, continuum. Thank you anyway.
Thanks everyone, but all solutions provided not seem to be straightforward and too easy to accomplish. I will leave this matter for better times as I have plenty of space left in my datastore.
Hi Ulli, continuum
Its really a great article indeed.
one thing I noticed that need to be changed .. either the question or the command parameter should be corrected accordingly eager zeroed part has thin in the command ... and vise versa ..
....
Note by Ulli
Thanks for reporting the problem.
The fixed version is online now and in the next post.
Thank you
Ulli
Create a 8GB vmdk with vmkfstools:
vmkfstools -c 8192m 8gb-eager.vmdk -d eagerzeroedthick
Create a 8GB vmdk with dd:
dd if=/dev/zero of=dd-8gb-eager-flat.vmdk bs=1M count=8192 conv=notrunc
This command will take quite a while as the complete size of the new flat.vmdk will be wiped with zeros.
Create a 8GB vmdk with vmkfstools:
vmkfstools -c 8192m 8gb-lazy.vmdk -d zeroedthick
Create a 8GB vmdk with dd:
sorry – I have no idea at the moment.
I also see no reason to use lazy zeroed thick VMDKs at all – so my motivation for further research is limited.
Create a 8GB vmdk with vmkfstools:
vmkfstools -c 8192m 8gb-thin.vmdk -d thin
Create a 8GB vmdk with dd:
dd if=/dev/zero of=dd-8gb-thin-flat.vmdk bs=1M seek=8191 conv=notrunc
This will just add one MB of zeros at the very end of the VMDK.
The space in between the start of the flat.vmdk and the one MB of zeros at the end will be thin provisioned.