How To Reclaim ESXi VMFS storage with Ubuntu VMs

First of all, zero the space in the guest. You can do that easily with secure-delete. In the Ubuntu guest, this srm command will recursively delete all files and folders, quickly, verbosely, zero the old file and will only do it with one pass.

df -h
sudo apt-get install secure-delete
sudo srm -r -f -v -z -l -l /dir/to/clean/*
df -h

Next, simply vMotion the VM to another datastore with the thin option set. If that’s not an option for you, you’ll need to power off the VM.

In ESXi:

<Power off the VM>

cd /vmfs/volumes/to/your/vm/folder
vmkfstools --punchzero vmdk-to-shrink.vmdk
Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

  • RT @acloudguru: Are you a cloud hipster? Do you have a pet moose? 👀 Psst! Here's a lesson on AWS global and regional infrastructure:@https16 hours ago
  • RT @Benjojo12: "Why is the MTU of Ethernet 1500 bytes?" A question I asked myself a few nights back and could not find a quick response to… 16 hours ago
  • The Windows 10 native mail app is gross. Officially. 2 days ago
Papers
People
Map

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 39 other followers

%d bloggers like this: