X-Git-Url: https://code.grnet.gr/git/ganeti-local/blobdiff_plain/5e04ed8b1a949e0185e509f91f3d199e571a27fa..68676a00a95239fcdd935758b7f6144cbec8b0fc:/lib/rpc.py diff --git a/lib/rpc.py b/lib/rpc.py index 57f0a8e..f2c85db 100644 --- a/lib/rpc.py +++ b/lib/rpc.py @@ -208,6 +208,18 @@ def call_instance_shutdown(node, instance): return c.getresult().get(node, False) +def call_instance_migrate(node, instance, target, live): + """Migrate an instance. + + This is a single-node call. + + """ + c = Client("instance_migrate", [instance.name, target, live]) + c.connect(node) + c.run() + return c.getresult().get(node, False) + + def call_instance_reboot(node, instance, reboot_type, extra_args): """Reboots an instance. @@ -500,6 +512,19 @@ def call_blockdev_find(node, disk): return c.getresult().get(node, False) +def call_blockdev_close(node, disks): + """Closes the given block devices. + + This is a single-node call. + + """ + params = [cf.ToDict() for cf in disks] + c = Client("blockdev_close", params) + c.connect(node) + c.run() + return c.getresult().get(node, False) + + def call_upload_file(node_list, file_name): """Upload a file. @@ -577,6 +602,36 @@ def call_hooks_runner(node_list, hpath, phase, env): return result +def call_iallocator_runner(node, name, idata): + """Call an iallocator on a remote node + + Args: + - name: the iallocator name + - input: the json-encoded input string + + This is a single-node call. + + """ + params = [name, idata] + c = Client("iallocator_runner", params) + c.connect(node) + c.run() + result = c.getresult().get(node, False) + return result + + +def call_blockdev_grow(node, cf_bdev, amount): + """Request a snapshot of the given block device. + + This is a single-node call. + + """ + c = Client("blockdev_grow", [cf_bdev.ToDict(), amount]) + c.connect(node) + c.run() + return c.getresult().get(node, False) + + def call_blockdev_snapshot(node, cf_bdev): """Request a snapshot of the given block device.