Use build-in selector and respect limits in client

Use the new built-in selector option, as well as respecting node limits,
when performing migrate or move actions on a VM via the clients.
This commit is contained in:
2019-10-12 01:45:44 -04:00
parent 8dc0c8f0ac
commit e5393082b6
5 changed files with 83 additions and 74 deletions

View File

@ -425,12 +425,12 @@ def vm_stop(name):
}
return flask.jsonify(output), retcode
def vm_move(name, node, selector):
def vm_move(name, node):
"""
Move a VM to another node.
"""
zk_conn = pvc_common.startZKConnection(config['coordinators'])
retflag, retdata = pvc_vm.move_vm(zk_conn, name, node, selector)
retflag, retdata = pvc_vm.move_vm(zk_conn, name, node)
if retflag:
retcode = 200
else:
@ -442,12 +442,12 @@ def vm_move(name, node, selector):
}
return flask.jsonify(output), retcode
def vm_migrate(name, node, selector, flag_force):
def vm_migrate(name, node, flag_force):
"""
Temporarily migrate a VM to another node.
"""
zk_conn = pvc_common.startZKConnection(config['coordinators'])
retflag, retdata = pvc_vm.migrate_vm(zk_conn, name, node, selector, flag_force)
retflag, retdata = pvc_vm.migrate_vm(zk_conn, name, node, flag_force)
if retflag:
retcode = 200
else: