Statistics
| Branch: | Tag: | Revision:

root / man / gnt-node.rst @ adec726e

History | View | Annotate | Download (22.1 kB)

1 7db441e6 Iustin Pop
gnt-node(8) Ganeti | Version @GANETI_VERSION@
2 7db441e6 Iustin Pop
=============================================
3 7db441e6 Iustin Pop
4 7db441e6 Iustin Pop
Name
5 7db441e6 Iustin Pop
----
6 7db441e6 Iustin Pop
7 7db441e6 Iustin Pop
gnt-node - Node administration
8 7db441e6 Iustin Pop
9 7db441e6 Iustin Pop
Synopsis
10 7db441e6 Iustin Pop
--------
11 7db441e6 Iustin Pop
12 7db441e6 Iustin Pop
**gnt-node** {command} [arguments...]
13 7db441e6 Iustin Pop
14 7db441e6 Iustin Pop
DESCRIPTION
15 7db441e6 Iustin Pop
-----------
16 7db441e6 Iustin Pop
17 7db441e6 Iustin Pop
The **gnt-node** is used for managing the (physical) nodes in the
18 7db441e6 Iustin Pop
Ganeti system.
19 7db441e6 Iustin Pop
20 7db441e6 Iustin Pop
COMMANDS
21 7db441e6 Iustin Pop
--------
22 7db441e6 Iustin Pop
23 7db441e6 Iustin Pop
ADD
24 7db441e6 Iustin Pop
~~~
25 7db441e6 Iustin Pop
26 f624fa95 Iustin Pop
| **add** [\--readd] [{-s|\--secondary-ip} *secondary\_ip*]
27 f624fa95 Iustin Pop
| [{-g|\--node-group} *nodegroup*]
28 f624fa95 Iustin Pop
| [\--master-capable=``yes|no``] [\--vm-capable=``yes|no``]
29 f624fa95 Iustin Pop
| [\--node-parameters *ndparams*]
30 f624fa95 Iustin Pop
| [\--disk-state *diskstate*]
31 f624fa95 Iustin Pop
| [\--hypervisor-state *hvstate*]
32 4e37f591 René Nussbaumer
| {*nodename*}
33 7db441e6 Iustin Pop
34 7db441e6 Iustin Pop
Adds the given node to the cluster.
35 7db441e6 Iustin Pop
36 7db441e6 Iustin Pop
This command is used to join a new node to the cluster. You will
37 7db441e6 Iustin Pop
have to provide the password for root of the node to be able to add
38 7db441e6 Iustin Pop
the node in the cluster. The command needs to be run on the Ganeti
39 7db441e6 Iustin Pop
master.
40 7db441e6 Iustin Pop
41 7db441e6 Iustin Pop
Note that the command is potentially destructive, as it will
42 7699ab7b Sebastian Gebhard
forcibly join the specified host to the cluster, not paying attention
43 7db441e6 Iustin Pop
to its current status (it could be already in a cluster, etc.)
44 7db441e6 Iustin Pop
45 0a68e0ff Iustin Pop
The ``-s (--secondary-ip)`` is used in dual-home clusters and
46 0a68e0ff Iustin Pop
specifies the new node's IP in the secondary network. See the
47 354c4f62 Michael Hanselmann
discussion in **gnt-cluster**\(8) for more information.
48 7db441e6 Iustin Pop
49 7db441e6 Iustin Pop
In case you're readding a node after hardware failure, you can use
50 7db441e6 Iustin Pop
the ``--readd`` parameter. In this case, you don't need to pass the
51 7699ab7b Sebastian Gebhard
secondary IP again, it will be reused from the cluster. Also, the
52 7db441e6 Iustin Pop
drained and offline flags of the node will be cleared before
53 7db441e6 Iustin Pop
re-adding it.
54 7db441e6 Iustin Pop
55 0a68e0ff Iustin Pop
The ``-g (--node-group)`` option is used to add the new node into a
56 0a68e0ff Iustin Pop
specific node group, specified by UUID or name. If only one node group
57 0a68e0ff Iustin Pop
exists you can skip this option, otherwise it's mandatory.
58 7db441e6 Iustin Pop
59 085e0d9f René Nussbaumer
The ``vm_capable``, ``master_capable``, ``ndparams``, ``diskstate`` and
60 354c4f62 Michael Hanselmann
``hvstate`` options are described in **ganeti**\(7), and are used to set
61 085e0d9f René Nussbaumer
the properties of the new node.
62 7db441e6 Iustin Pop
63 729ed537 Bernardo Dal Seno
The command performs some operations that change the state of the master
64 729ed537 Bernardo Dal Seno
and the new node, like copying certificates and starting the node daemon
65 729ed537 Bernardo Dal Seno
on the new node, or updating ``/etc/hosts`` on the master node.  If the
66 729ed537 Bernardo Dal Seno
command fails at a later stage, it doesn't undo such changes.  This
67 729ed537 Bernardo Dal Seno
should not be a problem, as a successful run of ``gnt-node add`` will
68 729ed537 Bernardo Dal Seno
bring everything back in sync.
69 729ed537 Bernardo Dal Seno
70 d5fe5fa9 Michael Hanselmann
If the node was previously part of another cluster and still has daemons
71 d5fe5fa9 Michael Hanselmann
running, the ``node-cleanup`` tool can be run on the machine to be added
72 d5fe5fa9 Michael Hanselmann
to clean remains of the previous cluster from the node.
73 d5fe5fa9 Michael Hanselmann
74 7db441e6 Iustin Pop
Example::
75 7db441e6 Iustin Pop
76 7db441e6 Iustin Pop
    # gnt-node add node5.example.com
77 7db441e6 Iustin Pop
    # gnt-node add -s 192.0.2.5 node5.example.com
78 7db441e6 Iustin Pop
    # gnt-node add -g group2 -s 192.0.2.9 node9.group2.example.com
