VMware Cloud Community
EugenX
Contributor
Contributor

Release un-allocated disk spare back to the datastore

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.

z8YeAlr[1].png

Reply
0 Kudos
12 Replies
asajm
Expert
Expert

Hi @eugenx

Shrink the disk size of the virtual machine to make this space available for your other purpose.

If you think your queries have been answered
Marking this response as "Solution " or "Kudo"
ASAJM
Reply
0 Kudos
EugenX
Contributor
Contributor

Thank you. But what is the best way to accomplish it using GUI?

Reply
0 Kudos
asajm
Expert
Expert

Log in ESXi or vCenter

Right click VM then edit

If you think your queries have been answered
Marking this response as "Solution " or "Kudo"
ASAJM
Reply
0 Kudos
EugenX
Contributor
Contributor

The image is not available.

Reply
0 Kudos
SureshKumarMuth
Commander
Commander

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

VMware Knowledge Base

continuum​  is the best person to suggest.

Regards,
Suresh
https://vconnectit.wordpress.com/
Reply
0 Kudos
asajm
Expert
Expert

Check

Shrink a VMware Virtual Machine Disk (VMDK) – virtualman

If you think your queries have been answered
Marking this response as "Solution " or "Kudo"
ASAJM
Reply
0 Kudos
SureshKumarMuth
Commander
Commander

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 ?

Regards,
Suresh
https://vconnectit.wordpress.com/
Reply
0 Kudos
asajm
Expert
Expert

You can verify the steps on a test VM to be sure then do it on your required VM

If you think your queries have been answered
Marking this response as "Solution " or "Kudo"
ASAJM
Reply
0 Kudos
continuum
Immortal
Immortal

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


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

Reply
0 Kudos
EugenX
Contributor
Contributor

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.

Reply
0 Kudos
SureshKumarMuth
Commander
Commander

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

How to create an eager zeroed thick VMDK ?

....
Note by Ulli
Thanks for reporting the problem.
The fixed version is online now and in the next post.
Thank you

Ulli

Regards,
Suresh
https://vconnectit.wordpress.com/
Reply
0 Kudos
continuum
Immortal
Immortal

Thanks for reporting - this is the fixed version.

How to create an eager zeroed thick VMDK ?

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.


… back


How to create a lazy zeroed thick VMDK ?

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.



… back


How to create a thin VMDK ?

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.


Ulli


________________________________________________
Do you need support with a VMFS recovery problem ? - send a message via skype "sanbarrow"
I do not support Workstation 16 at this time ...

Reply
0 Kudos