set (at exit) status of non-stopped vms on this host to 'REQUESTED_NEW'

This commit is contained in:
ahmadbilalkhalid 2019-07-25 13:09:09 +05:00
parent 0ee9418fb9
commit cbcbbdd9d7
1 changed files with 2 additions and 0 deletions

View File

@ -65,6 +65,8 @@ def goodbye(host):
vms = filter(lambda v: v.value["hostname"] == host.key, vms)
for vm in vms:
vm.value["hostname"] = ""
if vm.value["status"] != "STOPPED":
vm.value["status"] = "REQUESTED_NEW"
client.put(vm.key, vm.value, value_in_json=True)
logging.info(f"Host {host.key} dead! at {host.value['last_heartbeat']}")