diff --git a/doc/examples/ganeti.initd.in b/doc/examples/ganeti.initd.in index 8a9662ca1175fa768031b93dfa32c6495528b084..10bc684da88732f8a882f9932d6d0dbe40a11966 100644 --- a/doc/examples/ganeti.initd.in +++ b/doc/examples/ganeti.initd.in @@ -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" \ -- "$@" diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 3ad5b1a601f57278377fd715f613a32f0b01aeed..01a8c93b471d275e03646bc372dc4a24aac82331 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -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 diff --git a/man/gnt-backup.sgml b/man/gnt-backup.sgml index da01af2346d2bc4e5056959c38caf4f25742cfb2..f7efd78362d0c5c67f6db4653ba05d81b20080af 100644 --- a/man/gnt-backup.sgml +++ b/man/gnt-backup.sgml @@ -331,6 +331,7 @@ <screen> # gnt-backup list --nodes node1 --nodes node2 </screen> + </para> </refsect2> <refsect2> diff --git a/man/gnt-debug.sgml b/man/gnt-debug.sgml index 26639d56405c11822717007a0fc83685cae55908..2e624b053c8c334dd07b0c531d3f528453a0194a 100644 --- a/man/gnt-debug.sgml +++ b/man/gnt-debug.sgml @@ -107,6 +107,7 @@ for more details about this framework, see the HTML or PDF documentation. </para> + </refsect2> <refsect2> <title>DELAY</title> diff --git a/man/gnt-instance.sgml b/man/gnt-instance.sgml index 4191a44be934453f2f5c2fd95446bcd572ac9a90..f74f398c32d8d823339abec9d6992d95761acf1d 100644 --- a/man/gnt-instance.sgml +++ b/man/gnt-instance.sgml @@ -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> diff --git a/man/gnt-node.sgml b/man/gnt-node.sgml index 62355f08941d9e161c10a31391cd24fa2240b22f..b3c4f3e261b5825f59180f77d3a67b740c7acde7 100644 --- a/man/gnt-node.sgml +++ b/man/gnt-node.sgml @@ -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> diff --git a/scripts/gnt-instance b/scripts/gnt-instance index 8e4da17d494ef734304341555cbf9f2740c81bc0..9572e5863e386040ea3f4d0cac8290c0acc95895 100755 --- a/scripts/gnt-instance +++ b/scripts/gnt-instance @@ -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" diff --git a/scripts/gnt-node b/scripts/gnt-node index c421096dfb08cc0b09ca370bbd8efe994fbe675b..5259678cd1a0ea9fe1423e7b6b5931fb63499a6b 100755 --- a/scripts/gnt-node +++ b/scripts/gnt-node @@ -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"), ],