close

 

To work around this issue, Storage vMotion the virtual machine or VMDK to a datastore that has a different block size. This reclaims the zeroed out disk space.

To shrink a thin provisioned disk (VMDK):

  1. Use a third-party tool within the guest operating system to zero-out disk blocks that may have previously been written with data, but have subsequently been deleted.
  2. Storage vMotion the virtual machine or VMDK to a datastore formatted with a different block size.
For example, if the VMDK is on a datastore formatted with 2 MB blocks, format the target VMFS datastore with a 1 MB, 4 MB, or 8 MB block size.


To reclaim the unused space of a virtual disk in ESXi/ESX 4.1 or later:
 
Note: Where vmkfstools supports the -K option (--punchzero), you can reclaim the zeroed blocks of thin-provisioned virtual disks without the need to clone to another VMFS datastore with a different block size.

  1. Ensure the disk has no Snapshots.

  2. In a Windows virtual machine, use the SDelete command (or a tool with similar functionality) to zero out all unused space. The syntax for the SDelete command is SDelete -z <driveletter>. If you use SDelete, ensure that you use version 1.6 or later.

    Note: Zeroing all unused blocks inflates the disk to its full size and converts it into an eagerzeroed disk. If the original disk is a thin provisioned disk, ensure there is sufficient space on the datastore to allow the disk to grow to its full size. For more information, see Determining if a VMDK is zeroedthick or eagerzeroedthick (1011170).

  3. Shut down the virtual machine or temporarily remove the virtual disk from the virtual machine to ensure it is not in use.

  4. Erase all unused blocks by running the command:

    vmkfstools -K /path/to/disk-name.vmdk

 

Reference:http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2004155 

arrow
arrow
    全站熱搜

    masterman 發表在 痞客邦 留言(0) 人氣()