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
  • 64,768
  • 7
  • 111
  • 168
egor7
  • 245
  • 4
  • 11
  • They all say "powered off"... I don't know if that means anything... – daviewales Feb 09 '13 at 09:52
  • What are you trying to do exactly? Your machine is "connected" to all of those snapshots. You can revert state of your VM to any of those snapshots. So answering your question, all snapshots in your example are current. @daviewales, it means that snapshots were made when vm was in "powered off" state. – Alex Antonov Oct 21 '13 at 08:31
  • I think he's trying to find out the "You are here" location that is visible in the vSphere client on Windows. I am trying to do the same thing. – Stephen Rasku Aug 28 '15 at 19:59

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.

Stephen Rasku
  • 152
  • 2
  • 2
  • 7