4

I'm trying to get a snapshot id which current machine state connected to. I logged to ESXi server via ssh.

Here is an example of vim-cmd vmsvc/snapshot.get <VMID>:

Get Snapshot:
|-ROOT
--Snapshot Name        : first
--Snapshot Id        : 1
--Snapshot Desciption  : Default
--Snapshot Created On  : 2/8/2013 16:45:17
--Snapshot State       : powered off
--|-CHILD
----Snapshot Name        : second
----Snapshot Id        : 2
----Snapshot Desciption  : Default
----Snapshot Created On  : 2/8/2013 16:46:3
----Snapshot State       : powered off
----|-CHILD
------Snapshot Name        : third
------Snapshot Id        : 3
------Snapshot Desciption  : Default
------Snapshot Created On  : 2/8/2013 16:46:38
------Snapshot State       : powered off
----|-CHILD
------Snapshot Name        : two-two
------Snapshot Id        : 4
------Snapshot Desciption  : Default
------Snapshot Created On  : 2/8/2013 16:57:23
------Snapshot State       : powered off

How to know what is the snapshot id my current running machine depend of.

Hennes
  • 65,804
  • 7
  • 115
  • 169
egor7
  • 245

1 Answers1

0

vim-cmd vmsvc/get.snapshotinfo <VMID> will return the entire snapshot tree. Curiously enough, the current snapshot is in the currentSnapshot field. For example:

currentSnapshot = 'vim.vm.Snapshot:104-snapshot-57',

In this case, 104 is the VM ID and 57 is the snapshot ID.