Add missing disable function

This commit is contained in:
Joshua Boniface 2020-01-05 14:38:14 -05:00
parent 8cc20fbcfb
commit 8d758f3e53
1 changed files with 18 additions and 0 deletions

View File

@ -577,6 +577,24 @@ def vm_stop(name):
}
return output, retcode
def vm_disable(name):
"""
Disable a (stopped) VM in the PVC cluster.
"""
zk_conn = pvc_common.startZKConnection(config['coordinators'])
retflag, retdata = pvc_vm.disable_vm(zk_conn, name)
pvc_common.stopZKConnection(zk_conn)
if retflag:
retcode = 200
else:
retcode = 400
output = {
'message': retdata.replace('\"', '\'')
}
return output, retcode
def vm_move(name, node):
"""
Move a VM to another node.