[ovirt-users] Python API question

Colin Coe colin.coe at gmail.com
Fri Jan 15 04:23:48 UTC 2016


Hi all

I've written a Python script to take nightly snapshots of VMs which are
kept for x days.  After x days the snapshot is deleted.

I can't work out how to wait for the snapshot deletion to complete.  I know
how to do it for creating the snapshot but I've not been able to get it
right for the deletion.


api.vms.get(VM_NAME).snapshots.add(params.Snapshot(description=SNAPSHOT_NAME,
vm=api.vms.get(VM_NAME), persist_memorystate=True))
      while api.vms.get(VM_NAME).status.state == 'image_locked':
          sleep(1)

Any ideas?

Thanks

CC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/users/attachments/20160115/d39ab890/attachment-0001.html>


More information about the Users mailing list