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
- Log in to the ESXi Host UI or vCenter Web Client
- Right-click on the virtual machine and select Snapshots > Snapshot Manager/Manage Snapshots
- If a snapshot is listed, the virtual machine is attached to one or more virtual disks which are in a snapshot state.
- Right click on VM and select Edit settings.
- Identifying the Datastore where the VM resides
Viewing the virtual machine configuration file
- Log in as root to the ESXi host using SSH.
- 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/
- Run this command to list vmdk (disks) of the VM in the vmx (configuration file of VM):
less VM_deploy.vmx |grep vmdk
- 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, 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
- Run this command to to see all VM's on the host:
vim-cmd vmsvc/getallvms
- 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