79 7db441e6 Iustin Pop
80 7db441e6 Iustin Pop
81 7db441e6 Iustin Pop
EVACUATE
82 7db441e6 Iustin Pop
~~~~~~~~
83 7db441e6 Iustin Pop
84 d6cd74dd Klaus Aehlig
| **evacuate** [-f] [\--early-release] [\--submit] [\--print-job-id]
85 5ec23388 Iustin Pop
| [{-I|\--iallocator} *NAME* \| {-n|\--new-secondary} *destination\_node*]
86 5ec23388 Iustin Pop
| [{-p|\--primary-only} \| {-s|\--secondary-only} ]
87 5ec23388 Iustin Pop
|  {*node*}
88 7db441e6 Iustin Pop
89 aafee533 Michael Hanselmann
This command will move instances away from the given node. If
90 aafee533 Michael Hanselmann
``--primary-only`` is given, only primary instances are evacuated, with
91 aafee533 Michael Hanselmann
``--secondary-only`` only secondaries. If neither is given, all
92 aafee533 Michael Hanselmann
instances are evacuated. It works only for instances having a drbd disk
93 aafee533 Michael Hanselmann
template.
94 7db441e6 Iustin Pop
95 7db441e6 Iustin Pop
The new location for the instances can be specified in two ways:
96 7db441e6 Iustin Pop
97 0a68e0ff Iustin Pop
- as a single node for all instances, via the ``-n (--new-secondary)``
98 7db441e6 Iustin Pop
  option
99 7db441e6 Iustin Pop
100 0a68e0ff Iustin Pop
- or via the ``-I (--iallocator)`` option, giving a script name as
101 1a770ce5 Bernardo Dal Seno
  parameter (or ``.`` to use the default allocator), so each instance
102 1a770ce5 Bernardo Dal Seno
  will be in turn placed on the (per the script) optimal node
103 7db441e6 Iustin Pop
104 7db441e6 Iustin Pop
The ``--early-release`` changes the code so that the old storage on
105 7db441e6 Iustin Pop
node being evacuated is removed early (before the resync is
106 7db441e6 Iustin Pop
completed) and the internal Ganeti locks are also released for both
107 7db441e6 Iustin Pop
the current secondary and the new secondary, thus allowing more
108 7db441e6 Iustin Pop
parallelism in the cluster operation. This should be used only when
109 7db441e6 Iustin Pop
recovering from a disk failure on the current secondary (thus the
110 7db441e6 Iustin Pop
old storage is already broken) or when the storage on the primary
111 7db441e6 Iustin Pop
node is known to be fine (thus we won't need the old storage for
112 7db441e6 Iustin Pop
potential recovery).
113 7db441e6 Iustin Pop
114 78623223 Iustin Pop
Note that this command is equivalent to using per-instance commands for
115 78623223 Iustin Pop
each affected instance individually:
116 78623223 Iustin Pop
117 3abb0a5c Leon Handreke
- ``--primary-only`` is equivalent to performing ``gnt-instance
118 3abb0a5c Leon Handreke
  migrate`` for every primary instance running on the node that can be
119 3abb0a5c Leon Handreke
  migrated and ``gnt-instance failover`` for every primary instance that
120 3abb0a5c Leon Handreke
  cannot be migrated.
121 78623223 Iustin Pop
- ``--secondary-only`` is equivalent to ``gnt-instance replace-disks``
122 3abb0a5c Leon Handreke
  in secondary node change mode (``--new-secondary``) for every DRBD
123 3abb0a5c Leon Handreke
  instance that the node is a secondary for.
124 78623223 Iustin Pop
- when neither of the above is done a combination of the two cases is run
125 78623223 Iustin Pop
126 708f8301 Helga Velroyen
Note that the iallocator currently only considers disk information of
127 708f8301 Helga Velroyen
the default disk template, even if the instance's disk templates differ
128 708f8301 Helga Velroyen
from that.
129 708f8301 Helga Velroyen
130 354c4f62 Michael Hanselmann
See **ganeti**\(7) for a description of ``--submit`` and other common
131 c5a66db3 Michael Hanselmann
options.
132 c5a66db3 Michael Hanselmann
133 7db441e6 Iustin Pop
Example::
134 7db441e6 Iustin Pop
135 0a68e0ff Iustin Pop
    # gnt-node evacuate -I hail node3.example.com
136 7db441e6 Iustin Pop
137 65914847 Klaus Aehlig
Note that, due to an issue with the iallocator interface, evacuation of
138 65914847 Klaus Aehlig
all instances at once is not yet implemented. Full evacuation can
139 65914847 Klaus Aehlig
currently be achieved by sequentially evacuating primaries and
140 65914847 Klaus Aehlig
secondaries.
141 65914847 Klaus Aehlig
::
142 65914847 Klaus Aehlig
143 65914847 Klaus Aehlig
    # gnt-node evacuate -p node3.example.com
144 65914847 Klaus Aehlig
    # gnt-node evacuate -s node3.example.com
145 65914847 Klaus Aehlig
146 7db441e6 Iustin Pop
147 7db441e6 Iustin Pop
FAILOVER
148 7db441e6 Iustin Pop
~~~~~~~~
149 7db441e6 Iustin Pop
150 f624fa95 Iustin Pop
**failover** [-f] [\--ignore-consistency] {*node*}
151 7db441e6 Iustin Pop
152 7db441e6 Iustin Pop
This command will fail over all instances having the given node as
153 7db441e6 Iustin Pop
primary to their secondary nodes. This works only for instances having
154 7db441e6 Iustin Pop
a drbd disk template.
155 7db441e6 Iustin Pop
156 7db441e6 Iustin Pop
Normally the failover will check the consistency of the disks before
157 7db441e6 Iustin Pop
failing over the instance. If you are trying to migrate instances off
158 7db441e6 Iustin Pop
a dead node, this will fail. Use the ``--ignore-consistency`` option
159 7db441e6 Iustin Pop
for this purpose.
160 7db441e6 Iustin Pop
161 7db441e6 Iustin Pop
Example::
162 7db441e6 Iustin Pop
163 7db441e6 Iustin Pop
    # gnt-node failover node1.example.com
