vsphere-automation-sdk-python icon indicating copy to clipboard operation
vsphere-automation-sdk-python copied to clipboard

How to manage snapshots of the VMs?

Open andrewscott0 opened this issue 6 years ago • 8 comments

How do I do snapshot related operations on a VM? Say I want to capture snapshots or revert back to a snapshot, how can I do that? I've tried searching this on the vsphere automation sdk for python docs but it doesn't seem to have any information related to this.

Thanks.

andrewscott0 avatar Mar 28 '19 12:03 andrewscott0

@tianhao64 any feedback on this please ?

abessifi avatar Sep 29 '19 13:09 abessifi

Curious about this as well... Surprising the automation sdk doesn't have snapshot capabilities. Is this a feature request or already in progress?

rfalias avatar Oct 23 '19 17:10 rfalias

Can anybody confirm if this feature is still not available with the latest SDK? I can forward the request in that case.

anusha94 avatar Mar 16 '21 06:03 anusha94

I looks like it is a VM property, which makes sense. I am able to list them by the vm object anyway.

KnutssonDevelopment avatar Apr 22 '21 10:04 KnutssonDevelopment

I have posted some example code here: https://vm.knutsson.it/2021/04/get-snapshot-informatin-using-python/

KnutssonDevelopment avatar Apr 22 '21 10:04 KnutssonDevelopment

I have posted some example code here: https://vm.knutsson.it/2021/04/get-snapshot-informatin-using-python/

Good to know!, unfortunately this is working only on a separate API implementation: "Pyvmomi"

I keep wondering why they haven't implemented the same snapshot concept with the newer REST API

Anyway it's however possible to know the presence of snapshots with the following code:

vsphere_client.vcenter.VM.get('vm-208100').to_dict()['disks'][0]['value']['backing']['vmdk_file']
--> '[Datastore-A] vm_name/vm_name_disk-000001.vmdk'

Unfortunately we cannot know the date and any descriptions of the snapshot, but it is a start

luponata avatar May 04 '21 22:05 luponata

This is still not implemented?

avesst avatar May 02 '24 06:05 avesst