1 <!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [
3 <!-- Fill in your name for FIRSTNAME and SURNAME. -->
4 <!-- Please adjust the date whenever revising the manpage. -->
5 <!ENTITY dhdate "<date>February 12, 2009</date>">
6 <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
7 allowed: see man(7), man(1). -->
8 <!ENTITY dhsection "<manvolnum>8</manvolnum>">
9 <!ENTITY dhucpackage "<refentrytitle>gnt-node</refentrytitle>">
10 <!ENTITY dhpackage "gnt-node">
12 <!ENTITY debian "<productname>Debian</productname>">
13 <!ENTITY gnu "<acronym>GNU</acronym>">
14 <!ENTITY gpl "&gnu; <acronym>GPL</acronym>">
15 <!ENTITY footer SYSTEM "footer.sgml">
25 <holder>Google Inc.</holder>
33 <refmiscinfo>ganeti 2.0</refmiscinfo>
36 <refname>&dhpackage;</refname>
38 <refpurpose>node administration</refpurpose>
42 <command>&dhpackage; </command>
44 <arg choice="req">command</arg>
45 <arg>arguments...</arg>
49 <title>DESCRIPTION</title>
52 The <command>&dhpackage;</command> is used for managing the
53 (physical) nodes in the ganeti system.
58 <title>COMMANDS</title>
64 <command>add</command>
66 <arg>-s <replaceable>secondary_ip</replaceable></arg>
67 <arg choice="req"><replaceable>nodename</replaceable></arg>
71 Adds the given node to the cluster.
75 This command is used to join a new node to the cluster. You
76 will have to provide the password for root of the node to be
77 able to add the node in the cluster. The command needs to be
78 run on the ganeti master.
82 Note that the command is potentially destructive, as it will
83 forcibly join the specified host the cluster, not paying
84 attention to its current status (it could be already in a
89 The <option>-s</option> is used in dual-home clusters and
90 specifies the new node's IP in the secondary network. See the
91 discussion in <citerefentry>
92 <refentrytitle>gnt-cluster</refentrytitle>
93 <manvolnum>8</manvolnum> </citerefentry> for more
98 In case you're readding a node after hardware failure, you can
99 use the <option>--readd</option> parameter. In this case, you
100 don't need to pass the secondary IP again, it will reused from
101 the cluster. Also, the <literal>drained</literal> and
102 <literal>offline</literal> flags of the node will be cleared
109 # gnt-node add node5.example.com
110 # gnt-node add -s 192.168.44.5 node5.example.com
116 <title>ADD-TAGS</title>
119 <command>add-tags</command>
120 <arg choice="opt">--from <replaceable>file</replaceable></arg>
121 <arg choice="req"><replaceable>nodename</replaceable></arg>
123 rep="repeat"><replaceable>tag</replaceable></arg>
127 Add tags to the given node. If any of the tags contains
128 invalid characters, the entire operation will abort.
132 If the <option>--from</option> option is given, the list of
133 tags will be extended with the contents of that file (each
134 line becomes a tag). In this case, there is not need to pass
135 tags on the command line (if you do, both sources will be
136 used). A file name of - will be interpreted as stdin.
141 <title>EVACUATE</title>
144 <command>evacuate</command>
146 <arg>--early-release</arg>
148 <arg>--iallocator <replaceable>NAME</replaceable></arg>
149 <arg>--new-secondary <replaceable>destination_node</replaceable></arg>
151 <arg choice="req" rep="repeat"><replaceable>node</replaceable></arg>
155 This command will move all secondary instances away from the
156 given node(s). It works only for instances having a drbd disk
161 The new location for the instances can be specified in two ways:
164 <simpara>as a single node for all instances, via the
165 <option>--new-secondary</option> option</simpara>
168 <simpara>or via the <option>--iallocator</option> option,
169 giving a script name as parameter, so each instance will
170 be in turn placed on the (per the script) optimal
177 The <option>--early-release</option> changes the code so that
178 the old storage on node being evacuated is removed early
179 (before the resync is completed) and the internal Ganeti locks
180 are also released for both the current secondary and the new
181 secondary, thus allowing more parallelism in the cluster
182 operation. This should be used only when recovering from a
183 disk failure on the current secondary (thus the old storage is
184 already broken) or when the storage on the primary node is
185 known to be fine (thus we won't need the old storage for
192 # gnt-node evacuate -I dumb node3.example.com
198 <title>FAILOVER</title>
201 <command>failover</command>
203 <arg>--ignore-consistency</arg>
204 <arg choice="req"><replaceable>node</replaceable></arg>
208 This command will fail over all instances having the given
209 node as primary to their secondary nodes. This works only for
210 instances having a drbd disk template.
214 Normally the failover will check the consistency of the disks
215 before failing over the instance. If you are trying to migrate
216 instances off a dead node, this will fail. Use the
217 <option>--ignore-consistency</option> option for this purpose.
223 # gnt-node failover node1.example.com
232 <command>info</command>
233 <arg rep="repeat"><replaceable>node</replaceable></arg>
237 Show detailed information about the nodes in the cluster. If you
238 don't give any arguments, all nodes will be shows, otherwise the
239 output will be restricted to the given names.
247 <command>list</command>
250 <arg>--no-headers</arg>
251 <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
253 <arg>--units=<replaceable>UNITS</replaceable></arg>
254 <arg>-o <replaceable>[+]FIELD,...</replaceable></arg>
256 <arg rep="repeat">node</arg>
260 Lists the nodes in the cluster.
264 The <option>--no-headers</option> option will skip the initial
265 header line. The <option>--separator</option> option takes an
266 argument which denotes what will be used between the output
267 fields. Both these options are to help scripting.
271 The units used to display the numeric values in the output
272 varies, depending on the options given. By default, the values
273 will be formatted in the most appropriate unit. If the
274 <option>--separator</option> option is given, then the values
275 are shown in mebibytes to allow parsing by scripts. In both
276 cases, the <option>--units</option> option can be used to
277 enforce a given output unit.
281 By default, the query of nodes will be done in parallel with
282 any running jobs. This might give inconsistent results for the
283 free disk/memory. The <option>--sync</option> can be used to
284 grab locks for all the nodes and ensure consistent view of the
285 cluster (but this might stall the query for a long time).
289 The <option>-o</option> option takes a comma-separated list of
290 output fields. The available fields and their meaning are:
295 <simpara>the node name</simpara>
299 <term>pinst_cnt</term>
301 <simpara>the number of instances having this node as
306 <term>pinst_list</term>
308 <simpara>the list of instances having this node as
309 primary, comma separated</simpara>
313 <term>sinst_cnt</term>
315 <simpara>the number of instances having this node as a
316 secondary node</simpara>
320 <term>sinst_list</term>
322 <simpara>the list of instances having this node as a
323 secondary node, comma separated</simpara>
329 <simpara>the primary ip of this node (used for cluster
330 communication)</simpara>
337 the secondary ip of this node (used for data
338 replication in dual-ip clusters, see <citerefentry>
339 <refentrytitle>gnt-cluster</refentrytitle>
340 <manvolnum>8</manvolnum>
348 <simpara>total disk space in the volume group used for
349 instance disk allocations</simpara>
355 <simpara>available disk space in the volume group</simpara>
361 <simpara>total memory on the physical node</simpara>
367 <simpara>the memory used by the node itself</simpara>
373 <simpara>memory available for instance
374 allocations</simpara>
380 <simpara>the node bootid value; this is a linux specific
381 feature that assigns a new UUID to the node at each boot
382 and can be use to detect node reboots (by tracking
383 changes in this value)</simpara>
389 <simpara>comma-separated list of the node's
394 <term>serial_no</term>
396 <simpara>the so called 'serial number' of the node;
397 this is a numeric field that is incremented each time
398 the node is modified, and it can be used to detect
399 modifications</simpara>
406 the creation time of the node; note that this field
407 contains spaces and as such it's harder to parse
410 if this attribute is not present (e.g. when upgrading
411 from older versions), then "N/A" will be shown instead
419 the last modification time of the node; note that this
420 field contains spaces and as such it's harder to parse
423 if this attribute is not present (e.g. when upgrading
424 from older versions), then "N/A" will be shown instead
431 <simpara>Show the UUID of the node (generated
432 automatically by Ganeti)</simpara>
439 <simpara>the toal number of logical processors</simpara>
445 <simpara>the number of NUMA domains on the node, if the
446 hypervisor can export this information</simpara>
450 <term>csockets</term>
452 <simpara>the number of physical CPU sockets, if the
453 hypervisor can export this information</simpara>
457 <term>master_candidate</term>
459 <simpara>whether the node is a master candidate or not</simpara>
465 <simpara>whether the node is drained or not; the cluster
466 still communicates with drained nodes but excludes them
467 from allocation operations</simpara>
473 <simpara>whether the node is offline or not; if offline,
474 the cluster does not communicate with offline nodes;
475 useful for nodes that are not reachable in order to
476 avoid delays</simpara>
483 A condensed version of the node flags; this field will
484 output a one-character field, with the following
488 <simpara><emphasis>M</emphasis> for the master
492 <simpara><emphasis>C</emphasis> for a master
496 <simpara><emphasis>R</emphasis> for a regular
500 <simpara><emphasis>D</emphasis> for a drained
504 <simpara><emphasis>O</emphasis> for an offline
515 If the value of the option starts with the character
516 <constant>+</constant>, the new fields will be added to the
517 default list. This allows to quickly see the default list plus
518 a few other fields, instead of retyping the entire list of
523 Note that some of this fields are known from the configuration
524 of the cluster (e.g. <simplelist type="inline">
525 <member>name</member> <member>pinst</member>
526 <member>sinst</member> <member>pip</member>
527 <member>sip</member> </simplelist> and thus the master does
528 not need to contact the node for this data (making the listing
529 fast if only fields from this set are selected), whereas the
530 other fields are "live" fields and we need to make a query to
535 Depending on the virtualization type and implementation
536 details, the mtotal, mnode and mfree may have slighly varying
537 meanings. For example, some solutions share the node memory
538 with the pool of memory used for instances
539 (<acronym>KVM</acronym>), whereas others have separate memory
540 for the node and for the instances (Xen).
544 If no node names are given, then all nodes are
545 queried. Otherwise, only the given nodes will be listed.
550 <title>LIST-TAGS</title>
553 <command>list-tags</command>
554 <arg choice="req"><replaceable>nodename</replaceable></arg>
557 <para>List the tags of the given node.</para>
561 <title>MIGRATE</title>
563 <command>migrate</command>
565 <arg>--non-live</arg>
566 <arg choice="req"><replaceable>node</replaceable></arg>
570 This command will migrate all instances having the given
571 node as primary to their secondary nodes. This works only for
572 instances having a drbd disk template.
576 As for the <command>gnt-instance migrate</command> command,
577 the <option>--no-live</option> option can be given to do a
584 # gnt-node migrate node1.example.com
591 <title>MODIFY</title>
593 <command>modify</command>
596 <arg>--master-candidate=<option>yes|no</option></arg>
597 <arg>--drained=<option>yes|no</option></arg>
598 <arg>--offline=<option>yes|no</option></arg>
599 <arg>--auto-promote</arg>
600 <arg choice="req"><replaceable>node</replaceable></arg>
604 This command changes the role of the node. Each options takes
605 either a literal <literal>yes</literal> or
606 <literal>no</literal>, and only one option should be given as
607 <literal>yes</literal>. The meaning of the roles are described
608 in the manpage <citerefentry>
609 <refentrytitle>ganeti</refentrytitle> <manvolnum>7</manvolnum>
614 In case a node is demoted from the master candidate role, the
615 operation will be refused unless you pass
616 the <option>--auto-promote</option> option. This option will
617 cause the operation to lock all cluster nodes (thus it will
618 not be able to run in parallel with most other jobs), but it
619 allows automated maintenance of the cluster candidate pool. If
620 locking all cluster node is too expensive, another option is
621 to promote manually another node to master candidate before
622 demoting the current one.
626 Example (setting a node offline, which will demote it from
627 master candidate role if is in that role):
629 # gnt-node modify --offline=yes node1.example.com
633 <para>Example (setting the node back to online and master candidate):
635 # gnt-node modify --offline=no --master-candidate=yes node1.example.com
642 <title>REMOVE</title>
645 <command>remove</command>
646 <arg choice="req"><replaceable>nodename</replaceable></arg>
650 Removes a node from the cluster. Instances must be removed or
651 migrated to another cluster before.
657 # gnt-node remove node5.example.com
663 <title>REMOVE-TAGS</title>
665 <command>remove-tags</command>
666 <arg choice="opt">--from <replaceable>file</replaceable></arg>
667 <arg choice="req"><replaceable>nodename</replaceable></arg>
669 rep="repeat"><replaceable>tag</replaceable></arg>
673 Remove tags from the given node. If any of the tags are not
674 existing on the node, the entire operation will abort.
678 If the <option>--from</option> option is given, the list of
679 tags will be extended with the contents of that file (each
680 line becomes a tag). In this case, there is not need to pass
681 tags on the command line (if you do, both sources will be
682 used). A file name of - will be interpreted as stdin.
687 <title>VOLUMES</title>
690 <command>volumes</command>
691 <arg>--no-headers</arg>
692 <arg>--human-readable</arg>
693 <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
694 <arg>--output=<replaceable>FIELDS</replaceable></arg>
696 <arg rep="repeat"><replaceable>node</replaceable></arg>
700 Lists all logical volumes and their physical disks from the node(s)
705 The <option>--no-headers</option> option will skip the initial
706 header line. The <option>--separator</option> option takes an
707 argument which denotes what will be used between the output
708 fields. Both these options are to help scripting.
712 The units used to display the numeric values in the output
713 varies, depending on the options given. By default, the values
714 will be formatted in the most appropriate unit. If the
715 <option>--separator</option> option is given, then the values
716 are shown in mebibytes to allow parsing by scripts. In both
717 cases, the <option>--units</option> option can be used to
718 enforce a given output unit.
722 The <option>-o</option> option takes a comma-separated list of
723 output fields. The available fields and their meaning are:
728 <simpara>the node name on which the volume exists</simpara>
734 <simpara>the physical drive (on which the LVM physical
735 volume lives)</simpara>
741 <simpara>the volume group name</simpara>
747 <simpara>the logical volume name</simpara>
753 <simpara>the logical volume size</simpara>
757 <term>instance</term>
759 <simpara>The name of the instance to which this volume
760 belongs, or (in case it's an orphan volume) the
761 character <quote>-</quote></simpara>
770 # gnt-node volumes node5.example.com
771 Node PhysDev VG Name Size Instance
772 node1.example.com /dev/hdc1 xenvg instance1.example.com-sda_11000.meta 128 instance1.example.com
773 node1.example.com /dev/hdc1 xenvg instance1.example.com-sda_11001.data 256 instance1.example.com
779 <title>LIST-STORAGE</title>
782 <command>list-storage</command>
783 <arg>--no-headers</arg>
784 <arg>--human-readable</arg>
785 <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
786 <arg>--storage-type=<replaceable>STORAGE_TYPE</replaceable></arg>
787 <arg>--output=<replaceable>FIELDS</replaceable></arg>
789 <arg rep="repeat"><replaceable>node</replaceable></arg>
793 Lists the available storage units and their details for the
798 The <option>--no-headers</option> option will skip the initial header
799 line. The <option>--separator</option> option takes an argument which
800 denotes what will be used between the output fields. Both these options
801 are to help scripting.
805 The units used to display the numeric values in the output varies,
806 depending on the options given. By default, the values will be
807 formatted in the most appropriate unit. If the
808 <option>--separator</option> option is given, then the values are shown
809 in mebibytes to allow parsing by scripts. In both cases, the
810 <option>--units</option> option can be used to enforce a given output
815 The <option>--storage-type</option> option can be used to choose a
816 storage unit type. Possible choices are <literal>lvm-pv</literal>,
817 <literal>lvm-vg</literal> or <literal>file</literal>.
821 The <option>-o</option> option takes a comma-separated list of
822 output fields. The available fields and their meaning are:
827 <simpara>the node name on which the volume exists</simpara>
833 <simpara>the type of the storage unit (currently just
834 what is passed in via
835 <option>--storage-type</option>)</simpara>
841 <simpara>the path/identifier of the storage unit</simpara>
848 total size of the unit; for the file type see a note below
856 used space in the unit; for the file type see a note below
869 <term>allocatable</term>
872 whether we the unit is available for allocation
873 (only <literal>lvm-pv</literal> can change this
874 setting, the other types always report true)
882 Note that for the <quote>file</quote> type, the total disk
883 space might not equal to the sum of used and free, due to the
884 method Ganeti uses to compute each of them. The total and free
885 values are computed as the total and free space values for the
886 filesystem to which the directory belongs, but the used space
887 is computed from the used space under that directory
888 <emphasis>only</emphasis>, which might not be necessarily the
889 root of the filesystem, and as such there could be files
890 outside the file storage directory using disk space and
891 causing a mismatch in the values.
897 node1# gnt-node list-storage node2
898 Node Type Name Size Used Free Allocatable
899 node2 lvm-pv /dev/sda7 673.8G 1.5G 672.3G Y
900 node2 lvm-pv /dev/sdb1 698.6G 0M 698.6G Y
906 <title>MODIFY-STORAGE</title>
909 <command>modify-storage</command>
910 <arg><option>--allocatable=yes|no</option></arg>
912 <arg choice="req"><replaceable>node</replaceable></arg>
913 <arg choice="req"><replaceable>storage-type</replaceable></arg>
914 <arg choice="req"><replaceable>volume-name</replaceable></arg>
918 Modifies storage volumes on a node. Only LVM physical volumes
919 can be modified at the moment. They have a storage type
920 of <quote>lvm-pv</quote>.
926 # gnt-node modify-storage --allocatable no node5.example.com lvm-pv /dev/sdb1
932 <title>REPAIR-STORAGE</title>
935 <command>repair-storage</command>
936 <arg>--ignore-consistency</arg>
937 <arg choice="req"><replaceable>node</replaceable></arg>
938 <arg choice="req"><replaceable>storage-type</replaceable></arg>
939 <arg choice="req"><replaceable>volume-name</replaceable></arg>
943 Repairs a storage volume on a node. Only LVM volume groups can
944 be repaired at this time. They have the storage type
945 <quote>lvm-vg</quote>.
949 On LVM volume groups, <command>repair-storage</command> runs
950 <quote>vgreduce --removemissing</quote>.
955 Running this command can lead to data loss. Use it with care.
960 The <option>--ignore-consistency</option> option will ignore
961 any inconsistent disks (on the nodes paired with this
962 one). Use of this option is most likely to lead to data-loss.
968 # gnt-node repair-storage node5.example.com lvm-vg xenvg
974 <title>POWERCYCLE</title>
977 <command>powercycle</command>
978 <arg><option>--confirm</option></arg>
979 <arg><option>--force</option></arg>
980 <arg choice="req"><replaceable>node</replaceable></arg>
984 This commands (tries to) forcefully reboot a node. It is a
985 command that can be used if the node environemnt is broken,
986 such that the admin can no longer login over ssh, but the
987 ganeti node daemon is still working.
991 Note that this command is not guaranteed to work; it depends
992 on the hypervisor how effective is the reboot attempt. For
993 Linux, this command require that the kernel option
994 <literal>CONFIG_MAGIC_SYSRQ</literal> is enabled.
998 The <option>--yes</option> option can be used to skip
999 confirmation, while the <option>--force</option> option is
1000 needed if the target node is the master node.
1009 <!-- Keep this comment at the end of the file
1014 sgml-minimize-attributes:nil
1015 sgml-always-quote-attributes:t
1018 sgml-parent-document:nil
1019 sgml-default-dtd-file:nil
1020 sgml-exposed-tags:nil
1021 sgml-local-catalogs:nil
1022 sgml-local-ecat-files:nil