164 7db441e6 Iustin Pop
165 7db441e6 Iustin Pop
166 7db441e6 Iustin Pop
INFO
167 7db441e6 Iustin Pop
~~~~
168 7db441e6 Iustin Pop
169 7db441e6 Iustin Pop
**info** [*node*...]
170 7db441e6 Iustin Pop
171 7db441e6 Iustin Pop
Show detailed information about the nodes in the cluster. If you
172 7db441e6 Iustin Pop
don't give any arguments, all nodes will be shows, otherwise the
173 7db441e6 Iustin Pop
output will be restricted to the given names.
174 7db441e6 Iustin Pop
175 7db441e6 Iustin Pop
LIST
176 7db441e6 Iustin Pop
~~~~
177 7db441e6 Iustin Pop
178 7f5443a0 Michael Hanselmann
| **list**
179 f624fa95 Iustin Pop
| [\--no-headers] [\--separator=*SEPARATOR*]
180 f624fa95 Iustin Pop
| [\--units=*UNITS*] [-v] [{-o|\--output} *[+]FIELD,...*]
181 f624fa95 Iustin Pop
| [\--filter]
182 7db441e6 Iustin Pop
| [node...]
183 7db441e6 Iustin Pop
184 7db441e6 Iustin Pop
Lists the nodes in the cluster.
185 7db441e6 Iustin Pop
186 7db441e6 Iustin Pop
The ``--no-headers`` option will skip the initial header line. The
187 7db441e6 Iustin Pop
``--separator`` option takes an argument which denotes what will be
188 7db441e6 Iustin Pop
used between the output fields. Both these options are to help
189 7db441e6 Iustin Pop
scripting.
190 7db441e6 Iustin Pop
191 7db441e6 Iustin Pop
The units used to display the numeric values in the output varies,
192 7db441e6 Iustin Pop
depending on the options given. By default, the values will be
193 7db441e6 Iustin Pop
formatted in the most appropriate unit. If the ``--separator``
194 7db441e6 Iustin Pop
option is given, then the values are shown in mebibytes to allow
195 7db441e6 Iustin Pop
parsing by scripts. In both cases, the ``--units`` option can be
196 7db441e6 Iustin Pop
used to enforce a given output unit.
197 7db441e6 Iustin Pop
198 7f5443a0 Michael Hanselmann
Queries of nodes will be done in parallel with any running jobs. This might
199 7f5443a0 Michael Hanselmann
give inconsistent results for the free disk/memory.
200 7db441e6 Iustin Pop
201 f0b1bafe Iustin Pop
The ``-v`` option activates verbose mode, which changes the display of
202 354c4f62 Michael Hanselmann
special field states (see **ganeti**\(7)).
203 f0b1bafe Iustin Pop
204 0a68e0ff Iustin Pop
The ``-o (--output)`` option takes a comma-separated list of output
205 0a68e0ff Iustin Pop
fields. The available fields and their meaning are:
206 7db441e6 Iustin Pop
207 fcdb582d Michael Hanselmann
@QUERY_FIELDS_NODE@
208 7db441e6 Iustin Pop
209 7db441e6 Iustin Pop
If the value of the option starts with the character ``+``, the new
210 f7b769b1 Iustin Pop
fields will be added to the default list. This allows one to quickly
211 7db441e6 Iustin Pop
see the default list plus a few other fields, instead of retyping
212 7db441e6 Iustin Pop
the entire list of fields.
213 7db441e6 Iustin Pop
214 2afd577f Michael Hanselmann
Note that some of these fields are known from the configuration of the
215 2afd577f Michael Hanselmann
cluster (e.g. ``name``, ``pinst``, ``sinst``, ``pip``, ``sip``) and thus
216 2afd577f Michael Hanselmann
the master does not need to contact the node for this data (making the
217 2afd577f Michael Hanselmann
listing fast if only fields from this set are selected), whereas the
218 2afd577f Michael Hanselmann
other fields are "live" fields and require a query to the cluster nodes.
219 2afd577f Michael Hanselmann
220 2afd577f Michael Hanselmann
Depending on the virtualization type and implementation details, the
221 50c1e351 Bernardo Dal Seno
``mtotal``, ``mnode`` and ``mfree`` fields may have slightly varying
222 2afd577f Michael Hanselmann
meanings. For example, some solutions share the node memory with the
223 2afd577f Michael Hanselmann
pool of memory used for instances (KVM), whereas others have separate
224 7db441e6 Iustin Pop
memory for the node and for the instances (Xen).
225 7db441e6 Iustin Pop
226 4febd988 Helga Velroyen
Note that the field 'dtotal' and 'dfree' refer to the storage type
227 4febd988 Helga Velroyen
that is defined by the default disk template. The default disk template
228 4febd988 Helga Velroyen
is the first on in the list of cluster-wide enabled disk templates and
229 4febd988 Helga Velroyen
can be set with ``gnt-cluster modify``. Currently, only the disk
230 4febd988 Helga Velroyen
templates 'plain', 'drbd', 'file', and 'sharedfile' support storage
231 4febd988 Helga Velroyen
reporting, for all others '0' is displayed.
232 4febd988 Helga Velroyen
233 2afd577f Michael Hanselmann
If exactly one argument is given and it appears to be a query filter
234 354c4f62 Michael Hanselmann
(see **ganeti**\(7)), the query result is filtered accordingly. For
235 2afd577f Michael Hanselmann
ambiguous cases (e.g. a single field name as a filter) the ``--filter``
236 2afd577f Michael Hanselmann
(``-F``) option forces the argument to be treated as a filter (e.g.
237 2afd577f Michael Hanselmann
``gnt-node list -F master_candidate``).
238 2afd577f Michael Hanselmann
239 7db441e6 Iustin Pop
If no node names are given, then all nodes are queried. Otherwise,
240 7db441e6 Iustin Pop
only the given nodes will be listed.
241 7db441e6 Iustin Pop
242 7f5443a0 Michael Hanselmann
243 7acbda7b Iustin Pop
LIST-DRBD
244 7acbda7b Iustin Pop
~~~~~~~~~
245 7acbda7b Iustin Pop
246 7acbda7b Iustin Pop
**list-drbd** [\--no-headers] [\--separator=*SEPARATOR*] node
247 7acbda7b Iustin Pop
248 7acbda7b Iustin Pop
Lists the mapping of DRBD minors for a given node. This outputs a static
249 7acbda7b Iustin Pop
list of fields (it doesn't accept the ``--output`` option), as follows:
250 7acbda7b Iustin Pop
251 7acbda7b Iustin Pop
``Node``
252 7acbda7b Iustin Pop
  The (full) name of the node we are querying
253 7acbda7b Iustin Pop
``Minor``
254 7acbda7b Iustin Pop
  The DRBD minor
255 7acbda7b Iustin Pop
``Instance``
256 7acbda7b Iustin Pop
  The instance the DRBD minor belongs to
257 7acbda7b Iustin Pop
``Disk``
258 7acbda7b Iustin Pop
  The disk index that the DRBD minor belongs to
259 7acbda7b Iustin Pop
``Role``
260 7acbda7b Iustin Pop
  Either ``primary`` or ``secondary``, denoting the role of the node for
261 7acbda7b Iustin Pop
  the instance (note: this is not the live status of the DRBD device,
262 7acbda7b Iustin Pop
  but the configuration value)
263 7acbda7b Iustin Pop
``PeerNode``
264 7acbda7b Iustin Pop
  The node that the minor is connected to on the other end
265 7acbda7b Iustin Pop
266 7acbda7b Iustin Pop
This command can be used as a reverse lookup (from node and minor) to a
267 7acbda7b Iustin Pop
given instance, which can be useful when debugging DRBD issues.
268 7acbda7b Iustin Pop
269 354c4f62 Michael Hanselmann
Note that this command queries Ganeti via **ganeti-confd**\(8), so
270 7acbda7b Iustin Pop
it won't be available if support for ``confd`` has not been enabled at
271 7acbda7b Iustin Pop
build time; furthermore, in Ganeti 2.6 this is only available via the
272 7acbda7b Iustin Pop
Haskell version of confd (again selected at build time).
273 7acbda7b Iustin Pop
274 7f5443a0 Michael Hanselmann
LIST-FIELDS
275 7f5443a0 Michael Hanselmann
~~~~~~~~~~~
276 7f5443a0 Michael Hanselmann
277 7f5443a0 Michael Hanselmann
**list-fields** [field...]
278 7f5443a0 Michael Hanselmann
279 7f5443a0 Michael Hanselmann
Lists available fields for nodes.
280 7f5443a0 Michael Hanselmann
281 7f5443a0 Michael Hanselmann
282 7db441e6 Iustin Pop
MIGRATE
283 7db441e6 Iustin Pop
~~~~~~~
284 7db441e6 Iustin Pop
285 c5a66db3 Michael Hanselmann
| **migrate** [-f] [\--non-live] [\--migration-mode=live\|non-live]
286 d6cd74dd Klaus Aehlig
| [\--ignore-ipolicy] [\--submit] [\--print-job-id] {*node*}
287 7db441e6 Iustin Pop
288 7db441e6 Iustin Pop
This command will migrate all instances having the given node as
289 7db441e6 Iustin Pop
primary to their secondary nodes. This works only for instances
290 7db441e6 Iustin Pop
having a drbd disk template.
291 7db441e6 Iustin Pop
292 7db441e6 Iustin Pop
As for the **gnt-instance migrate** command, the options
293 8c0b16f6 Guido Trotter
``--no-live``, ``--migration-mode`` and ``--no-runtime-changes``
294 8c0b16f6 Guido Trotter
can be given to influence the migration type.
295 7db441e6 Iustin Pop
296 50c1e351 Bernardo Dal Seno
If ``--ignore-ipolicy`` is given any instance policy violations
297 50c1e351 Bernardo Dal Seno
occurring during this operation are ignored.
298 9fa567b3 René Nussbaumer
299 354c4f62 Michael Hanselmann
See **ganeti**\(7) for a description of ``--submit`` and other common
300 c5a66db3 Michael Hanselmann
options.
301 c5a66db3 Michael Hanselmann
302 7db441e6 Iustin Pop
Example::
303 7db441e6 Iustin Pop
304 7db441e6 Iustin Pop
    # gnt-node migrate node1.example.com
305 7db441e6 Iustin Pop
306 7db441e6 Iustin Pop
307 7db441e6 Iustin Pop
MODIFY
308 7db441e6 Iustin Pop
~~~~~~
309 7db441e6 Iustin Pop
310 d6cd74dd Klaus Aehlig
| **modify** [-f] [\--submit] [\--print-job-id]
311 f624fa95 Iustin Pop
| [{-C|\--master-candidate} ``yes|no``]
312 f624fa95 Iustin Pop
| [{-D|\--drained} ``yes|no``] [{-O|\--offline} ``yes|no``]
313 f624fa95 Iustin Pop
| [\--master-capable=``yes|no``] [\--vm-capable=``yes|no``] [\--auto-promote]
314 f624fa95 Iustin Pop
| [{-s|\--secondary-ip} *secondary_ip*]
315 f624fa95 Iustin Pop
| [\--node-parameters *ndparams*]
316 f624fa95 Iustin Pop
| [\--node-powered=``yes|no``]
317 f624fa95 Iustin Pop
| [\--hypervisor-state *hvstate*]
318 f624fa95 Iustin Pop
| [\--disk-state *diskstate*]
319 7db441e6 Iustin Pop
| {*node*}
320 7db441e6 Iustin Pop
321 7db441e6 Iustin Pop
This command changes the role of the node. Each options takes
322 7db441e6 Iustin Pop
either a literal yes or no, and only one option should be given as
323 7db441e6 Iustin Pop
yes. The meaning of the roles and flags are described in the
324 354c4f62 Michael Hanselmann
manpage **ganeti**\(7).
325 7db441e6 Iustin Pop
326 0a68e0ff Iustin Pop
The option ``--node-powered`` can be used to modify state-of-record if
327 0a68e0ff Iustin Pop
it doesn't reflect the reality anymore.
328 dd94e9f6 René Nussbaumer
329 7db441e6 Iustin Pop
In case a node is demoted from the master candidate role, the
330 7db441e6 Iustin Pop
operation will be refused unless you pass the ``--auto-promote``
331 7db441e6 Iustin Pop
option. This option will cause the operation to lock all cluster nodes
332 7db441e6 Iustin Pop
(thus it will not be able to run in parallel with most other jobs),
333 7db441e6 Iustin Pop
but it allows automated maintenance of the cluster candidate pool. If
334 7db441e6 Iustin Pop
locking all cluster node is too expensive, another option is to
335 7db441e6 Iustin Pop
promote manually another node to master candidate before demoting the
336 7db441e6 Iustin Pop
current one.
337 7db441e6 Iustin Pop
338 7db441e6 Iustin Pop
Example (setting a node offline, which will demote it from master
339 7db441e6 Iustin Pop
candidate role if is in that role)::
340 7db441e6 Iustin Pop
341 7db441e6 Iustin Pop
    # gnt-node modify --offline=yes node1.example.com
342 7db441e6 Iustin Pop
343 0a68e0ff Iustin Pop
The ``-s (--secondary-ip)`` option can be used to change the node's
344 0a68e0ff Iustin Pop
secondary ip. No drbd instances can be running on the node, while this
345 79829d23 Guido Trotter
operation is taking place. Remember that the secondary ip must be
346 79829d23 Guido Trotter
reachable from the master secondary ip, when being changed, so be sure
347 79829d23 Guido Trotter
that the node has the new IP already configured and active. In order to
348 79829d23 Guido Trotter
convert a cluster from single homed to multi-homed or vice versa
349 79829d23 Guido Trotter
``--force`` is needed as well, and the target node for the first change
350 79829d23 Guido Trotter
must be the master.
351 7db441e6 Iustin Pop
352 354c4f62 Michael Hanselmann
See **ganeti**\(7) for a description of ``--submit`` and other common
353 13ddcb50 Michael Hanselmann
options.
354 13ddcb50 Michael Hanselmann
355 7db441e6 Iustin Pop
Example (setting the node back to online and master candidate)::
356 7db441e6 Iustin Pop
357 7db441e6 Iustin Pop
    # gnt-node modify --offline=no --master-candidate=yes node1.example.com
358 7db441e6 Iustin Pop
359 7db441e6 Iustin Pop
360 7db441e6 Iustin Pop
REMOVE
361 7db441e6 Iustin Pop
~~~~~~
362 7db441e6 Iustin Pop
363 7db441e6 Iustin Pop
**remove** {*nodename*}
364 7db441e6 Iustin Pop
365 7db441e6 Iustin Pop
Removes a node from the cluster. Instances must be removed or
366 7db441e6 Iustin Pop
migrated to another cluster before.
367 7db441e6 Iustin Pop
368 7db441e6 Iustin Pop
Example::
369 7db441e6 Iustin Pop
370 7db441e6 Iustin Pop
    # gnt-node remove node5.example.com
371 7db441e6 Iustin Pop
372 7db441e6 Iustin Pop
373 7db441e6 Iustin Pop
VOLUMES
374 7db441e6 Iustin Pop
~~~~~~~
375 7db441e6 Iustin Pop
376 f624fa95 Iustin Pop
| **volumes** [\--no-headers] [\--human-readable]
377 f624fa95 Iustin Pop
| [\--separator=*SEPARATOR*] [{-o|\--output} *FIELDS*]
378 7db441e6 Iustin Pop
| [*node*...]
379 7db441e6 Iustin Pop
380 7db441e6 Iustin Pop
Lists all logical volumes and their physical disks from the node(s)
381 7db441e6 Iustin Pop
provided.
382 7db441e6 Iustin Pop
383 7db441e6 Iustin Pop
The ``--no-headers`` option will skip the initial header line. The
384 7db441e6 Iustin Pop
``--separator`` option takes an argument which denotes what will be
385 7db441e6 Iustin Pop
used between the output fields. Both these options are to help
386 7db441e6 Iustin Pop
scripting.
387 7db441e6 Iustin Pop
388 7db441e6 Iustin Pop
The units used to display the numeric values in the output varies,
389 7db441e6 Iustin Pop
depending on the options given. By default, the values will be
390 7db441e6 Iustin Pop
formatted in the most appropriate unit. If the ``--separator``
391 7db441e6 Iustin Pop
option is given, then the values are shown in mebibytes to allow
392 7db441e6 Iustin Pop
parsing by scripts. In both cases, the ``--units`` option can be
393 7db441e6 Iustin Pop
used to enforce a given output unit.
394 7db441e6 Iustin Pop
395 0a68e0ff Iustin Pop
The ``-o (--output)`` option takes a comma-separated list of output
396 0a68e0ff Iustin Pop
fields. The available fields and their meaning are:
397 7db441e6 Iustin Pop
398 7db441e6 Iustin Pop
node
399 7db441e6 Iustin Pop
    the node name on which the volume exists
400 7db441e6 Iustin Pop
401 7db441e6 Iustin Pop
phys
402 7db441e6 Iustin Pop
    the physical drive (on which the LVM physical volume lives)
403 7db441e6 Iustin Pop
404 7db441e6 Iustin Pop
vg
405 7db441e6 Iustin Pop
    the volume group name
406 7db441e6 Iustin Pop
407 7db441e6 Iustin Pop
name
408 7db441e6 Iustin Pop
    the logical volume name
409 7db441e6 Iustin Pop
410 7db441e6 Iustin Pop
size
411 7db441e6 Iustin Pop
    the logical volume size
412 7db441e6 Iustin Pop
413 7db441e6 Iustin Pop
instance
414 7db441e6 Iustin Pop
    The name of the instance to which this volume belongs, or (in case
415 7db441e6 Iustin Pop
    it's an orphan volume) the character "-"
416 7db441e6 Iustin Pop
417 7db441e6 Iustin Pop
418 7db441e6 Iustin Pop
Example::
419 7db441e6 Iustin Pop
420 7db441e6 Iustin Pop
    # gnt-node volumes node5.example.com
421 7db441e6 Iustin Pop
    Node              PhysDev   VG    Name                                 Size Instance
422 7db441e6 Iustin Pop
    node1.example.com /dev/hdc1 xenvg instance1.example.com-sda_11000.meta 128  instance1.example.com
423 7db441e6 Iustin Pop
    node1.example.com /dev/hdc1 xenvg instance1.example.com-sda_11001.data 256  instance1.example.com
424 7db441e6 Iustin Pop
425 7db441e6 Iustin Pop
426 7db441e6 Iustin Pop
LIST-STORAGE
427 7db441e6 Iustin Pop
~~~~~~~~~~~~
428 7db441e6 Iustin Pop
429 f624fa95 Iustin Pop
| **list-storage** [\--no-headers] [\--human-readable]
430 f624fa95 Iustin Pop
| [\--separator=*SEPARATOR*] [\--storage-type=*STORAGE\_TYPE*]
431 f624fa95 Iustin Pop
| [{-o|\--output} *FIELDS*]
432 7db441e6 Iustin Pop
| [*node*...]
433 7db441e6 Iustin Pop
434 7db441e6 Iustin Pop
Lists the available storage units and their details for the given
435 7db441e6 Iustin Pop
node(s).
436 7db441e6 Iustin Pop
437 7db441e6 Iustin Pop
The ``--no-headers`` option will skip the initial header line. The
438 7db441e6 Iustin Pop
``--separator`` option takes an argument which denotes what will be
439 7db441e6 Iustin Pop
used between the output fields. Both these options are to help
440 7db441e6 Iustin Pop
scripting.
441 7db441e6 Iustin Pop
442 7db441e6 Iustin Pop
The units used to display the numeric values in the output varies,
443 7db441e6 Iustin Pop
depending on the options given. By default, the values will be
444 7db441e6 Iustin Pop
formatted in the most appropriate unit. If the ``--separator``
445 7db441e6 Iustin Pop
option is given, then the values are shown in mebibytes to allow
446 7db441e6 Iustin Pop
parsing by scripts. In both cases, the ``--units`` option can be
447 7db441e6 Iustin Pop
used to enforce a given output unit.
448 7db441e6 Iustin Pop
449 7db441e6 Iustin Pop
The ``--storage-type`` option can be used to choose a storage unit
450 7db441e6 Iustin Pop
type. Possible choices are lvm-pv, lvm-vg or file.
451 7db441e6 Iustin Pop
452 0a68e0ff Iustin Pop
The ``-o (--output)`` option takes a comma-separated list of output
453 0a68e0ff Iustin Pop
fields. The available fields and their meaning are:
454 7db441e6 Iustin Pop
455 7db441e6 Iustin Pop
node
456 7db441e6 Iustin Pop
    the node name on which the volume exists
457 7db441e6 Iustin Pop
458 7db441e6 Iustin Pop
type
459 7db441e6 Iustin Pop
    the type of the storage unit (currently just what is passed in via
460 7db441e6 Iustin Pop
    ``--storage-type``)
461 7db441e6 Iustin Pop
462 7db441e6 Iustin Pop
name
463 7db441e6 Iustin Pop
    the path/identifier of the storage unit
464 7db441e6 Iustin Pop
465 7db441e6 Iustin Pop
size
466 7db441e6 Iustin Pop
    total size of the unit; for the file type see a note below
467 7db441e6 Iustin Pop
468 7db441e6 Iustin Pop
used
469 7db441e6 Iustin Pop
    used space in the unit; for the file type see a note below
470 7db441e6 Iustin Pop
471 7db441e6 Iustin Pop
free
472 7db441e6 Iustin Pop
    available disk space
473 7db441e6 Iustin Pop
474 7db441e6 Iustin Pop
allocatable
475 7db441e6 Iustin Pop
    whether we the unit is available for allocation (only lvm-pv can
476 7db441e6 Iustin Pop
    change this setting, the other types always report true)
477 7db441e6 Iustin Pop
478 7db441e6 Iustin Pop
479 7db441e6 Iustin Pop
Note that for the "file" type, the total disk space might not equal
480 7db441e6 Iustin Pop
to the sum of used and free, due to the method Ganeti uses to
481 7db441e6 Iustin Pop
compute each of them. The total and free values are computed as the
482 7db441e6 Iustin Pop
total and free space values for the filesystem to which the
483 7db441e6 Iustin Pop
directory belongs, but the used space is computed from the used
484 7db441e6 Iustin Pop
space under that directory *only*, which might not be necessarily
485 7db441e6 Iustin Pop
the root of the filesystem, and as such there could be files
486 7db441e6 Iustin Pop
outside the file storage directory using disk space and causing a
487 7db441e6 Iustin Pop
mismatch in the values.
488 7db441e6 Iustin Pop
489 7db441e6 Iustin Pop
Example::
490 7db441e6 Iustin Pop
491 7db441e6 Iustin Pop
    node1# gnt-node list-storage node2
492 7db441e6 Iustin Pop
    Node  Type   Name        Size Used   Free Allocatable
493 7db441e6 Iustin Pop
    node2 lvm-pv /dev/sda7 673.8G 1.5G 672.3G Y
494 7db441e6 Iustin Pop
    node2 lvm-pv /dev/sdb1 698.6G   0M 698.6G Y
495 7db441e6 Iustin Pop
496 7db441e6 Iustin Pop
497 7db441e6 Iustin Pop
MODIFY-STORAGE
498 7db441e6 Iustin Pop
~~~~~~~~~~~~~~
499 7db441e6 Iustin Pop
500 d6cd74dd Klaus Aehlig
| **modify-storage** [\--allocatable={yes|no}] [\--submit] [\--print-job-id]
501 c5a66db3 Michael Hanselmann
| {*node*} {*storage-type*} {*volume-name*}
502 7db441e6 Iustin Pop
503 7db441e6 Iustin Pop
Modifies storage volumes on a node. Only LVM physical volumes can
504 7db441e6 Iustin Pop
be modified at the moment. They have a storage type of "lvm-pv".
505 7db441e6 Iustin Pop
506 7db441e6 Iustin Pop
Example::
507 7db441e6 Iustin Pop
508 7db441e6 Iustin Pop
    # gnt-node modify-storage --allocatable no node5.example.com lvm-pv /dev/sdb1
509 7db441e6 Iustin Pop
510 7db441e6 Iustin Pop
511 7db441e6 Iustin Pop
REPAIR-STORAGE
512 7db441e6 Iustin Pop
~~~~~~~~~~~~~~
513 7db441e6 Iustin Pop
514 c5a66db3 Michael Hanselmann
| **repair-storage** [\--ignore-consistency] ]\--submit]
515 c5a66db3 Michael Hanselmann
| {*node*} {*storage-type*} {*volume-name*}
516 7db441e6 Iustin Pop
517 7db441e6 Iustin Pop
Repairs a storage volume on a node. Only LVM volume groups can be
518 7db441e6 Iustin Pop
repaired at this time. They have the storage type "lvm-vg".
519 7db441e6 Iustin Pop
520 f624fa95 Iustin Pop
On LVM volume groups, **repair-storage** runs ``vgreduce
521 f624fa95 Iustin Pop
--removemissing``.
522 7db441e6 Iustin Pop
523 7db441e6 Iustin Pop
524 7db441e6 Iustin Pop
525 7db441e6 Iustin Pop
**Caution:** Running this command can lead to data loss. Use it with
526 7db441e6 Iustin Pop
care.
527 7db441e6 Iustin Pop
528 7db441e6 Iustin Pop
The ``--ignore-consistency`` option will ignore any inconsistent
529 7db441e6 Iustin Pop
disks (on the nodes paired with this one). Use of this option is
530 7db441e6 Iustin Pop
most likely to lead to data-loss.
531 7db441e6 Iustin Pop
532 7db441e6 Iustin Pop
Example::
533 7db441e6 Iustin Pop
534 7db441e6 Iustin Pop
    # gnt-node repair-storage node5.example.com lvm-vg xenvg
