This will be used for now to avoid ballooning memory at live migration time.
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Michael Hanselmann <hansmi@google.com>
"NONICS_OPT",
"NONLIVE_OPT",
"NONPLUS1_OPT",
+ "NORUNTIME_CHGS_OPT",
"NOSHUTDOWN_OPT",
"NOSTART_OPT",
"NOSSH_KEYCHECK_OPT",
help="Do not install the OS (will"
" enable no-start)")
+NORUNTIME_CHGS_OPT = cli_option("--no-runtime-changes",
+ dest="allow_runtime_chgs",
+ default=True, action="store_false",
+ help="Don't allow runtime changes")
+
BACKEND_OPT = cli_option("-B", "--backend-parameters", dest="beparams",
type="keyval", default={},
help="Backend parameters")
cleanup=opts.cleanup, iallocator=iallocator,
target_node=target_node,
allow_failover=opts.allow_failover,
+ allow_runtime_changes=opts.allow_runtime_chgs,
ignore_ipolicy=opts.ignore_ipolicy)
SubmitOpCode(op, cl=cl, opts=opts)
return 0
MigrateInstance, ARGS_ONE_INSTANCE,
[FORCE_OPT, NONLIVE_OPT, MIGRATION_MODE_OPT, CLEANUP_OPT, DRY_RUN_OPT,
PRIORITY_OPT, DST_NODE_OPT, IALLOCATOR_OPT, ALLOW_FAILOVER_OPT,
- IGNORE_IPOLICY_OPT],
+ IGNORE_IPOLICY_OPT, NORUNTIME_CHGS_OPT],
"[-f] <instance>", "Migrate instance to its secondary node"
" (only for mirrored instances)"),
"move": (
op = opcodes.OpNodeMigrate(node_name=args[0], mode=mode,
iallocator=opts.iallocator,
target_node=opts.dst_node,
+ allow_runtime_changes=opts.allow_runtime_chgs,
ignore_ipolicy=opts.ignore_ipolicy)
result = SubmitOpCode(op, cl=cl, opts=opts)
"migrate": (
MigrateNode, ARGS_ONE_NODE,
[FORCE_OPT, NONLIVE_OPT, MIGRATION_MODE_OPT, DST_NODE_OPT,
- IALLOCATOR_OPT, PRIORITY_OPT, IGNORE_IPOLICY_OPT],
+ IALLOCATOR_OPT, PRIORITY_OPT, IGNORE_IPOLICY_OPT,
+ NORUNTIME_CHGS_OPT],
"[-f] <node>",
"Migrate all the primary instance on a node away from it"
" (only for instances of type drbd)"),
_PIgnoreIpolicy = ("ignore_ipolicy", False, ht.TBool,
"Whether to ignore ipolicy violations")
+# Allow runtime changes while migrating
+_PAllowRuntimeChgs = ("allow_runtime_changes", True, ht.TBool,
+ "Allow runtime changes (eg. memory ballooning)")
+
+
#: OP_ID conversion regular expression
_OPID_RE = re.compile("([a-z])([A-Z])")
_PMigrationMode,
_PMigrationLive,
_PMigrationTargetNode,
+ _PAllowRuntimeChgs,
_PIgnoreIpolicy,
("iallocator", None, ht.TMaybeString,
"Iallocator for deciding the target node for shared-storage instances"),
_PMigrationMode,
_PMigrationLive,
_PMigrationTargetNode,
+ _PAllowRuntimeChgs,
_PIgnoreIpolicy,
("cleanup", False, ht.TBool,
"Whether a previously failed migration should be cleaned up"),
**migrate** [-f] {--cleanup} {*instance*}
**migrate** [-f] [--allow-failover] [--non-live]
-[--migration-mode=live\|non-live] [--ignore-ipolicy] {*instance*}
+[--migration-mode=live\|non-live] [--ignore-ipolicy]
+[--no-runtime-changes] {*instance*}
Migrate will move the instance to its secondary node without
shutdown. It only works for instances having the drbd8 disk template
If ``--ignore-ipolicy`` is given any instance policy violations occuring
during this operation are ignored.
+The ``--no-runtime-changes`` option forbids migrate to alter an
+instance's runtime before migrating it (eg. ballooning an instance
+down because the target node doesn't have enough available memory).
+
Example (and expected output)::
# gnt-instance migrate instance1
having a drbd disk template.
As for the **gnt-instance migrate** command, the options
-``--no-live`` and ``--migration-mode`` can be given to influence
-the migration type.
+``--no-live``, ``--migration-mode`` and ``--no-runtime-changes``
+can be given to influence the migration type.
If ``--ignore-ipolicy`` is given any instance policy violations occuring
during this operation are ignored.