Knowledge Base

The VMware Knowledge Base provides support solutions, error messages and troubleshooting guides
 
Search the VMware Knowledge Base (KB)   View by Article ID
 

Committing snapshots when there are no snapshot entries in the Snapshot Manager (1002310)

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:

Resolution

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.

Commit snapshots from vCenter/vSphere Client

To commit all snapshots by using the Virtual Infrastructure Client:
  1. Take a Snapshot. For more information, see the Take a Snapshot section of the VMware vSphere Online Library.
  2. 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.

Commit snapshots from the ESX/ESXi command line

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:
  1. 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.

  2. 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.

  3. 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


  4. 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:

  5. 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:
  1. 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.

  2. 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

  3. 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).

  4. 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:
  5. 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.

Additional Information

  • 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 in VMware ESX/ESXi (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.

Workaround

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:
  1. Review the Release Notes.
  2. Check the System Requirements as outlined in the Converter Standalone User's Guide.
  3. Within the virtual machine, stop all I/O intensive processes.
  4. Install VMware vCenter Converter Standalone into the virtual machine.
  5. Start VMware vCenter Converter Standalone.
  6. 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.
  7. When the conversion finishes successfully, test the virtual machine which was created:

    1. Check the virtual machine configuration by right-clicking the virtual machine and clicking Edit Settings.
    2. Ensure the network cards are not connected.
    3. Power on the virtual machine and verify that everything is working properly.

  8. If everything is working properly, power off the virtual machine with the snapshots.
  9. 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.

See also

Additional Information

For translated versions of this article, see:

Tags

commit-snapshot-fails

Update History

09/22/2013 - Updated for vSphere 5.5. 08/08/2012 - Added link to 1007566 07/25/2012 - Added link to 1027876 02/17/2012 - Added link to 1004343 and 1003490 08/24/2011 - Added link to 2003638 07/28/2011 - Added ESXi commands 03/09/2011 - Added link to 1007849 and 1005049 07/05/2010 - Added links to the patch releases for ESX/ESXi 3.5 and 4.0. 09/07/2010 - Added VI Client and Converter Standalone variants. 07/12/2016 - Updated with ESXi 6.0

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

  • 168 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)




Please enter the Captcha code before clicking Submit.
  • 168 Ratings
Actions
KB: