Post date: Sep 29, 2014 2:17:37 PM
Details
The Snapshot Manager shows no snapshots but there are delta files present.
One or more sets of -00000X.vmdk and -00000X-delta.vmdk files are in the directory with the virtual disk.
The .vmx file points to one of the -00000X.vmdk files, usually the highest numbered file, indicating that the snapshot file is in use.
 Note: With ESXi 5.x and above there is a new procedure for consolidating snapshots which are not shown in Snapshot Manager. For more information, see Consolidating snapshots in vSphere 5.x (2003638).
Solution
Most snapshot related issues have improved with changes to the Delete All snapshot process in the patch releases for ESX/ESXi 3.5 and 4.0. For more information, see:
VMware ESXi 3.5, Patch ESXe350-201006401-I-SG: Updates firmware (1020052)
VMware ESXi 4.0, Patch ESXi400-201006201-UG: Updates Firmware (1017739)
Confirm that the virtual machine is not pointing to the base disk. Open the virtual machine configuration file (.vmx ) or edit the settings of the virtual machine and see if any of the virtual disks are using a -00000X.vmdk file. If no disks are using -00000X.vmdk , this virtual machine is not using any of these files. Although unlikely, it is possible that another virtual machine is storing its snapshots in this directory. Check the other virtual machines. If none of them refer to these files, they can be safely erased.
Typically, the file is in use by the virtual machine. When a snapshot is deleted, any additional files in the hierarchy that are not identified by the Snapshot Manager are included in the commit process. Creating a new snapshot and deleting it clears the entire hierarchy. This means that all snapshot files on the virtual machine are committed, then deleted
A small amount of free space is required to create the new snapshots. If the virtual machine needs to remain running, more space must be allowed for because the new snapshot grows (accepting new changes to the virtual disks) as the older snapshots commit.
To commit all snapshots by using the Virtual Infrastructure Client:
Take a Snapshot. For more information, see the Take a Snapshot section of the VMware vSphere Online Library.
Delete all Snapshots. For more information, see the Delete all Snapshots section of the VMware vSphere Online Library.
Note: If you have unsuccessfully attempted to consolidate using the Take a Snapshot then Delete all Snapshots technique, attempt the technique again, but this time select the Quiesce guest file system checkbox to enable quiesced snapshots when you Take a Snapshot.
To commit all snapshot from the command line on ESX/ESXi:
ESXi hosts
On an ESXi host, to commit all snapshots using the command line:
Log into the ESXi host as root via the console or an SSH session. For more information, see Tech Support Mode for Emergency Support (1003677) or Using Tech Support Mode in ESXi 4.1 and ESXi 5.x (1017910).
Note: The commands in this procedure can also be executed remotely using the vSphere Command Line for both ESX and ESXi hosts. For more information, see the vSphere Command-Line Interface Documentation.
Run this command to get a list of virtual machines and the VMID for each virtual machine:
# vim-cmd vmsvc/getallvms
The output appears similar to:
Vmid Name File Guest OS Version Annotation
1 vm1 [datastore1] vm1/vm1.vmx windows7Server64Guest vmx-08
3 testvm [iscsi1] testvm/testvm.vmx winNetDatacenterGuest vmx-08
Make a note of the VMID for the specific virtual machine.
To verify if the snapshot exists, run this command and check the Snapshot Name, Snapshot Created On, and Snapshot State:
# vim-cmd vmsvc/snapshot.get [VMID]
The output appears similar to:
Get Snapshot:
|-ROOT
--Snapshot Name : Test
--Snapshot Desciption :
--Snapshot Created On : 7/27/2011 13:49:55
--Snapshot State : powered on
Run this command to create a new snapshot:
# vim-cmd vmsvc/snapshot.create [VmId] [snapshotName] [snapshotDescription] [includeMemory] [quiesced]
For example, to create a snapshot on the virtual machine named testvm:
# vim-cmd vmsvc/snapshot.create 3 snapshot1 snapshot 0 0
Notes:
You can use any name you like. The name appears in the snapshot manager.
A file .vmsd may interfere with the creation or removal of the snapshots if the memory snapshot were left behind. For more information, see Understanding virtual machine snapshots in VMware ESXi and ESX (1015180).
Run this command to remove all snapshots:
# vim-cmd vmsvc/snapshot.removeall [VMID]
Notes:
This command consolidates the snapshot information and deletes the snapshot -delta files from the relevant virtual machine folder.
If you have unsuccessfully attempted to consolidate using the Take a Snapshot then Delete all Snapshots technique, attempt the technique again, but this time select the Quiesce guest file system checkbox to enable quiesced snapshots when you Take a Snapshot.
ESX hosts
On an ESX host, to commit all snapshots by using the command line:
Log into the ESX host as root via the console or an SSH session. For more information, see Unable to connect to an ESX host using Secure Shell (SSH) (1003807).
Note: The commands in this procedure can also be executed remotely using the vSphere Command Line for both ESX and ESXi hosts. For more information, see the vSphere Command-Line Interface Documentation.
Obtain the path to the configuration file for the virtual machine with the command:
# vmware-cmd -l
The output appears similar to:
/vmfs/volumes/UUID/VMNAME/VMNAME.vmx
Check to see if the virtual machine has a snapshot with the command:
# vmware-cmd /vmfs/volumes/UUID/VMNAME/VMNAME.vmx hassnapshot
If the output displays a value of 1 , a snapshot is present. If the output displays a value of 0 , there is no snapshot present.
Note: To determine if the virtual machine has a snapshot, see Determining if a virtual machine is using snapshots (1004343) and Restarting the Management agents on an ESX or ESXi host (1003490).
Create a new snapshot on the virtual machine with the command:
# vmware-cmd /vmfs/volumes/UUID/VMNAME/VMNAME.vmx createsnapshot namedescriptionquiescememory
For example, to take a snapshot called test without memory or quiescing the file system in the virtual machine:
# vmware-cmd /vmfs/volumes/UUID/VMNAME/VMNAME.vmx createsnapshot "test" "" 0 0
Notes:
You can use any name you like. The name appears in the snapshot manager. For more information about the syntax of the vmware-cmd command, see the vSphere Command-Line Interface Documentation.
A file .vmsd may interfere with the creation or removal of the snapshots if the memory snapshot were left behind. For more information, see Understanding virtual machine snapshots in VMware ESXi and ESX (1015180).
Remove the snapshot with the command:
# vmware-cmd /vmfs/volumes/UUID/VMNAME/VMNAME.vmx removesnapshots
Notes:
This command consolidates the snapshot information and deletes the snapshot -delta files from the relevant virtual machine folder.
If you have unsuccessfully attempted to consolidate using the Take a Snapshot then Delete all Snapshots technique, attempt the technique again, but this time select the Quiesce guest file system checkbox to enable quiesced snapshots when you Take a Snapshot.
The remove snapshot process can take a long time to complete if the snapshots are large.
To monitor the commit of snapshots, see Commands to monitor snapshot deletion (1007566).
If you entered the removesnapshots command via an SSH tool (such as PuTTY or secureCRT), the SSH session must be left open. Closing the SSH program aborts the process. If leaving an SSH session open for an extended time is unacceptable, run the command from the physical console.
The commit process has no progress that you can follow. As long as the date on the files continues to update, the process is working. Also, if the virtual machine is off, you can use the file * command to see if any files are in use. If any of the files return the error message can't read `filename' (Device or resource busy) , they are locked by the VMkernel. The commit process is actively being performed on those files.
When the commit has completed successfully, there are no -00000X.vmdk or -00000X-delta.vmdk files left unless they were not part of the snapshot tree. These files can be deleted. To confirm that the commit succeeded, view the .vmx file, and verify that virtual disks are now pointing to a base disk (-flat.vmdk ).
If the .vmx contains a disk that is still pointing to a snapshot file, the commit process failed. If the attempt was made with the virtual machine running, plan an outage and try again with the virtual machine off. If that does not work, the virtual disk must be cloned using vmkfstools -i . The source file name is the current active -00000X.vmdk as identified in the .vmx file. When the clone is complete, point the virtual machine to use the newly cloned disk. The original base disk and snapshot tree can be deleted. For more information on consolidating a snapshot from the command line using cloning, see Consolidating snapshots (1007849).
As an alternative to using the command line, you can use the VMware Infrastructure (VI) Client to perform the clone operation on the virtual machine. The cloned virtual machine retains the content of the associated snapshot disks at the time of cloning. When the virtual machine has been cloned successfully, test the operation of the resulting cloned virtual machine and decommission the previous virtual machine. For more information on cloning a virtual machine using VI Client, see Cloning Virtual Machines.
Note: Cloning using the VI Client requires VirtualCenter and all applicable licenses. Cloning a virtual machine using the VI Client does not allow you to select individual virtual disks connected to the virtual machine. Relative to using the vmkfstools command to perform the same operation on a single virtual disk, consolidating snapshots using the VI Client clones all disks and may require more disk space.
If you are still not able to consolidate the snapshots and if a restore from backup is not possible, you can use VMware vCenter Converter Standalone to convert the virtual machine into a new virtual machine:
Review the Release Notes.
Check the System Requirements as outlined in the Converter Standalone User's Guide.
Within the virtual machine, stop all I/O intensive processes.
Install VMware vCenter Converter Standalone into the virtual machine.
Start VMware vCenter Converter Standalone.
In the source dialog, select Physical Machine and follow the instructions on the screen. For a detailed description of this process, see the Converter Standalone User's Guide.
When the conversion finishes successfully, test the virtual machine which was created:
Check the virtual machine configuration by right-clicking the virtual machine and clicking Edit Settings.
Ensure the network cards are not connected.
Power on the virtual machine and verify that everything is working properly.
If everything is working properly, power off the virtual machine with the snapshots.
In the new virtual machine, set the network cards to Connected at power on.
Note: This works because Converter Standalone does not know the virtual disk structure. It sees only that what the operating system sees, just as a physical machine does. Also note that the virtual machine conversion can take a significant amount of time because the conversion is done over the network.