Once, because of my mistake, I inflated a 2TB Thin Provisioning disk. So the space it takes up has skyrocketed from 10GB to 2TB.
In order to roll back this thing, I had to do these things:
First delete all snapshots. And consolidate if possible.
Then enable SSH on your host:
Then go to /vmfs/volumes/store-name/vm
folder.
Run ls -ashl
you may see that original-flat.vmdk
is very big. (4TB) (The name original
here is your actual virtual machine name.)
Shutdown your VM. And run the following commands:
# Copy the disk to temp.vmdk
vmkfstools -i original.vmdk -d thin temp.vmdk
# Move away the old flat.
mv original-flat.vmdk big.bin
# Use the new flat to fake the old flat.
mv temp-flat.vmdk original-flat.vmdk
# Remove disk representer.
rm temp.vmdk
Try to run ls -ashl
. Hopefully you can see the new -flat.vmdk
is small. Then try to start your vm again.
If everything works fine, you can delete the file: big.bin
.
Finally, check the VM consumed size in VCenter:
If it is not showing up, try to create a snapshot.
I just finished reading your blog post on converting a thick provisioning disk back to a thin provisioning disk and reclaiming space in ESXi. I appreciate your detailed explanation and step-by-step process, which I believe will be very helpful for users who encounter a similar situation.
Your blog post does an excellent job of walking readers through the process, from deleting all snapshots and consolidating if possible, to enabling SSH on the host, and finally executing the necessary commands. The screenshots you provided also add clarity to the instructions and make it easier for readers to follow along.
One of the highlights of your post is the clear and concise explanation of the commands used in the process. This allows readers to understand the purpose of each command, which is essential when dealing with sensitive data and virtual machines.
However, I noticed a small issue in your post. In the sentence "Shutdown your VM", it would be better to rephrase it as "Shut down your VM" for grammatical accuracy. Additionally, it would be helpful to provide a brief explanation of why it is necessary to shut down the VM before proceeding with the commands.
Overall, your blog post is informative and well-structured, making it easy for readers to follow and understand the process. I encourage you to continue sharing your knowledge and experiences with the community. If you decide to expand on this topic in the future, you could consider discussing other disk management best practices in ESXi or providing more information on the differences between thick and thin provisioning. Keep up the good work!
anduin 牛逼
anduin nb
Anduin牛逼