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 ESXi/ESX 3.5 and 4.x hosted virtual machines (10185)

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 operating system so that a subsequent export can avoid copying sections of the virtual disk containing deleted data. This is similar to a Secure Delete as performed by the Windows 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 ESXi/ESX 4.x when there are one or more thin disks attached to the virtual machine.  On an ESXi/ESX thin disk, this operation fills unallocated blocks with zeros, causing the virtual disk to inflate to its maximum size.

Note: Shrinking disks is not allowed in certain circumstances. For additional information see Shrinking a Virtual Disk in Installing and Configuring VMware Tools.

Solution

Shrinking a disk is an I/O intensive operation and should only be performed during off hours, if possible.

Requirements and restrictions for shrinking

  • Shrinking requires free disk space on the host equal to the size of the virtual disk you are shrinking.
  • Shrinking applies only to virtual disks. You cannot shrink physical disks or CD-ROMs.
  • The Shrink feature is not enabled if the virtual machine:
    • Contains a snapshot
    • Is the parent of a linked clone
    • Is a linked clone
  • The Shrink feature is not enabled for a virtual machine if any of its virtual disks are:
    • Preallocated when created, such as Thick Provisioned Eager Zeroed or Thick Provisioned Lazy Zeroed.
    • Legacy disks that are configured for Independent-Nonpersistent. Legacy disks must use Independent-Persistent.
There are two stages to the shrink operation:
  1. Prepare to shrink
  2. 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.
Note: When the operation is complete, the virtual disk does not consume any less disk space on the network filesystem storage (NFS) or virtual machine file system (VMFS). However, when exported to a sparse virtual disk, it is just large enough to hold the data within.

Additional Information

For translated versions of this article, see:

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 additional background information 09/24/2012 - Added link to Installing and Configuring VMware Tools

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

  • 48 Ratings

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)
  • 48 Ratings
Actions
KB: