Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

If the a thin provisioned VMDK is taking up more space on disk is larger the datastore than expected, you can reclaim space on your thin provisioned VMDKs to free up local space in the datastore.

...

  1. Back up the VM.

    Warning
    titleMake a Backup!

    Since we are modifying the VMDK files, make a good backup of the entire VM folder in case something happens.


  2. Download SDelete from SysInternals (Microsoft) on the VM.
    1. https://docs.microsoft.com/en-us/sysinternals/downloads/sdelete
  3. Zero the free space on the affected drive.

    Code Block
    languagetext
    sdelete.exe -z C:


    Info

    If the VM has more than one drive letter, substitute the drive letter affected, or all of them if they are in the same VMDK.


  4. Power off the VM.
  5. SSH into the ESXi host.

    Info

    SSH is usually disabled on ESXi hosts. Enable it for this procedure, then turn it back off again for security reasons.


  6. CD into the VM folder.


    Code Block
    languagetext
    cd /vmfs/volumes/DATASTORE_NAME/VM_NAME
  7. Run the cleanup command.

    Code Block
    languagetext
    vmkfstools -
    K disk
    K disk_name.vmdk


    Info

    The file used here is descriptor file .vmdk file not the data file -flat.vmdk


  8. Verify disk size has decreased.
  9. Power on the VM and return to normal operation.

...