From c6e911bc07f61b0ca73d16e125d16bda70659112 Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Tue, 17 Jun 2008 06:51:05 +0000 Subject: [PATCH] Implement gnt-instance grow-disk This patch exposes at command line level the grow-disk operation. Reviewed-by: imsnah --- scripts/gnt-instance | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/scripts/gnt-instance b/scripts/gnt-instance index 4c73fbeb1..497a528a7 100755 --- a/scripts/gnt-instance +++ b/scripts/gnt-instance @@ -382,6 +382,21 @@ def DeactivateDisks(opts, args): return 0 +def GrowDisk(opts, args): + """Command-line interface for _ShutdownInstanceBlockDevices. + + This function takes the instance name, looks for its primary node + and the tries to shutdown its block devices on that node. + + """ + instance = args[0] + disk = args[1] + amount = utils.ParseUnit(args[2]) + op = opcodes.OpGrowDisk(instance_name=instance, disk=disk, amount=amount) + SubmitOpCode(op) + return 0 + + def StartupInstance(opts, args): """Startup an instance. @@ -1006,6 +1021,8 @@ commands = { 'deactivate-disks': (DeactivateDisks, ARGS_ONE, [DEBUG_OPT], "<instance>", "Deactivate an instance's disks"), + 'grow-disk': (GrowDisk, ARGS_FIXED(3), [DEBUG_OPT], + "<instance> <disk> <size>", "Grow an instance's disk"), 'list-tags': (ListTags, ARGS_ONE, [DEBUG_OPT], "<node_name>", "List the tags of the given instance"), 'add-tags': (AddTags, ARGS_ATLEAST(1), [DEBUG_OPT, TAG_SRC_OPT], -- GitLab