<div dir="ltr">Hi all<div><br></div><div>I&#39;ve written a Python script to take nightly snapshots of VMs which are kept for x days.  After x days the snapshot is deleted.</div><div><br></div><div>I can&#39;t work out how to wait for the snapshot deletion to complete.  I know how to do it for creating the snapshot but I&#39;ve not been able to get it right for the deletion.</div><div><br></div><div><div>      api.vms.get(VM_NAME).snapshots.add(params.Snapshot(description=SNAPSHOT_NAME, vm=api.vms.get(VM_NAME), persist_memorystate=True))</div><div>      while api.vms.get(VM_NAME).status.state == &#39;image_locked&#39;:</div><div>          sleep(1)</div></div><div><br></div><div>Any ideas?</div><div><br></div><div>Thanks</div><div><br></div><div>CC</div></div>