Commit 79d0631c authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

cyclades: Add backend function for resizing vm

Add 'resize_instance' backend function for resizing a vm. This command
issues an OP_INSTANCE_MODIFY job with the specified beparams, which
currently are vcpus, minmem and maxmem.

Refs #3870
parent 45bd654f
......@@ -454,6 +454,14 @@ def shutdown_instance(vm):
return client.ShutdownInstance(vm.backend_vm_id, dry_run=settings.TEST)
def resize_instance(vm, vcpus, memory):
beparams = {"vcpus": int(vcpus),
"minmem": int(memory),
"maxmem": int(memory)}
with pooled_rapi_client(vm) as client:
return client.ModifyInstance(vm.backend_vm_id, beparams=beparams)
def get_instance_console(vm):
# RAPI GetInstanceConsole() returns endpoints to the vnc_bind_address,
# which is a cluster-wide setting, either 0.0.0.0 or 127.0.0.1, and pretty
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment