Tuesday 21 August 2012

Reclaiming Disk Space from Thin Disks

There are huge number of posts describing how to reclaim disk space and to decrease used storage for Thin Disks. However, very few pay attention or emphasize one precaution measure you have to take before proceeding.

Here is the whole story. There are situations when you temporarily COPY large amount of data on Thin Provisioned Disk. This action inflates disk's VMDK file on VMFS datastore. When you delete this data off the Thin Disk  the VMDK file size stays the same and that is because the data is not deleted, but simple marked to be overwritten. So you end up with situation when actual disk size in Virtual Machine is, let's say, 10 GB, but its VMDK occupies hundreds of GBs on VMFS Datastore.

Basically, this problem is resolved in two steps.
  1. You run SDELETE utility (link) on your drive to zeroize all unused disk space. This way you will let vSphere distinguish between actually used blocks of disks and unused disk space.
  2. Once it is over you need to start Storage vMotion of your Thin Disk. The main point here is that you have to move your Disk/VM to a VMFS Datastore with different Block Size. Under this condition only vSphere will invoke legacy datamover which doesn't copy zeroized data blocks. As usually, Duncan has the best explanation of the block size impact.
With VMFS-5 which has unified Block Size of 1 Mb this is not as easy as pie. First you will need to create a new VMFS-3 datastore with different block size and then it has to be upgraded to VMFS-5.

And here comes the  !Warning!
  • Pay Attention to the amount of Free Space on your VMFS Datastore before running SDELETE.
As I have said  SDELETE will zeroize all free space on you Thin Provisioned Disk. That means it will inflate VMDK file to its maximum provisioned space. So you have to make sure that SDELETE will not gobble all your free space on a VMFS datastore.

If you find this post useful please share it with any of the buttons below. 

No comments:

Post a Comment