Knowledge Base

The VMware Knowledge Base provides support solutions, error messages and troubleshooting guides
 
Search the VMware Knowledge Base (KB)   View by Article ID
 

VMware Tools shrink option on ESX hosted virtual machines

Details

The Prepare to Shrink option in VMware Tools prepares a virtual disk for exporting to VMware hosted products (such as VMware Workstation and VMware Server) by using the smallest possible disk files. The Shrink operation zeros previously-used sections of the virtual disk within the Guest OS so that a subsequent export can avoid copying sections of the virtual disk containing deleted data. This is similar to a Secure Delete such as performed by SysInternals' sdelete.exe utility.

The Prepare to Shrink option is available in ESX 3.0.2 and later versions.

The Prepare to Shrink option is disabled on ESX/ESXi 4.x when there are one or more Thin disks attached to the virtual machine.  On an ESX/ESXi Thin disk, this operation fills unallocated blocks with zeros, causing the virtual disk to inflate to its maximum size.

Solution

Shrinking a disk is an I/O intensive operation and should only be performed during off hours, if possible.
 
There are two stages to the shrink operation.
  • Prepare to shrink
  • Zeroing the unused sections of the virtual disk
A progress bar indicates the progress of the preparation stage. There is, however, no progress bar for the actual shrink process. When you click Shrink, you immediately get a message box stating that the process is complete. The zeroing may take some time.

Shrinking the virtual disk

  1. Open the VMware Tools Control Panel/Toolbox.
    • In Windows, double-click the VMware Tools icon in the system tray or go to Start > Control Panel > VMware Tools.
    • In Linux:
      1. Open a command prompt. For more information, see Opening a command or shell prompt (1003892).
      2. Run this command:

        vmware-toolbox

  2. Click the Shrink tab.
  3. Ensure that your boot drive is selected.
  4. Click Prepare to Shrink and then follow the prompts.
When the operation is complete, the virtual disk does not consume any less disk space on the NFS or VMFS filesystem. However, when exported to a sparse virtual disk, it is just large enough to hold the data within.

Tags

shrink-vm-virtual-disk

This Article Replaces

10211

Update History

07/14/2011 - Added steps to shrink the virtual disk 07/21/2011 - Added addtional background information

Request a Product Feature

To request a new product feature or to provide feedback on a VMware product, please visit the Request a Product Feature page.

Feedback


Did this article help you?
This article resolved my issue.
This article did not resolve my issue.
This article helped but additional information was required to resolve my issue.
What can we do to improve this information? (4000 or fewer characters)
Actions
KB: