Commit 893e8f49 authored by René Nussbaumer's avatar René Nussbaumer
Browse files

gnt-instance: Adapt replace-disks to the new opcode


Signed-off-by: default avatarRené Nussbaumer <rn@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent d2fe2bfb
......@@ -750,7 +750,8 @@ def ReplaceDisks(opts, args):
op = opcodes.OpInstanceReplaceDisks(instance_name=args[0], disks=disks,
remote_node=new_2ndary, mode=mode,
iallocator=iallocator,
early_release=opts.early_release)
early_release=opts.early_release,
ignore_ipolicy=opts.ignore_ipolicy)
SubmitOrSend(op, opts)
return 0
......@@ -1501,7 +1502,7 @@ commands = {
ReplaceDisks, ARGS_ONE_INSTANCE,
[AUTO_REPLACE_OPT, DISKIDX_OPT, IALLOCATOR_OPT, EARLY_RELEASE_OPT,
NEW_SECONDARY_OPT, ON_PRIMARY_OPT, ON_SECONDARY_OPT, SUBMIT_OPT,
DRY_RUN_OPT, PRIORITY_OPT],
DRY_RUN_OPT, PRIORITY_OPT, IGNORE_IPOLICY_OPT],
"[-s|-p|-n NODE|-I NAME] <instance>",
"Replaces all disks for the instance"),
"modify": (
......
......@@ -1200,17 +1200,17 @@ Disk management
REPLACE-DISKS
^^^^^^^^^^^^^
**replace-disks** [--submit] [--early-release] {-p} [--disks *idx*]
{*instance*}
**replace-disks** [--submit] [--early-release] [--ignore-ipolicy] {-p}
[--disks *idx*] {*instance*}
**replace-disks** [--submit] [--early-release] {-s} [--disks *idx*]
{*instance*}
**replace-disks** [--submit] [--early-release] [--ignore-ipolicy] {-s}
[--disks *idx*] {*instance*}
**replace-disks** [--submit] [--early-release] {--iallocator *name*
\| --new-secondary *NODE*} {*instance*}
**replace-disks** [--submit] [--early-release] [--ignore-ipolicy]
{--iallocator *name* \| -- {*instance*}
**replace-disks** [--submit] [--early-release] {--auto}
{*instance*}
**replace-disks** [--submit] [--early-release] [--ignore-ipolicy]
{--auto} {*instance*}
This command is a generalized form for replacing disks. It is
currently only valid for the mirrored (DRBD) disk template.
......@@ -1249,6 +1249,10 @@ disk failure on the current secondary (thus the old storage is already
broken) or when the storage on the primary node is known to be fine
(thus we won't need the old storage for potential recovery).
The ``--ignore-ipolicy`` let the command ignore instance policy
violations if replace-disks changes groups and the instance would
violate the new groups instance policy.
Note that it is not possible to select an offline or drained node as a
new secondary.
......
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