VMware
 

Knowledge Base

Search the Knowledge Base:

Products:
Search In:
 

Committing snapshots when there are no snapshot entries in the snapshot manager

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.

Solution

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.
 
Usually, 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 bit of free space is required to create the new snapshots. If the virtual machine needs to remain running, more space must be allowed for, as the new snapshot grows (accepting new changes to the virtual disks) as the older snapshots commit.
 
To commit all snapshots:
  1. Log in to the ESX host as root via the console or an SSH session. For more information about SSH, see Unable to connect to an ESX host using Secure Shell (SSH) (1003807)

    Note: The following commands can also be executed remotely using the vSphere Command Line for both ESX and ESXi hosts. For more information, see vSphere Command Line Interface documentation.
     
  2. Type vmware-cmd -l and press Enter.
     
    The output appears similar to:

    /vmfs/volumes/UUID/VMNAME/VMNAME.vmx
     
  3. Type vmware-cmd /vmfs/volumes/UUID/VMNAME/VMNAME.vmx hassnapshot and press Enter to confirm that there is a snapshot. If the output displays a blank value or value of 1, a snapshot is present. If the output displays a value of 0, there is no snapshot present.
      
  4. Type vmware-cmd /vmfs/volumes/UUID/VMNAME/VMNAME.vmx createsnapshot <name> <description> <quiesce> <memory> and press Enter to create a new snapshot.

    For example, the command vmware-cmd /vmfs/volumes/UUID/VMNAME/VMNAME.vmx createsnapshot "test" "" 0 0 makes a snapshot without memory, quiescing, or a description called test.
     
    Note: 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 vSphere Command Line Interface documentation. 
     
  5. Type vmware-cmd /vmfs/volumes/UUID/VMNAME/VMNAME.vmx removesnapshots and press Enter to remove the snapshot.

Additional Information

  • The remove snapshot process can take a long time to complete if the snapshots are large. 
     
  • 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 occurring to 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 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 also does not work, the virtual disk must be cloned using vmkfstools -iThe 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 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 the VMware Infrastructure Client, see Cloning Virtual Machines.

Note:
Cloning using VI Client requires VirtualCenter and all applicable licenses. Cloning a virtual machine using 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 VI Client clones all disks and may require more disk space.

Feedback

Rating: 1 - Lowest 2 3 4 5 - Highest (9 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? (2000 or fewer characters)
Submit
Rating: 1 - Lowest 2 3 4 5 - Highest (9 Ratings)   
Actions