VMware Cloud Community
hostasaurus
Enthusiast
Enthusiast
Jump to solution

Can't get a disk to shrink

I have a Win2k8 R2 guest on esxi 4.1 enterprise plus with thin provisioned vmdk.  The customer let some log files get out of hand to the tune of about 80 GB of wasted space.  I cleaned it up and then ran the sdelete utility with the -c option to zero the free space.  I then live migrated to a new data store converting to thick, and back again converting to thin.  The end result was only reducing the size by about 4 GB.  For some reason the other 76 GB of wasted space has not been recovered.  I tried with the guest on and off.

Any other tool I can try or am I missing a critical step?

Reply
0 Kudos
1 Solution

Accepted Solutions
VMmatty
Virtuoso
Virtuoso
Jump to solution

The shrink option isn't available in thin provisioned disks.  One thing I have seen recently with 4.1 is that svMotion won't reclaim space on a thin provisioned disk (even after sdelete) if you are moving between datastores of the same block size.  If you can, try doing the svMotion between datastores of different block sizes and see if it resizes properly.

Matt | http://www.thelowercasew.com | @mattliebowitz

View solution in original post

Reply
0 Kudos
6 Replies
MKguy
Virtuoso
Virtuoso
Jump to solution

Try using the built-in shrink option the VMware tools provide instead of sdelete and then SVMotion the VM.

I've actually seen something similar lately on Linux VMs (cat /dev/zero) with ghettovcb to thin disks, I'm not sure if it's since the upgrade to 4.1.

-- http://alpacapowered.wordpress.com
Reply
0 Kudos
VMmatty
Virtuoso
Virtuoso
Jump to solution

The shrink option isn't available in thin provisioned disks.  One thing I have seen recently with 4.1 is that svMotion won't reclaim space on a thin provisioned disk (even after sdelete) if you are moving between datastores of the same block size.  If you can, try doing the svMotion between datastores of different block sizes and see if it resizes properly.

Matt | http://www.thelowercasew.com | @mattliebowitz
Reply
0 Kudos
hostasaurus
Enthusiast
Enthusiast
Jump to solution

I have an empty LUN I could re-format to a new block size.  Before I do that, if I change it back to thick again, will the shrink option show up in the tools?

Reply
0 Kudos
VMmatty
Virtuoso
Virtuoso
Jump to solution

Yes, if you inflate it back to thick then the Shrink option will work again in the VMware Tools.

Matt | http://www.thelowercasew.com | @mattliebowitz
Reply
0 Kudos
DSTAVERT
Immortal
Immortal
Jump to solution

If you can create an NFS datastore migration will shrink the disk. Migrate back to your other storage if necessary.

-- David -- VMware Communities Moderator
Reply
0 Kudos
hostasaurus
Enthusiast
Enthusiast
Jump to solution

Matt Liebowitz wrote:

The shrink option isn't available in thin provisioned disks.  One thing I have seen recently with 4.1 is that svMotion won't reclaim space on a thin provisioned disk (even after sdelete) if you are moving between datastores of the same block size.  If you can, try doing the svMotion between datastores of different block sizes and see if it resizes properly.

That was it.  I deleted one of my LUNs and recreated it as a 2 MB block size instead of 1 MB like all the rest, migrated to it and now the vm dropped down to the same size as what's really in use.  Thanks!

Reply
0 Kudos