535 7db441e6 Iustin Pop
536 7db441e6 Iustin Pop
537 7db441e6 Iustin Pop
POWERCYCLE
538 7db441e6 Iustin Pop
~~~~~~~~~~
539 7db441e6 Iustin Pop
540 d6cd74dd Klaus Aehlig
**powercycle** [\--yes] [\--force] [\--submit] [\--print-job-id] {*node*}
541 7db441e6 Iustin Pop
542 71ed8d22 René Nussbaumer
This command (tries to) forcefully reboot a node. It is a command
543 9f2c2103 Michael Hanselmann
that can be used if the node environment is broken, such that the
544 9f2c2103 Michael Hanselmann
admin can no longer login over SSH, but the Ganeti node daemon is
545 7db441e6 Iustin Pop
still working.
546 7db441e6 Iustin Pop
547 7db441e6 Iustin Pop
Note that this command is not guaranteed to work; it depends on the
548 7db441e6 Iustin Pop
hypervisor how effective is the reboot attempt. For Linux, this
549 9f2c2103 Michael Hanselmann
command requires the kernel option ``CONFIG_MAGIC_SYSRQ`` to be
550 7db441e6 Iustin Pop
enabled.
551 7db441e6 Iustin Pop
552 7db441e6 Iustin Pop
The ``--yes`` option can be used to skip confirmation, while the
553 7db441e6 Iustin Pop
``--force`` option is needed if the target node is the master
554 7db441e6 Iustin Pop
node.
555 abefdcff René Nussbaumer
556 354c4f62 Michael Hanselmann
See **ganeti**\(7) for a description of ``--submit`` and other common
557 c5a66db3 Michael Hanselmann
options.
558 c5a66db3 Michael Hanselmann
559 abefdcff René Nussbaumer
POWER
560 abefdcff René Nussbaumer
~~~~~
561 abefdcff René Nussbaumer
562 b497a636 René Nussbaumer
**power** [``--force``] [``--ignore-status``] [``--all``]
563 0a1fc31c René Nussbaumer
[``--power-delay``] on|off|cycle|status [*nodes*]
564 abefdcff René Nussbaumer
565 71ed8d22 René Nussbaumer
This command calls out to out-of-band management to change the power
566 abefdcff René Nussbaumer
state of given node. With ``status`` you get the power status as reported
567 50c1e351 Bernardo Dal Seno
by the out-of-band management script.
568 bee8c465 Iustin Pop
569 bee8c465 Iustin Pop
Note that this command will only work if the out-of-band functionality
570 bee8c465 Iustin Pop
is configured and enabled on the cluster. If this is not the case,
571 bee8c465 Iustin Pop
please use the **powercycle** command above.
572 b497a636 René Nussbaumer
573 0a1fc31c René Nussbaumer
Using ``--force`` you skip the confirmation to do the operation.
574 0a1fc31c René Nussbaumer
Currently this only has effect on ``off`` and ``cycle``. On those two
575 0a1fc31c René Nussbaumer
you can *not* operate on the master. However, the command will provide
576 0a1fc31c René Nussbaumer
you with the command to invoke to operate on the master nerver-mind.
577 0a1fc31c René Nussbaumer
This is considered harmful and Ganeti does not support the use of it.
578 b497a636 René Nussbaumer
579 0a1fc31c René Nussbaumer
Providing ``--ignore-status`` will ignore the offline=N state of a node
580 0a1fc31c René Nussbaumer
and continue with power off.
581 0a1fc31c René Nussbaumer
582 0a1fc31c René Nussbaumer
``--power-delay`` specifies the time in seconds (factions allowed)
583 0a1fc31c René Nussbaumer
waited between powering on the next node. This is by default 2 seconds
584 0a1fc31c René Nussbaumer
but can increased if needed with this option.
585 0a1fc31c René Nussbaumer
586 0a1fc31c René Nussbaumer
*nodes* are optional. If not provided it will call out for every node in
587 0a1fc31c René Nussbaumer
the cluster. Except for the ``off`` and ``cycle`` command where you've
588 0a1fc31c René Nussbaumer
to explicit use ``--all`` to select all.
589 b497a636 René Nussbaumer
590 a0724772 René Nussbaumer
591 a0724772 René Nussbaumer
HEALTH
592 a0724772 René Nussbaumer
~~~~~~
593 a0724772 René Nussbaumer
594 a0724772 René Nussbaumer
**health** [*nodes*]
595 a0724772 René Nussbaumer
596 71ed8d22 René Nussbaumer
This command calls out to out-of-band management to ask for the health status
597 a0724772 René Nussbaumer
of all or given nodes. The health contains the node name and then the items
598 a0724772 René Nussbaumer
element with their status in a ``item=status`` manner. Where ``item`` is script
599 a0724772 René Nussbaumer
specific and ``status`` can be one of ``OK``, ``WARNING``, ``CRITICAL`` or
600 a0724772 René Nussbaumer
``UNKNOWN``. Items with status ``WARNING`` or ``CRITICAL`` are logged and
601 a0724772 René Nussbaumer
annotated in the command line output.
602 9ff4f2c0 Michael Hanselmann
603 6d846d0e Michael Hanselmann
604 6d846d0e Michael Hanselmann
RESTRICTED-COMMAND
605 6d846d0e Michael Hanselmann
~~~~~~~~~~~~~~~~~~
606 6d846d0e Michael Hanselmann
607 67c15d8b Iustin Pop
| **restricted-command** [-M] [\--sync]
608 6d846d0e Michael Hanselmann
| { -g *group* *command* | *command* *nodes*... }
609 6d846d0e Michael Hanselmann
610 6d846d0e Michael Hanselmann
Executes a restricted command on the specified nodes. Restricted commands are
611 6d846d0e Michael Hanselmann
not arbitrary, but must reside in
612 878c42ae Michael Hanselmann
``@SYSCONFDIR@/ganeti/restricted-commands`` on a node, either as a regular
613 6d846d0e Michael Hanselmann
file or as a symlink. The directory must be owned by root and not be
614 6d846d0e Michael Hanselmann
world- or group-writable. If a command fails verification or otherwise
615 6d846d0e Michael Hanselmann
fails to start, the node daemon log must be consulted for more detailed
616 6d846d0e Michael Hanselmann
information.
617 6d846d0e Michael Hanselmann
618 6d846d0e Michael Hanselmann
Example for running a command on two nodes::
619 6d846d0e Michael Hanselmann
620 6d846d0e Michael Hanselmann
    # gnt-node restricted-command mycommand \
