<div dir="ltr">Hi,<div><br></div><div>After issuing the remove operation, you can fetch the VM snapshots and check the status of the snapshot.</div><div>Here is an example how to fetch VM snapshots:</div><div><br></div><div><a href="https://github.com/oVirt/ovirt-engine-sdk/blob/master/sdk/examples/list_vm_snapshots.py" target="_blank">https://github.com/oVirt/<wbr>ovirt-engine-sdk/blob/master/<wbr>sdk/examples/list_vm_<wbr>snapshots.py</a><br></div><div><br></div><div>You'd want to wait until the status is OK.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 9, 2018 at 2:42 PM, <span dir="ltr"><<a href="mailto:nicolas@devels.es" target="_blank">nicolas@devels.es</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I'm running ovirt-engine-sdk-python 4.2.4 and I'm performing some snapshot-related tasks. I'd like to somehow control the status of the snapshot in order to know when I'll be able to run the next snapshot-related operation.<br>
<br>
For example, I'd like to create a new snapshot and then delete X oldest snapshots. After creating the snapshot I have to make sure the snapshot operation has concluded to run the deletion.<br>
<br>
However, I'm unable to find a native way to get the status of a snapshot.<br>
<br>
In [1]: snap = conn.follow_link(vm.snapshots)<wbr>[3] # This returns one snapshot<br>
<br>
In [2]: snap.status<br>
<br>
In [3]: snap.status_detail<br>
<br>
So both status-related properties return None. I've managed to find a "poorman's" way by doing this:<br>
<br>
while True:<br>
try:<br>
snaps_service.service(<a href="http://snap.id" rel="noreferrer" target="_blank">snap.id</a>)<wbr>.remove()<br>
except Error, e:<br>
if e.code == 409:<br>
sleep(30)<br>
continue<br>
else:<br>
break<br>
<br>
Which works but is quite "tricky".<br>
<br>
Is there a better way to do this?<br>
<br>
Thanks.<br>
______________________________<wbr>_________________<br>
Users mailing list<br>
<a href="mailto:Users@ovirt.org" target="_blank">Users@ovirt.org</a><br>
<a href="http://lists.ovirt.org/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.ovirt.org/mailman<wbr>/listinfo/users</a><br>
</blockquote></div><br></div></div>