VMware Tools shrink option on ESXi/ESX 3.5 and 4.x hosted virtual machines
search cancel

VMware Tools shrink option on ESXi/ESX 3.5 and 4.x hosted virtual machines

book

Article ID: 332514

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

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.


Environment

VMware ESX 4.0.x
VMware ESXi 4.1.x Embedded
VMware ESX 4.1.x
VMware ESXi 4.0.x Installable
VMware ESXi 4.0.x Embedded
VMware ESXi 3.5.x Installable
VMware ESX Server 3.5.x
VMware ESX Server 3.0.x
VMware ESXi 3.5.x Embedded
VMware ESXi 4.1.x Installable

Resolution

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: