Does anybody know how to get current snapshot name, using pyshpere api?
https://code.google.com/p/pysphere/wiki/GettingStarted#List_snapshots
Asked
Active
Viewed 672 times
0

JavaSa
- 5,813
- 16
- 71
- 121
-
I didn't find such option only to get all snapshots , delete current snapshot or revert to it – JavaSa Sep 08 '15 at 08:17
-
Please [edit] your question to clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the [ask] page for help clarifying this question. – JosefZ Sep 08 '15 at 08:23
1 Answers
0
# This ignores the certificate warning
default_context = ssl._create_default_https_context
ssl._create_default_https_context = ssl._create_unverified_context
# Connect to the VMware instance
server_instance = pysphere.VIServer();
server_instance.connect(ipaddress,username,password)
# Create a VM object of which details are required
vm = server_instance.get_vm_by_name(vmname)
# This gets the status of the VM.
print vm.get_status()
# This gets the current snapshot name.
print vm.get_current_snapshot_name()
It's always a good idea to refer to the basic libraries. Here is the link for pysphere. http://nullege.com/codes/show/src@p@y@pysphere-HEAD@pysphere@init.py/173/pysphere.vi_mor.MORTypes
Good luck!

Raghav Gaur
- 23
- 5