X-Git-Url: https://code.grnet.gr/git/ganeti-local/blobdiff_plain/8d528b7cce3db73301cf3d82962cacbce492ad48..911a495b6553598d29c7b23294651be3cb602ce5:/lib/rpc.py diff --git a/lib/rpc.py b/lib/rpc.py index 0efb6a7..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. @@ -595,6 +620,18 @@ def call_iallocator_runner(node, name, idata): 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.