Have you tried to svmotion each vm? During wizard the system ask for a VM format: choosing thin I thin provisioning svmotion will reclaim effective utilized space from VM... (only if you have licensed node with enterprise edition)
I am not using vmotion or svmotion. then how can i reclaim..?
Are you connected to a vcenter or is your node licensed free? If you have a minimum paid licence like essential, you could try to cold migrate change datastore (Power off vm, migrate datastore, choose thin prov, Power on vm).
Otherwise I think there are no solutions.
I am using vCenter server 5 standard edition license. please let me know if it is possible in this edition and how..?
Then try to cold migrate change datastore:
1.Power off vm
2. migrate datastore
3. choose thin prov
4. After migration complete, power on vm
I think you should move VM between 2 datastore to reclaim your space (shared to local, then local to shared again)
Please let me know if it goes well.
Ok i will try this way on a test vm as i can not power off my production VMs. is there anyway withour powering off the VMs..?
i have previously tried create the vm into ovf template and then downloaded to the laptop and then uploaded again to the local datastore with thin provisioning but it doesn't work.
There are a few approaches,
one is the mentioned svmotion to another datastore. If you don´t have another datastore you could use for windows the sysinternals sdelete tool
sdelete.exe -z [DRIVE:]
is the command inside the guest. Please be aware that this will expand your disk to the maximum size.
for linux you could use something like this:
dd if=/dev/zero of=/[mounted-volume]/zeroes && rm -f /[mounted-volume]/zeroes
where [mounted-volume] is where you mounted the volume.
After that power off the VM and log in to you your esx. The command
vmkfstools -K [disk].vmdk
where [disk].vmdk is the corresponding disk file of the vm, will shrink the disk.
AFAIK there is no way to do this while the VM is powered on.
Please keep in mind that if the LUN of the datastore is also thin provisioned there is more work to do to free the blocks physically. The following command will do that if your storage system supports vaai scsi unmap:
esxcli storage vmfs unmap -l MyDatastore
I would highly recommend checking out the following KB:
I perform sdelete in windows as you mentioned but it fill the datastore space to maximum and i start receiving alerts of low storage on datastore. when only 13Mb remaining the VM stop responding and i am unable to access the VM guest. please let me know what further actions should i take to solve the issue as now i am unable to access the VM or even i am unable to powered on the VM
As i wrote above, sdelete will temporary grow the size of the disk to it´s maximum because it is filling unused space with zeros. So you need temporary space.
In this case, as indicated by Wscholz try the comand:
vmkfstools -K [disk].vmdk
As indicated here: vSphere 5.5 Documentation Center this comand deallocates all zeroed out blocks and leaves only those blocks that were allocated previously and contain valid data. The resulting virtual disk is in thin format.
my disk mount point is /dev/sda5. but i am unable to process this command in linux. please send me an example if i am missing something.
dd if=/dev/zero of=/dev/sda5 bs=4096 && rm -f /dev/sda5
please tel me the correct syntax of this command as i am unable to process this command.
Please look at the syntax above. You do not specify the disk device like /dev/sdaXX, you specify the mountpoint and a temporary file. So if you want to zero out /dev/sda5 and /dev/sda5 is mounted as /var then you have to type
dd if=/dev/zero of=/var/mytempfile
After the command errors out you type
rm -f /var/mytempfile
to delete the tempfile
can you briefly explain me how can i use this command. i am explaining you in my scenario.
I copied a 2.2 GB file at this location.
now i run this command to remove the above cbt file so that we can reclaim the deleted unused space
rm -rf /root/cbt
and then i run this command to reclaim the space as you mentioned.
dd if=/dev/zero of=/root/cbt && rm -rf /root/cbt
the result is it created the deleted cbt file to the same location but increase it's size and then gives error no space left. where as it a new test vm and it has 43GB free space and i copied only 2.2 GB file in /root
and it shows me total space 7.5 approx before running all this. i have attached the screen shot
after running the dd command it created 40G file