621 6d846d0e Michael Hanselmann
      node1.example.com node2.example.com
622 6d846d0e Michael Hanselmann
623 6d846d0e Michael Hanselmann
The ``-g`` option can be used to run a command only on a specific node
624 6d846d0e Michael Hanselmann
group, e.g.::
625 6d846d0e Michael Hanselmann
626 6d846d0e Michael Hanselmann
    # gnt-node restricted-command -g default mycommand
627 6d846d0e Michael Hanselmann
628 6d846d0e Michael Hanselmann
The ``-M`` option can be used to prepend the node name to all command
629 6d846d0e Michael Hanselmann
output lines. ``--sync`` forces the opcode to acquire the node lock(s)
630 6d846d0e Michael Hanselmann
in exclusive mode.
631 6d846d0e Michael Hanselmann
632 7322bf7b Iustin Pop
Tags
633 7322bf7b Iustin Pop
~~~~
634 7322bf7b Iustin Pop
635 7322bf7b Iustin Pop
ADD-TAGS
636 7322bf7b Iustin Pop
^^^^^^^^
637 7322bf7b Iustin Pop
638 7322bf7b Iustin Pop
**add-tags** [\--from *file*] {*nodename*} {*tag*...}
639 7322bf7b Iustin Pop
640 7322bf7b Iustin Pop
Add tags to the given node. If any of the tags contains invalid
641 7322bf7b Iustin Pop
characters, the entire operation will abort.
642 7322bf7b Iustin Pop
643 7322bf7b Iustin Pop
If the ``--from`` option is given, the list of tags will be
644 7322bf7b Iustin Pop
extended with the contents of that file (each line becomes a tag).
645 7322bf7b Iustin Pop
In this case, there is not need to pass tags on the command line
646 7322bf7b Iustin Pop
(if you do, both sources will be used). A file name of - will be
647 7322bf7b Iustin Pop
interpreted as stdin.
648 7322bf7b Iustin Pop
649 7322bf7b Iustin Pop
LIST-TAGS
650 7322bf7b Iustin Pop
^^^^^^^^^
651 7322bf7b Iustin Pop
652 7322bf7b Iustin Pop
**list-tags** {*nodename*}
653 7322bf7b Iustin Pop
654 7322bf7b Iustin Pop
List the tags of the given node.
655 7322bf7b Iustin Pop
656 7322bf7b Iustin Pop
REMOVE-TAGS
657 7322bf7b Iustin Pop
^^^^^^^^^^^
658 7322bf7b Iustin Pop
659 7322bf7b Iustin Pop
**remove-tags** [\--from *file*] {*nodename*} {*tag*...}
660 7322bf7b Iustin Pop
661 7322bf7b Iustin Pop
Remove tags from the given node. If any of the tags are not
662 7322bf7b Iustin Pop
existing on the node, the entire operation will abort.
663 7322bf7b Iustin Pop
664 7322bf7b Iustin Pop
If the ``--from`` option is given, the list of tags to be removed will
665 7322bf7b Iustin Pop
be extended with the contents of that file (each line becomes a tag).
666 7322bf7b Iustin Pop
In this case, there is not need to pass tags on the command line (if
667 7322bf7b Iustin Pop
you do, tags from both sources will be removed). A file name of - will
668 7322bf7b Iustin Pop
be interpreted as stdin.
669 7322bf7b Iustin Pop
670 9ff4f2c0 Michael Hanselmann
.. vim: set textwidth=72 :
671 9ff4f2c0 Michael Hanselmann
.. Local Variables:
672 9ff4f2c0 Michael Hanselmann
.. mode: rst
673 9ff4f2c0 Michael Hanselmann
.. fill-column: 72
674 9ff4f2c0 Michael Hanselmann
.. End: