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.

3
  • They all say "powered off"... I don't know if that means anything...
    – daviewales
    Feb 9 '13 at 9: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. Oct 21 '13 at 8: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. Aug 28 '15 at 19:59
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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.