Add task to gracefully terminate domain class instances

This commit is contained in:
Joshua Boniface 2018-06-15 01:37:23 -04:00
parent 60b5156c37
commit dd8b7d69cc
1 changed files with 3 additions and 0 deletions

3
pvc.py
View File

@ -767,6 +767,9 @@ def undefine_vm(dom_name, dom_uuid):
click.echo('Waiting for cluster to update.') click.echo('Waiting for cluster to update.')
time.sleep(3) time.sleep(3)
# Gracefully terminate the class instances
transaction.set_data('/domains/{}/state'.format(dom_uuid), 'delete'.encode('ascii'))
time.sleep(2)
# Delete the configurations # Delete the configurations
click.echo('Undefining VM "{}".'.format(dom_uuid)) click.echo('Undefining VM "{}".'.format(dom_uuid))
transaction = zk.transaction() transaction = zk.transaction()