Space Reclaim for Local HDD in vSphere 6

I noticed that my new 240GB SSD Drive is getting full very fast even with only few VMs running on vSphere 6 Server and I had decided to spend sometime to understand further instead of purchasing a large capacity SSD Drive for my home lab.

Please refer to the following on my finding

  1. VMFS file is NOT reduced even I had deleted my files in Windows 2012 Server (VMs) and this waste lot of space
  2. Is there a way to provision my VM using Link Clone to reduce the space required?

Space Reclaim in vSphere 6

Understand that vSphere 6.0 support issuing UNMAPs directly from the Guest OS (Windows 2012 R2 Only) to Reclaim Free Space on VMFS Data Store level with the following Prerequisites

  1. VMDK must be THIN PROVISIONED and VM Hardware Version =11
  2. Advanced setting VMFS3.EnableBlockDelete must be set to 1 (Default is 0)
  3. The Guest OS must be able to identify the disk as thin (Windows 2012 [updated 30-Oct-2015] uses the B2 mode page to achieve this)

Login to vSphere 6 via https://192.168.1.186/ui (ESXi Embedded Host Client) and select Host à Manage à Advanced Settings àEnableBlockDelete = 1

VMware-SpaceReclaim-01

Login to Windows 2012 R2 Server, and copy some files and deleted it – Copied 4GB File to C Drive and Deleted it)

VMware-SpaceReclaim-02

Open Defragment and Optimize Drives

VMware-SpaceReclaim-03

Windows 2012 R2 Server detected the Media Type = Thin Provision Drive, and you can click on Optimize (it will take 1 to 2 minutes to complete) to Trim the storage and inform vSphere to reclaim the unused space in Think Provisioned Disk

VMware-SpaceReclaim-04

Login to vSphere 6 using SSH Client and manually go to the VM path, with du (Disk Usage) –lh. VMDK file will be automatically reduce from 17.4G to 13.6GB (4 GB Space had been reclaimed)

VMware-SpaceReclaim-05

Tested the above steps is working for

  1. Internal SATA Hard Disk
  2. Internal SSD Hard Disk

Reference Links

  1. http://cormachogan.com/2015/05/07/vsphere-6-0-storage-features-part-8-vaai-unmap-changes/#more-5023
  2. https://kallesplayground.wordpress.com/2014/04/26/storage-reclamation-part-2-windows/
  3. https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2112333

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top