Commit 949bdabe authored by Iustin Pop's avatar Iustin Pop
Browse files

A bunch of doc and other small fixes

This patch adds a couple of both externally and internally reported
issues:
  - missing SGML tags (Issue 54), report and patch by superdupont
  - wrong variable used in the init.d script, report and patch by
    Karsten Keil <karsten-keil@t-online.de>
  - man page for gnt-instance reinstall needs clarification (Issue 56)
  - gnt-instance man page missing --disks documentation for
    replace-disks
  - gnt-node modify help output is unclear about the -C/-D/-O input
    format, and the man page doesn't document this command at all
  - “gnt-node modify -C yes” for offline or drained nodes had wrong
    error message
  - “gnt-instance reinstall --select-os” has wrong prompt, we only
    accept a number for the OS and not the template name

Reviewed-by: ultrotter
parent 8c7aaa72
......@@ -64,7 +64,7 @@ check_exitcode() {
start_action() {
# called as start_action daemon pidfile
local daemon="$1"; shift
local pidfile="$2"; shift
local pidfile="$1"; shift
log_action_begin_msg "$daemon"
start-stop-daemon --start --quiet --exec "$daemon" --pidfile "$pidfile" \
-- "$@"
......
......@@ -2335,7 +2335,7 @@ class LUSetNodeParams(LogicalUnit):
((node.offline and not self.op.offline == False) or
(node.drained and not self.op.drained == False))):
raise errors.OpPrereqError("Node '%s' is offline or drained, can't set"
" to master_candidate")
" to master_candidate" % node.name)
return
......
......@@ -331,6 +331,7 @@
<screen>
# gnt-backup list --nodes node1 --nodes node2
</screen>
</para>
</refsect2>
<refsect2>
......
......@@ -107,6 +107,7 @@
for more details about this framework, see the HTML or PDF
documentation.
</para>
</refsect2>
<refsect2>
<title>DELAY</title>
......
......@@ -1225,10 +1225,16 @@ instance5: 11225
</cmdsynopsis>
<para>
Reinstalls the operating system on the given instance. The instance
must be stopped when running this command. If the
<option>--os-type</option> is specified, the operating system is
changed.
Reinstalls the operating system on the given instance. The
instance must be stopped when running this command. If the
<option>--os-type</option> is specified, the operating
system is changed.
</para>
<para>
Since reinstall is potentially dangerous command, the user
will be required to confirm this action, unless the
<option>-f</option> flag is passed.
</para>
<para>
......@@ -1547,6 +1553,7 @@ instance5: 11225
<command>replace-disks</command>
<arg>--submit</arg>
<arg choice="req">-p</arg>
<arg>--disks <replaceable>idx</replaceable></arg>
<arg choice="req"><replaceable>instance</replaceable></arg>
</cmdsynopsis>
......@@ -1554,6 +1561,7 @@ instance5: 11225
<command>replace-disks</command>
<arg>--submit</arg>
<arg choice="req">-s</arg>
<arg>--disks <replaceable>idx</replaceable></arg>
<arg choice="req"><replaceable>instance</replaceable></arg>
</cmdsynopsis>
......@@ -1569,16 +1577,22 @@ instance5: 11225
</cmdsynopsis>
<para>
This command is a generalized form for adding and replacing
disks. It is currently only valid for the mirrored (DRBD)
disk template.
This command is a generalized form for replacing disks. It
is currently only valid for the mirrored (DRBD) disk
template.
</para>
<para>
The first form (when passing the <option>-p</option> option)
will replace the disks on the primary, while the second form
(when passing the <option>-s</option> option will replace
the disks on the secondary node.
the disks on the secondary node. For these two cases (as the
node doesn't change), it is possible to only run the replace
for a subset of the disks, using the option
<option>--disks</option> which takes a list of
comma-delimited disk indices (zero-based),
e.g. <userinput>0,2</userinput> to replace only the first
and third disks.
</para>
<para>
......
......@@ -502,6 +502,51 @@
</refsect2>
<refsect2>
<title>MODIFY</title>
<cmdsynopsis>
<command>modify</command>
<arg>-f</arg>
<arg>--submit</arg>
<arg>--master-candidate=<option>yes|no</option></arg>
<arg>--drained=<option>yes|no</option></arg>
<arg>--offline=<option>yes|no</option></arg>
<arg choice="req"><replaceable>node</replaceable></arg>
</cmdsynopsis>
<para>
This command changes the role of the node. Each options takes
either a literal <literal>yes</literal> or
<literal>no</literal>, and only one option should be given as
<literal>yes</literal>. The meaning of the roles are described
in the manpage <citerefentry>
<refentrytitle>ganeti</refentrytitle> <manvolnum>7</manvolnum>
</citerefentry>.
</para>
<para>
In case a node is demoted from the master candidate role, but
there are not enough new nodes for this case, the operation
will be refused. To override this check, pass the
<option>--force</option> option.
</para>
<para>
Example (setting a node offline, which will demote it from
master candidate role if is in that role):
<screen>
# gnt-node modify --offline=yes node1.example.com
</screen>
</para>
<para>Example (setting the node back to online and master candidate):
<screen>
# gnt-node modify --offline=no --master-candidate=yes node1.example.com
</screen>
</para>
</refsect2>
<refsect2>
<title>REMOVE</title>
......
......@@ -543,7 +543,7 @@ def ReinstallInstance(opts, args):
number = number + 1
choices.append(('x', 'exit', 'Exit gnt-instance reinstall'))
selected = AskUser("Enter OS template name or number (or x to abort):",
selected = AskUser("Enter OS template number (or x to abort):",
choices)
if selected == 'exit':
......@@ -1416,9 +1416,9 @@ commands = {
help=("Replace the disk(s) on the secondary"
" node (only for the drbd template)")),
make_option("--disks", dest="disks", default=None,
help=("Comma-separated list of disks"
" to replace (e.g. sda) (optional,"
" defaults to all disks")),
help="Comma-separated list of disks"
" indices to replace (e.g. 0,2) (optional,"
" defaults to all disks)"),
make_option("-I", "--iallocator", metavar="<NAME>",
help="Select new secondary for the instance"
" automatically using the"
......
......@@ -541,11 +541,13 @@ commands = {
SUBMIT_OPT,
make_option("-C", "--master-candidate", dest="master_candidate",
choices=('yes', 'no'), default=None,
metavar="yes|no",
help="Set the master_candidate flag on the node"),
make_option("-O", "--offline", dest="offline",
make_option("-O", "--offline", dest="offline", metavar="yes|no",
choices=('yes', 'no'), default=None,
help="Set the offline flag on the node"),
make_option("-D", "--drained", dest="drained",
make_option("-D", "--drained", dest="drained", metavar="yes|no",
choices=('yes', 'no'), default=None,
help="Set the drained flag on the node"),
],
......
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