
Ich versuche, eine Snapshot-ID zu erhalten, mit der der aktuelle Maschinenstatus verbunden ist. Ich habe mich per SSH beim ESXi-Server angemeldet.
Hier ist ein Beispiel für 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
So finden Sie heraus, von welcher Snapshot-ID meine aktuell laufende Maschine abhängt.
Antwort1
vim-cmd vmsvc/get.snapshotinfo <VMID>
gibt den gesamten Snapshot-Baum zurück. Kurioserweise befindet sich der aktuelle Snapshot im currentSnapshot
Feld. Beispiel:
currentSnapshot = 'vim.vm.Snapshot:104-snapshot-57',
In diesem Fall ist 104 die VM-ID und 57 die Snapshot-ID.