Allow move of migrated VM to current node
Will make the migrate permanent instead of throwing an error. Fixes #96
This commit is contained in:
parent
da20b4493a
commit
f61d443773
|
@ -472,6 +472,11 @@ def move_vm(zk_conn, domain, target_node, wait=False):
|
||||||
|
|
||||||
# Verify if node is current node
|
# Verify if node is current node
|
||||||
if target_node == current_node:
|
if target_node == current_node:
|
||||||
|
last_node = zkhandler.readdata(zk_conn, '/domains/{}/lastnode'.format(dom_uuid))
|
||||||
|
if last_node:
|
||||||
|
zkhandler.writedata(zk_conn, {'/domains/{}/lastnode'.format(dom_uuid), ''})
|
||||||
|
return True, 'Making temporary migration permanent for VM "{}".'.format(domain)
|
||||||
|
|
||||||
return False, 'ERROR: VM "{}" is already running on node "{}".'.format(domain, current_node)
|
return False, 'ERROR: VM "{}" is already running on node "{}".'.format(domain, current_node)
|
||||||
|
|
||||||
if not target_node:
|
if not target_node:
|
||||||
|
|
Loading…
Reference in New Issue