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. 


Environment

VMware vSphere ESXi 6.7
VMware vCenter Server 6.5.x
VMware vSphere ESXi 7.0.0
VMware vSphere ESXi 6.5
VMware vCenter Server 7.0.x
VMware vCenter Server 6.7.x

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
Right-click on the virtual machine and select Snapshots
 
 
Select 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.
 
Right click on VM and select Edit settings
 
  1. Identifying the Datastore where the VM resides 
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/
Navigate to the VM directory
find the vmx file of the virtual machine
  1. Run this command to list vmdk (disks) of the VM in the vmx (configuration file of VM):
less VM_deploy.vmx |grep vmdk
Listing the VM disks for the VM
  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. 
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, you may want 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 you want 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
Running the command to list all VMs
  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

For more information, see Troubleshooting issues when creating or committing snapshots in ESX/ESXi (1038963). Committing snapshots when there are no snapshot entries in the Snapshot Manager
仮想マシンのスナップショット使用の特定
确定虚拟机是否在使用快照