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>June 08, 2010</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.2</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>-g <replaceable>nodegroup</replaceable></arg>
68 <arg>--master-capable=<option>yes|no</option></arg>
69 <arg>--vm-capable=<option>yes|no</option></arg>
70 <arg choice="req"><replaceable>nodename</replaceable></arg>
74 Adds the given node to the cluster.
78 This command is used to join a new node to the cluster. You
79 will have to provide the password for root of the node to be
80 able to add the node in the cluster. The command needs to be
81 run on the Ganeti master.
85 Note that the command is potentially destructive, as it will
86 forcibly join the specified host the cluster, not paying
87 attention to its current status (it could be already in a
92 The <option>-s</option> is used in dual-home clusters and
93 specifies the new node's IP in the secondary network. See the
94 discussion in <citerefentry>
95 <refentrytitle>gnt-cluster</refentrytitle>
96 <manvolnum>8</manvolnum> </citerefentry> for more
101 In case you're readding a node after hardware failure, you can
102 use the <option>--readd</option> parameter. In this case, you
103 don't need to pass the secondary IP again, it will reused from
104 the cluster. Also, the <literal>drained</literal> and
105 <literal>offline</literal> flags of the node will be cleared
110 The <option>-g</option> is used to add the new node into a specific
111 node group, specified by uuid or name. If only one node group exists
112 you can skip this option, otherwise it's mandatory.
116 The <option>vm_capable</option>
117 and <option>master_capable</option> options are described
118 in <citerefentry><refentrytitle>ganeti</refentrytitle><manvolnum>7</manvolnum></citerefentry>,
119 and are used to set the properties of the new node.
125 # gnt-node add node5.example.com
126 # gnt-node add -s 192.0.2.5 node5.example.com
127 # gnt-node add -g group2 -s 192.0.2.9 node9.group2.example.com
133 <title>ADD-TAGS</title>
136 <command>add-tags</command>
137 <arg choice="opt">--from <replaceable>file</replaceable></arg>
138 <arg choice="req"><replaceable>nodename</replaceable></arg>
140 rep="repeat"><replaceable>tag</replaceable></arg>
144 Add tags to the given node. If any of the tags contains
145 invalid characters, the entire operation will abort.
149 If the <option>--from</option> option is given, the list of
150 tags will be extended with the contents of that file (each
151 line becomes a tag). In this case, there is not need to pass
152 tags on the command line (if you do, both sources will be
153 used). A file name of - will be interpreted as stdin.
158 <title>EVACUATE</title>
161 <command>evacuate</command>
163 <arg>--early-release</arg>
165 <arg>--iallocator <replaceable>NAME</replaceable></arg>
166 <arg>--new-secondary <replaceable>destination_node</replaceable></arg>
168 <arg choice="req" rep="repeat"><replaceable>node</replaceable></arg>
172 This command will move all secondary instances away from the
173 given node(s). It works only for instances having a drbd disk
178 The new location for the instances can be specified in two ways:
181 <simpara>as a single node for all instances, via the
182 <option>--new-secondary</option> option</simpara>
185 <simpara>or via the <option>--iallocator</option> option,
186 giving a script name as parameter, so each instance will
187 be in turn placed on the (per the script) optimal
194 The <option>--early-release</option> changes the code so that
195 the old storage on node being evacuated is removed early
196 (before the resync is completed) and the internal Ganeti locks
197 are also released for both the current secondary and the new
198 secondary, thus allowing more parallelism in the cluster
199 operation. This should be used only when recovering from a
200 disk failure on the current secondary (thus the old storage is
201 already broken) or when the storage on the primary node is
202 known to be fine (thus we won't need the old storage for
209 # gnt-node evacuate -I dumb node3.example.com
215 <title>FAILOVER</title>
218 <command>failover</command>
220 <arg>--ignore-consistency</arg>
221 <arg choice="req"><replaceable>node</replaceable></arg>
225 This command will fail over all instances having the given
226 node as primary to their secondary nodes. This works only for
227 instances having a drbd disk template.
231 Normally the failover will check the consistency of the disks
232 before failing over the instance. If you are trying to migrate
233 instances off a dead node, this will fail. Use the
234 <option>--ignore-consistency</option> option for this purpose.
240 # gnt-node failover node1.example.com
249 <command>info</command>
250 <arg rep="repeat"><replaceable>node</replaceable></arg>
254 Show detailed information about the nodes in the cluster. If you
255 don't give any arguments, all nodes will be shows, otherwise the
256 output will be restricted to the given names.
264 <command>list</command>
267 <arg>--no-headers</arg>
268 <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
270 <arg>--units=<replaceable>UNITS</replaceable></arg>
271 <arg>-o <replaceable>[+]FIELD,...</replaceable></arg>
275 <arg rep="repeat">node</arg>
279 Lists the nodes in the cluster.
283 The <option>--no-headers</option> option will skip the initial
284 header line. The <option>--separator</option> option takes an
285 argument which denotes what will be used between the output
286 fields. Both these options are to help scripting.
290 The units used to display the numeric values in the output
291 varies, depending on the options given. By default, the values
292 will be formatted in the most appropriate unit. If the
293 <option>--separator</option> option is given, then the values
294 are shown in mebibytes to allow parsing by scripts. In both
295 cases, the <option>--units</option> option can be used to
296 enforce a given output unit.
300 By default, the query of nodes will be done in parallel with
301 any running jobs. This might give inconsistent results for the
302 free disk/memory. The <option>--sync</option> can be used to
303 grab locks for all the nodes and ensure consistent view of the
304 cluster (but this might stall the query for a long time).
308 Passing the <option>--roman</option> option gnt-node list will try to
309 output some of its fields in a latin-friendly way. This is not the
310 default for backwards compatibility.
314 The <option>-o</option> option takes a comma-separated list of
315 output fields. The available fields and their meaning are:
320 <simpara>the node name</simpara>
324 <term>pinst_cnt</term>
326 <simpara>the number of instances having this node as
331 <term>pinst_list</term>
333 <simpara>the list of instances having this node as
334 primary, comma separated</simpara>
338 <term>sinst_cnt</term>
340 <simpara>the number of instances having this node as a
341 secondary node</simpara>
345 <term>sinst_list</term>
347 <simpara>the list of instances having this node as a
348 secondary node, comma separated</simpara>
354 <simpara>the primary ip of this node (used for cluster
355 communication)</simpara>
362 the secondary ip of this node (used for data
363 replication in dual-ip clusters, see <citerefentry>
364 <refentrytitle>gnt-cluster</refentrytitle>
365 <manvolnum>8</manvolnum>
373 <simpara>total disk space in the volume group used for
374 instance disk allocations</simpara>
380 <simpara>available disk space in the volume group</simpara>
386 <simpara>total memory on the physical node</simpara>
392 <simpara>the memory used by the node itself</simpara>
398 <simpara>memory available for instance
399 allocations</simpara>
405 <simpara>the node bootid value; this is a linux specific
406 feature that assigns a new UUID to the node at each boot
407 and can be use to detect node reboots (by tracking
408 changes in this value)</simpara>
414 <simpara>comma-separated list of the node's
419 <term>serial_no</term>
421 <simpara>the so called 'serial number' of the node;
422 this is a numeric field that is incremented each time
423 the node is modified, and it can be used to detect
424 modifications</simpara>
431 the creation time of the node; note that this field
432 contains spaces and as such it's harder to parse
435 if this attribute is not present (e.g. when upgrading
436 from older versions), then "N/A" will be shown instead
444 the last modification time of the node; note that this
445 field contains spaces and as such it's harder to parse
448 if this attribute is not present (e.g. when upgrading
449 from older versions), then "N/A" will be shown instead
456 <simpara>Show the UUID of the node (generated
457 automatically by Ganeti)</simpara>
464 <simpara>the toal number of logical processors</simpara>
470 <simpara>the number of NUMA domains on the node, if the
471 hypervisor can export this information</simpara>
475 <term>csockets</term>
477 <simpara>the number of physical CPU sockets, if the
478 hypervisor can export this information</simpara>
482 <term>master_candidate</term>
484 <simpara>whether the node is a master candidate or not</simpara>
490 <simpara>whether the node is drained or not; the cluster
491 still communicates with drained nodes but excludes them
492 from allocation operations</simpara>
498 <simpara>whether the node is offline or not; if offline,
499 the cluster does not communicate with offline nodes;
500 useful for nodes that are not reachable in order to
501 avoid delays</simpara>
508 A condensed version of the node flags; this field will
509 output a one-character field, with the following
513 <simpara><emphasis>M</emphasis> for the master
517 <simpara><emphasis>C</emphasis> for a master
521 <simpara><emphasis>R</emphasis> for a regular
525 <simpara><emphasis>D</emphasis> for a drained
529 <simpara><emphasis>O</emphasis> for an offline
537 <term>master_capable</term>
539 <para>whether the node can become a master candidate</para>
543 <term>vm_capable</term>
545 <para>whether the node can host instances</para>
552 If the value of the option starts with the character
553 <constant>+</constant>, the new fields will be added to the
554 default list. This allows to quickly see the default list plus
555 a few other fields, instead of retyping the entire list of
560 Note that some of this fields are known from the configuration
561 of the cluster (e.g. <simplelist type="inline">
562 <member>name</member> <member>pinst</member>
563 <member>sinst</member> <member>pip</member>
564 <member>sip</member> </simplelist> and thus the master does
565 not need to contact the node for this data (making the listing
566 fast if only fields from this set are selected), whereas the
567 other fields are "live" fields and we need to make a query to
572 Depending on the virtualization type and implementation
573 details, the mtotal, mnode and mfree may have slighly varying
574 meanings. For example, some solutions share the node memory
575 with the pool of memory used for instances
576 (<acronym>KVM</acronym>), whereas others have separate memory
577 for the node and for the instances (Xen).
581 If no node names are given, then all nodes are
582 queried. Otherwise, only the given nodes will be listed.
587 <title>LIST-TAGS</title>
590 <command>list-tags</command>
591 <arg choice="req"><replaceable>nodename</replaceable></arg>
594 <para>List the tags of the given node.</para>
598 <title>MIGRATE</title>
600 <command>migrate</command>
602 <arg>--non-live</arg>
603 <arg>--migration-mode=live|non-live</arg>
604 <arg choice="req"><replaceable>node</replaceable></arg>
608 This command will migrate all instances having the given
609 node as primary to their secondary nodes. This works only for
610 instances having a drbd disk template.
614 As for the <command>gnt-instance migrate</command> command,
615 the options <option>--no-live</option>
616 and <option>--migration-mode</option> can be given to
617 influence the migration type.
623 # gnt-node migrate node1.example.com
630 <title>MODIFY</title>
632 <command>modify</command>
635 <arg>--master-candidate=<option>yes|no</option></arg>
636 <arg>--drained=<option>yes|no</option></arg>
637 <arg>--offline=<option>yes|no</option></arg>
638 <arg>--master-capable=<option>yes|no</option></arg>
639 <arg>--vm-capable=<option>yes|no</option></arg>
640 <arg>--auto-promote</arg>
641 <arg choice="req"><replaceable>node</replaceable></arg>
645 This command changes the role of the node. Each options takes
646 either a literal <literal>yes</literal> or
647 <literal>no</literal>, and only one option should be given as
648 <literal>yes</literal>. The meaning of the roles and flags are
649 described in the manpage <citerefentry>
650 <refentrytitle>ganeti</refentrytitle> <manvolnum>7</manvolnum>
655 In case a node is demoted from the master candidate role, the
656 operation will be refused unless you pass
657 the <option>--auto-promote</option> option. This option will
658 cause the operation to lock all cluster nodes (thus it will
659 not be able to run in parallel with most other jobs), but it
660 allows automated maintenance of the cluster candidate pool. If
661 locking all cluster node is too expensive, another option is
662 to promote manually another node to master candidate before
663 demoting the current one.
667 Example (setting a node offline, which will demote it from
668 master candidate role if is in that role):
670 # gnt-node modify --offline=yes node1.example.com
674 <para>Example (setting the node back to online and master candidate):
676 # gnt-node modify --offline=no --master-candidate=yes node1.example.com
683 <title>REMOVE</title>
686 <command>remove</command>
687 <arg choice="req"><replaceable>nodename</replaceable></arg>
691 Removes a node from the cluster. Instances must be removed or
692 migrated to another cluster before.
698 # gnt-node remove node5.example.com
704 <title>REMOVE-TAGS</title>
706 <command>remove-tags</command>
707 <arg choice="opt">--from <replaceable>file</replaceable></arg>
708 <arg choice="req"><replaceable>nodename</replaceable></arg>
710 rep="repeat"><replaceable>tag</replaceable></arg>
714 Remove tags from the given node. If any of the tags are not
715 existing on the node, the entire operation will abort.
719 If the <option>--from</option> option is given, the list of
720 tags will be extended with the contents of that file (each
721 line becomes a tag). In this case, there is not need to pass
722 tags on the command line (if you do, both sources will be
723 used). A file name of - will be interpreted as stdin.
728 <title>VOLUMES</title>
731 <command>volumes</command>
732 <arg>--no-headers</arg>
733 <arg>--human-readable</arg>
734 <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
735 <arg>--output=<replaceable>FIELDS</replaceable></arg>
737 <arg rep="repeat"><replaceable>node</replaceable></arg>
741 Lists all logical volumes and their physical disks from the node(s)
746 The <option>--no-headers</option> option will skip the initial
747 header line. The <option>--separator</option> option takes an
748 argument which denotes what will be used between the output
749 fields. Both these options are to help scripting.
753 The units used to display the numeric values in the output
754 varies, depending on the options given. By default, the values
755 will be formatted in the most appropriate unit. If the
756 <option>--separator</option> option is given, then the values
757 are shown in mebibytes to allow parsing by scripts. In both
758 cases, the <option>--units</option> option can be used to
759 enforce a given output unit.
763 The <option>-o</option> option takes a comma-separated list of
764 output fields. The available fields and their meaning are:
769 <simpara>the node name on which the volume exists</simpara>
775 <simpara>the physical drive (on which the LVM physical
776 volume lives)</simpara>
782 <simpara>the volume group name</simpara>
788 <simpara>the logical volume name</simpara>
794 <simpara>the logical volume size</simpara>
798 <term>instance</term>
800 <simpara>The name of the instance to which this volume
801 belongs, or (in case it's an orphan volume) the
802 character <quote>-</quote></simpara>
811 # gnt-node volumes node5.example.com
812 Node PhysDev VG Name Size Instance
813 node1.example.com /dev/hdc1 xenvg instance1.example.com-sda_11000.meta 128 instance1.example.com
814 node1.example.com /dev/hdc1 xenvg instance1.example.com-sda_11001.data 256 instance1.example.com
820 <title>LIST-STORAGE</title>
823 <command>list-storage</command>
824 <arg>--no-headers</arg>
825 <arg>--human-readable</arg>
826 <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
827 <arg>--storage-type=<replaceable>STORAGE_TYPE</replaceable></arg>
828 <arg>--output=<replaceable>FIELDS</replaceable></arg>
830 <arg rep="repeat"><replaceable>node</replaceable></arg>
834 Lists the available storage units and their details for the
839 The <option>--no-headers</option> option will skip the initial header
840 line. The <option>--separator</option> option takes an argument which
841 denotes what will be used between the output fields. Both these options
842 are to help scripting.
846 The units used to display the numeric values in the output varies,
847 depending on the options given. By default, the values will be
848 formatted in the most appropriate unit. If the
849 <option>--separator</option> option is given, then the values are shown
850 in mebibytes to allow parsing by scripts. In both cases, the
851 <option>--units</option> option can be used to enforce a given output
856 The <option>--storage-type</option> option can be used to choose a
857 storage unit type. Possible choices are <literal>lvm-pv</literal>,
858 <literal>lvm-vg</literal> or <literal>file</literal>.
862 The <option>-o</option> option takes a comma-separated list of
863 output fields. The available fields and their meaning are:
868 <simpara>the node name on which the volume exists</simpara>
874 <simpara>the type of the storage unit (currently just
875 what is passed in via
876 <option>--storage-type</option>)</simpara>
882 <simpara>the path/identifier of the storage unit</simpara>
889 total size of the unit; for the file type see a note below
897 used space in the unit; for the file type see a note below
910 <term>allocatable</term>
913 whether we the unit is available for allocation
914 (only <literal>lvm-pv</literal> can change this
915 setting, the other types always report true)
923 Note that for the <quote>file</quote> type, the total disk
924 space might not equal to the sum of used and free, due to the
925 method Ganeti uses to compute each of them. The total and free
926 values are computed as the total and free space values for the
927 filesystem to which the directory belongs, but the used space
928 is computed from the used space under that directory
929 <emphasis>only</emphasis>, which might not be necessarily the
930 root of the filesystem, and as such there could be files
931 outside the file storage directory using disk space and
932 causing a mismatch in the values.
938 node1# gnt-node list-storage node2
939 Node Type Name Size Used Free Allocatable
940 node2 lvm-pv /dev/sda7 673.8G 1.5G 672.3G Y
941 node2 lvm-pv /dev/sdb1 698.6G 0M 698.6G Y
947 <title>MODIFY-STORAGE</title>
950 <command>modify-storage</command>
951 <arg><option>--allocatable=yes|no</option></arg>
953 <arg choice="req"><replaceable>node</replaceable></arg>
954 <arg choice="req"><replaceable>storage-type</replaceable></arg>
955 <arg choice="req"><replaceable>volume-name</replaceable></arg>
959 Modifies storage volumes on a node. Only LVM physical volumes
960 can be modified at the moment. They have a storage type
961 of <quote>lvm-pv</quote>.
967 # gnt-node modify-storage --allocatable no node5.example.com lvm-pv /dev/sdb1
973 <title>REPAIR-STORAGE</title>
976 <command>repair-storage</command>
977 <arg>--ignore-consistency</arg>
978 <arg choice="req"><replaceable>node</replaceable></arg>
979 <arg choice="req"><replaceable>storage-type</replaceable></arg>
980 <arg choice="req"><replaceable>volume-name</replaceable></arg>
984 Repairs a storage volume on a node. Only LVM volume groups can
985 be repaired at this time. They have the storage type
986 <quote>lvm-vg</quote>.
990 On LVM volume groups, <command>repair-storage</command> runs
991 <quote>vgreduce --removemissing</quote>.
996 Running this command can lead to data loss. Use it with care.
1001 The <option>--ignore-consistency</option> option will ignore
1002 any inconsistent disks (on the nodes paired with this
1003 one). Use of this option is most likely to lead to data-loss.
1009 # gnt-node repair-storage node5.example.com lvm-vg xenvg
1015 <title>POWERCYCLE</title>
1018 <command>powercycle</command>
1019 <arg><option>--yes</option></arg>
1020 <arg><option>--force</option></arg>
1021 <arg choice="req"><replaceable>node</replaceable></arg>
1025 This commands (tries to) forcefully reboot a node. It is a
1026 command that can be used if the node environemnt is broken,
1027 such that the admin can no longer login over ssh, but the
1028 Ganeti node daemon is still working.
1032 Note that this command is not guaranteed to work; it depends
1033 on the hypervisor how effective is the reboot attempt. For
1034 Linux, this command require that the kernel option
1035 <literal>CONFIG_MAGIC_SYSRQ</literal> is enabled.
1039 The <option>--yes</option> option can be used to skip
1040 confirmation, while the <option>--force</option> option is
1041 needed if the target node is the master node.
1050 <!-- Keep this comment at the end of the file
1055 sgml-minimize-attributes:nil
1056 sgml-always-quote-attributes:t
1059 sgml-parent-document:nil
1060 sgml-default-dtd-file:nil
1061 sgml-exposed-tags:nil
1062 sgml-local-catalogs:nil
1063 sgml-local-ecat-files:nil