Finding and listing virtual machine snapshots
search cancel

Finding and listing virtual machine snapshots

book

Article ID: 344559

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

This article provides steps to find and list virtual machines that are running on snapshots.

Snapshots can consume large amounts of resources, monitoring the snapshots can:
  • Help in monitoring the space usage on the Datastore where the VM resides. 
  • Find running on a snapshot with memory status, snapshot files will take significantly large space on the datastore. 
  • Will prevents VM may Suspend/Poweroff  if the datastore usage reaches 100% usage. 

Resolution

There are several methods to determine if a virtual machine is running on snapshot or not.

Using the virtual machine's Snapshot Manager
Viewing the virtual machine configuration file
ESXi Shell using the vim-cmd
Power CLI

Using the virtual machine's Snapshot Manager

  1. Log in to the ESXi Host UI or vCenter Web Client
  2. Right-click on the virtual machine and select Snapshots > Snapshot Manager/Manage Snapshots
 
 
  1. If a snapshot is listed, the virtual machine is attached to one or more virtual disks which are in a snapshot state.
  2. Right click on VM and select Edit settings.
 

 

  1. Identifying the Datastore where the VM resides 

Viewing the virtual machine configuration file

  1. Log in as root to the ESXi host using SSH.
  2. Navigate to the virtual machine directory containing vmdk virtual disk files. Run the cd command to change the current directory.
For example:
cd /vmfs/volumes/Datastore_name/Virtual_Machine_name/
  1. Run this command to list vmdk (disks) of the VM in the vmx (configuration file of VM):
less VM_deploy.vmx |grep vmdk
  1. Run this command to list the snapshot files in the directory:
ls -lrth | grep *sesparse.vmdk 
 
Listing the snapshot files of the VM inside the VM directory. 
Notes
  • Sesparse is a default format for all delta disks on the VMFS6 datastores. On VMFS5, Sesparse is used for virtual disks of the size 2 TB and larger.
  • In certain special purpose configurations, it may be needed to exclude one or more of the virtual machine's disks from the snapshot. 
  • To exclude a disk from the snapshot, choose Edit > Virtual Machine Settings, select the drive to exclude, change the configuration from Advanced Options. For more information, see Change Disk Mode to Exclude Virtual Disks from Snapshots

ESXi Shell using the vim-cmd

  1. Run this command to to see all VM's on the host:
vim-cmd vmsvc/getallvms
 
  1. Using the vmid in the first column, run: 

    vim-cmd vmsvc/get.snapshotinfo vmid
For example:



Notes: In some cases, it is still possible that a virtual machine disk snapshot exists without it being identified and managed by the Snapshot Manager. For more information on committing and removing snapshots, see Consolidating/Committing snapshots in ESXi
 

Power CLI

Open Power CLI and run: 

Get-VM | Get-Snapshot|Select VM,Name

Additional Information