How To – Commit VMware snapshots

September 13, 2010

How To – Commit VMware snapshots
 
Snapshot activities are far more consistent and reliable when using the ESX host's Service Console in lieu of the vCenter GUI.
 
VMware recommends having free space equal to the snapshots and base disk size before committing snapshots.
 
If you do not have enough free space on the source LUN, migrate to another disk that has enough free space and consolidate the snapshots into a new virtual disk file (VMDK).

Virtual machines with snapshots ironically cannot be migrated with Storage vMotion. The server will need to be powered off and the virtual machine files will need to be manually migrated in a cold state (powered off).

For more information on consolidating disk files, see Consolidating snapshots (1007849).
http://kb.vmware.com/kb/1007849
 
To commit snapshots to a base disk from the command-line:
 
1. Find the path to the VMX file of the virtual machine either from the Virtual Infrastructure Client or by running the following command:
 
sudo vmware-cmd -l
 
/vmfs/volumes/VM_DATA_C000_01/SomeVirtualMachine1.vmx
/vmfs/volumes/VM_DATA_C000_01/SomeVirtualMachine2.vmx
/vmfs/volumes/VM_DATA_C000_01/SomeVirtualMachine3.vmx
/vmfs/volumes/VM_DATA_C000_01/SomeVirtualMachine4.vmx
/vmfs/volumes/VM_DATA_C000_01/SomeVirtualMachine5.vmx
/vmfs/volumes/VM_DATA_C000_01/SomeVirtualMachine6.vmx

2. Determine if the virtual machine has snapshots:
 
sudo vmware-cmd /vmfs/volumes/VM_DATA_C000_01/SomeVirtualMachine1.vmx hassnapshot
 
The output will look like one of the following:
hassnapshot() =
or
hassnapshot() = 1
If the result is not equal to one (1), there are no snapshots for the virtual machine and there is no reason to proceed further.

3. Remove (or commit) the snapshot by running the following command:
 
sudo vmware-cmd /vmfs/volumes/VM_DATA_C000_01/SomeVirtualMachine1.vmx removesnapshots
 
removesnapshots() = 1
 
If the result is one (1), the snapshots have been successfully committed. If the result is something other than one (1), file a Support Request with VMware Support and note this KB Article ID in the problem description. Note: The above procedure deletes all snapshots on the virtual machine and commits the changes in the delta disks to the base disc. The base disc has all changes to the data.
This process can take over an hour to complete. It all depeneds on the amount of snapshot deltas and the size of the disks to be committed.

Comments are closed.