gnt-node.sgml 34.7 KB
Newer Older
Iustin Pop's avatar
Iustin Pop committed
1
2
3
4
<!doctype refentry PUBLIC "-//OASIS//DTD DocBook V4.1//EN" [

  <!-- Fill in your name for FIRSTNAME and SURNAME. -->
  <!-- Please adjust the date whenever revising the manpage. -->
5
  <!ENTITY dhdate      "<date>June 08, 2010</date>">
Iustin Pop's avatar
Iustin Pop committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
  <!-- SECTION should be 1-8, maybe w/ subsection other parameters are
       allowed: see man(7), man(1). -->
  <!ENTITY dhsection   "<manvolnum>8</manvolnum>">
  <!ENTITY dhucpackage "<refentrytitle>gnt-node</refentrytitle>">
  <!ENTITY dhpackage   "gnt-node">

  <!ENTITY debian      "<productname>Debian</productname>">
  <!ENTITY gnu         "<acronym>GNU</acronym>">
  <!ENTITY gpl         "&gnu; <acronym>GPL</acronym>">
  <!ENTITY footer SYSTEM "footer.sgml">
]>

<refentry>
  <refentryinfo>
    <copyright>
      <year>2006</year>
      <year>2007</year>
23
      <year>2008</year>
24
      <year>2009</year>
Iustin Pop's avatar
Iustin Pop committed
25
26
27
28
29
30
31
32
      <holder>Google Inc.</holder>
    </copyright>
    &dhdate;
  </refentryinfo>
  <refmeta>
    &dhucpackage;

    &dhsection;
33
    <refmiscinfo>Ganeti 2.2</refmiscinfo>
Iustin Pop's avatar
Iustin Pop committed
34
35
36
37
  </refmeta>
  <refnamediv>
    <refname>&dhpackage;</refname>

38
    <refpurpose>Node administration</refpurpose>
Iustin Pop's avatar
Iustin Pop committed
39
40
41
42
43
44
45
46
47
48
49
50
51
52
  </refnamediv>
  <refsynopsisdiv>
    <cmdsynopsis>
      <command>&dhpackage; </command>

      <arg choice="req">command</arg>
      <arg>arguments...</arg>
    </cmdsynopsis>
  </refsynopsisdiv>
  <refsect1>
    <title>DESCRIPTION</title>

    <para>
      The <command>&dhpackage;</command> is used for managing the
53
      (physical) nodes in the Ganeti system.
Iustin Pop's avatar
Iustin Pop committed
54
55
56
57
58
59
60
61
62
63
64
    </para>

  </refsect1>
  <refsect1>
    <title>COMMANDS</title>

    <refsect2>
      <title>ADD</title>

      <cmdsynopsis>
        <command>add</command>
65
        <arg>--readd</arg>
Iustin Pop's avatar
Iustin Pop committed
66
        <arg>-s <replaceable>secondary_ip</replaceable></arg>
67
        <arg>-g <replaceable>nodegroup</replaceable></arg>
Iustin Pop's avatar
Iustin Pop committed
68
69
70
71
72
73
74
75
76
77
78
        <arg choice="req"><replaceable>nodename</replaceable></arg>
      </cmdsynopsis>

      <para>
        Adds the given node to the cluster.
      </para>

      <para>
        This command is used to join a new node to the cluster. You
        will have to provide the password for root of the node to be
        able to add the node in the cluster. The command needs to be
79
        run on the Ganeti master.
Iustin Pop's avatar
Iustin Pop committed
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
      </para>

      <para>
        Note that the command is potentially destructive, as it will
        forcibly join the specified host the cluster, not paying
        attention to its current status (it could be already in a
        cluster, etc.)
      </para>

      <para>
        The <option>-s</option> is used in dual-home clusters and
        specifies the new node's IP in the secondary network. See the
        discussion in <citerefentry>
        <refentrytitle>gnt-cluster</refentrytitle>
        <manvolnum>8</manvolnum> </citerefentry> for more
Michael Hanselmann's avatar
Michael Hanselmann committed
95
        information.
Iustin Pop's avatar
Iustin Pop committed
96
97
      </para>

98
      <para>
99
100
101
102
103
104
        In case you're readding a node after hardware failure, you can
        use the <option>--readd</option> parameter. In this case, you
        don't need to pass the secondary IP again, it will reused from
        the cluster. Also, the <literal>drained</literal> and
        <literal>offline</literal> flags of the node will be cleared
        before re-adding it.
105
106
      </para>

107
108
109
110
111
112
      <para>
        The <option>-g</option> is used to add the new node into a specific
        node group, specified by uuid or name. If only one node group exists
        you can skip this option, otherwise it's mandatory.
      </para>

Iustin Pop's avatar
Iustin Pop committed
113
114
115
116
      <para>
        Example:
        <screen>
# gnt-node add node5.example.com
117
# gnt-node add -s 192.0.2.5 node5.example.com
118
# gnt-node add -g group2 -s 192.0.2.9 node9.group2.example.com
Iustin Pop's avatar
Iustin Pop committed
119
120
121
122
        </screen>
      </para>
    </refsect2>

123
124
125
126
127
    <refsect2>
      <title>ADD-TAGS</title>

      <cmdsynopsis>
        <command>add-tags</command>
128
        <arg choice="opt">--from <replaceable>file</replaceable></arg>
129
130
131
132
133
134
135
136
137
        <arg choice="req"><replaceable>nodename</replaceable></arg>
        <arg choice="req"
        rep="repeat"><replaceable>tag</replaceable></arg>
      </cmdsynopsis>

      <para>
        Add tags to the given node. If any of the tags contains
        invalid characters, the entire operation will abort.
      </para>
138
139
140
141
142
143
144
145

      <para>
        If the <option>--from</option> option is given, the list of
        tags will be extended with the contents of that file (each
        line becomes a tag). In this case, there is not need to pass
        tags on the command line (if you do, both sources will be
        used). A file name of - will be interpreted as stdin.
      </para>
146
147
    </refsect2>

Iustin Pop's avatar
Iustin Pop committed
148
149
150
151
152
153
    <refsect2>
      <title>EVACUATE</title>

      <cmdsynopsis>
        <command>evacuate</command>
        <arg>-f</arg>
154
        <arg>--early-release</arg>
155
156
157
158
        <group>
          <arg>--iallocator <replaceable>NAME</replaceable></arg>
          <arg>--new-secondary <replaceable>destination_node</replaceable></arg>
        </group>
159
        <arg choice="req" rep="repeat"><replaceable>node</replaceable></arg>
Iustin Pop's avatar
Iustin Pop committed
160
161
162
      </cmdsynopsis>

      <para>
163
        This command will move all secondary instances away from the
164
        given node(s). It works only for instances having a drbd disk
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
        template.
      </para>

      <para>
        The new location for the instances can be specified in two ways:
        <itemizedlist>
          <listitem>
            <simpara>as a single node for all instances, via the
            <option>--new-secondary</option> option</simpara>
          </listitem>
          <listitem>
            <simpara>or via the <option>--iallocator</option> option,
            giving a script name as parameter, so each instance will
            be in turn placed on the (per the script) optimal
            node</simpara>
          </listitem>
        </itemizedlist>
Iustin Pop's avatar
Iustin Pop committed
182
183
      </para>

184
185
186
187
188
189
190
191
192
193
194
195
196
      <para>
        The <option>--early-release</option> changes the code so that
        the old storage on node being evacuated is removed early
        (before the resync is completed) and the internal Ganeti locks
        are also released for both the current secondary and the new
        secondary, thus allowing more parallelism in the cluster
        operation. This should be used only when recovering from a
        disk failure on the current secondary (thus the old storage is
        already broken) or when the storage on the primary node is
        known to be fine (thus we won't need the old storage for
        potential recovery).
      </para>

Iustin Pop's avatar
Iustin Pop committed
197
198
199
      <para>
        Example:
        <screen>
200
          # gnt-node evacuate -I dumb node3.example.com
Iustin Pop's avatar
Iustin Pop committed
201
202
203
204
        </screen>
      </para>
    </refsect2>

Iustin Pop's avatar
Iustin Pop committed
205
206
207
208
209
210
211
212
213
214
215
216
217
    <refsect2>
      <title>FAILOVER</title>

      <cmdsynopsis>
        <command>failover</command>
        <arg>-f</arg>
        <arg>--ignore-consistency</arg>
        <arg choice="req"><replaceable>node</replaceable></arg>
      </cmdsynopsis>

      <para>
        This command will fail over all instances having the given
        node as primary to their secondary nodes. This works only for
218
        instances having a drbd disk template.
Iustin Pop's avatar
Iustin Pop committed
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
      </para>

      <para>
        Normally the failover will check the consistency of the disks
        before failing over the instance. If you are trying to migrate
        instances off a dead node, this will fail. Use the
        <option>--ignore-consistency</option> option for this purpose.
      </para>

      <para>
        Example:
        <screen>
          # gnt-node failover node1.example.com
        </screen>
      </para>
    </refsect2>

Iustin Pop's avatar
Iustin Pop committed
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
    <refsect2>
      <title>INFO</title>

      <cmdsynopsis>
        <command>info</command>
        <arg rep="repeat"><replaceable>node</replaceable></arg>
      </cmdsynopsis>

      <para>
        Show detailed information about the nodes in the cluster. If you
        don't give any arguments, all nodes will be shows, otherwise the
        output will be restricted to the given names.
      </para>
    </refsect2>

    <refsect2>
      <title>LIST</title>

      <cmdsynopsis>
        <command>list</command>
256
257
        <arg>--sync</arg>
        <sbr>
Iustin Pop's avatar
Iustin Pop committed
258
259
        <arg>--no-headers</arg>
        <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
260
261
        <sbr>
        <arg>--units=<replaceable>UNITS</replaceable></arg>
262
        <arg>-o <replaceable>[+]FIELD,...</replaceable></arg>
263
        <sbr>
264
265
        <arg>--roman</arg>
        <sbr>
266
        <arg rep="repeat">node</arg>
Iustin Pop's avatar
Iustin Pop committed
267
268
269
      </cmdsynopsis>

      <para>
270
        Lists the nodes in the cluster.
Iustin Pop's avatar
Iustin Pop committed
271
272
273
274
275
276
277
278
279
      </para>

      <para>
        The <option>--no-headers</option> option will skip the initial
        header line. The <option>--separator</option> option takes an
        argument which denotes what will be used between the output
        fields. Both these options are to help scripting.
      </para>

280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
      <para>
        The units used to display the numeric values in the output
        varies, depending on the options given. By default, the values
        will be formatted in the most appropriate unit. If the
        <option>--separator</option> option is given, then the values
        are shown in mebibytes to allow parsing by scripts. In both
        cases, the <option>--units</option> option can be used to
        enforce a given output unit.
      </para>

      <para>
        By default, the query of nodes will be done in parallel with
        any running jobs. This might give inconsistent results for the
        free disk/memory. The <option>--sync</option> can be used to
        grab locks for all the nodes and ensure consistent view of the
        cluster (but this might stall the query for a long time).
      </para>

298
299
300
301
302
303
      <para>
        Passing the <option>--roman</option> option gnt-node list will try to
        output some of its fields in a latin-friendly way. This is not the
        default for backwards compatibility.
      </para>

Iustin Pop's avatar
Iustin Pop committed
304
305
306
307
308
309
310
311
312
313
314
      <para>
        The <option>-o</option> option takes a comma-separated list of
        output fields. The available fields and their meaning are:
        <variablelist>
          <varlistentry>
            <term>name</term>
            <listitem>
              <simpara>the node name</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
315
            <term>pinst_cnt</term>
Iustin Pop's avatar
Iustin Pop committed
316
317
318
319
320
321
            <listitem>
              <simpara>the number of instances having this node as
              primary</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
322
323
324
325
326
327
328
329
            <term>pinst_list</term>
            <listitem>
              <simpara>the list of instances having this node as
              primary, comma separated</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>sinst_cnt</term>
Iustin Pop's avatar
Iustin Pop committed
330
331
332
333
334
            <listitem>
              <simpara>the number of instances having this node as a
              secondary node</simpara>
            </listitem>
          </varlistentry>
335
336
337
338
339
340
341
          <varlistentry>
            <term>sinst_list</term>
            <listitem>
              <simpara>the list of instances having this node as a
              secondary node, comma separated</simpara>
            </listitem>
          </varlistentry>
Iustin Pop's avatar
Iustin Pop committed
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
          <varlistentry>
            <term>pip</term>
            <listitem>
              <simpara>the primary ip of this node (used for cluster
              communication)</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>sip</term>
            <listitem>
              <simpara>
                the secondary ip of this node (used for data
                replication in dual-ip clusters, see <citerefentry>
                <refentrytitle>gnt-cluster</refentrytitle>
                <manvolnum>8</manvolnum>
                </citerefentry>
              </simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>dtotal</term>
            <listitem>
              <simpara>total disk space in the volume group used for
              instance disk allocations</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>dfree</term>
            <listitem>
              <simpara>available disk space in the volume group</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>mtotal</term>
            <listitem>
              <simpara>total memory on the physical node</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>mnode</term>
            <listitem>
              <simpara>the memory used by the node itself</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>mfree</term>
            <listitem>
              <simpara>memory available for instance
              allocations</simpara>
            </listitem>
          </varlistentry>
393
394
395
396
397
398
399
400
401
          <varlistentry>
            <term>bootid</term>
            <listitem>
              <simpara>the node bootid value; this is a linux specific
              feature that assigns a new UUID to the node at each boot
              and can be use to detect node reboots (by tracking
              changes in this value)</simpara>
            </listitem>
          </varlistentry>
402
403
404
405
406
407
408
          <varlistentry>
            <term>tags</term>
            <listitem>
              <simpara>comma-separated list of the node's
              tags</simpara>
            </listitem>
          </varlistentry>
409
410
411
          <varlistentry>
            <term>serial_no</term>
            <listitem>
412
              <simpara>the so called 'serial number' of the node;
413
              this is a numeric field that is incremented each time
414
              the node is modified, and it can be used to detect
415
416
417
              modifications</simpara>
            </listitem>
          </varlistentry>
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
          <varlistentry>
            <term>ctime</term>
            <listitem>
              <para>
                the creation time of the node; note that this field
                contains spaces and as such it's harder to parse
              </para>
              <para>
                if this attribute is not present (e.g. when upgrading
                from older versions), then "N/A" will be shown instead
              </para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>mtime</term>
            <listitem>
              <para>
                the last modification time of the node; note that this
                field contains spaces and as such it's harder to parse
              </para>
              <para>
                if this attribute is not present (e.g. when upgrading
                from older versions), then "N/A" will be shown instead
              </para>
            </listitem>
          </varlistentry>
444
445
446
447
448
449
450
451
          <varlistentry>
            <term>uuid</term>
            <listitem>
              <simpara>Show the UUID of the node (generated
                automatically by Ganeti)</simpara>
            </listitem>
          </varlistentry>

452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
          <varlistentry>
            <term>ctotal</term>
            <listitem>
              <simpara>the toal number of logical processors</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>cnodes</term>
            <listitem>
              <simpara>the number of NUMA domains on the node, if the
              hypervisor can export this information</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>csockets</term>
            <listitem>
              <simpara>the number of physical CPU sockets, if the
              hypervisor can export this information</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>master_candidate</term>
            <listitem>
              <simpara>whether the node is a master candidate or not</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>drained</term>
            <listitem>
481
482
483
              <simpara>whether the node is drained or not; the cluster
              still communicates with drained nodes but excludes them
              from allocation operations</simpara>
484
485
486
487
488
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>offline</term>
            <listitem>
489
490
491
492
              <simpara>whether the node is offline or not; if offline,
              the cluster does not communicate with offline nodes;
              useful for nodes that are not reachable in order to
              avoid delays</simpara>
493
494
            </listitem>
          </varlistentry>
Iustin Pop's avatar
Iustin Pop committed
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
          <varlistentry>
            <term>role</term>
            <listitem>
              <para>
                A condensed version of the node flags; this field will
                output a one-character field, with the following
                possible values:
                <itemizedlist>
                  <listitem>
                    <simpara><emphasis>M</emphasis> for the master
                    node</simpara>
                  </listitem>
                  <listitem>
                    <simpara><emphasis>C</emphasis> for a master
                    candidate</simpara>
                  </listitem>
                  <listitem>
                    <simpara><emphasis>R</emphasis> for a regular
                    node</simpara>
                  </listitem>
                  <listitem>
                    <simpara><emphasis>D</emphasis> for a drained
                    node</simpara>
                  </listitem>
                  <listitem>
                    <simpara><emphasis>O</emphasis> for an offline
                    node</simpara>
                  </listitem>
                </itemizedlist>
              </para>
            </listitem>
          </varlistentry>
527
528
529
530
531
532
533
534
535
536
537
538
          <varlistentry>
            <term>master_capable</term>
            <listitem>
              <para>whether the node can become a master candidate</para>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>vm_capable</term>
            <listitem>
              <para>whether the node can host instances</para>
            </listitem>
          </varlistentry>
Iustin Pop's avatar
Iustin Pop committed
539
540
541
        </variablelist>
      </para>

542
543
544
545
546
547
548
549
      <para>
        If the value of the option starts with the character
        <constant>+</constant>, the new fields will be added to the
        default list. This allows to quickly see the default list plus
        a few other fields, instead of retyping the entire list of
        fields.
      </para>

Iustin Pop's avatar
Iustin Pop committed
550
551
      <para>
        Note that some of this fields are known from the configuration
552
        of the cluster (e.g. <simplelist type="inline">
Iustin Pop's avatar
Iustin Pop committed
553
554
555
556
557
558
559
560
561
562
563
564
565
566
        <member>name</member> <member>pinst</member>
        <member>sinst</member> <member>pip</member>
        <member>sip</member> </simplelist> and thus the master does
        not need to contact the node for this data (making the listing
        fast if only fields from this set are selected), whereas the
        other fields are "live" fields and we need to make a query to
        the cluster nodes.
      </para>

      <para>
        Depending on the virtualization type and implementation
        details, the mtotal, mnode and mfree may have slighly varying
        meanings. For example, some solutions share the node memory
        with the pool of memory used for instances
567
        (<acronym>KVM</acronym>), whereas others have separate memory
Iustin Pop's avatar
Iustin Pop committed
568
569
        for the node and for the instances (Xen).
      </para>
570
571
572
573
574

      <para>
        If no node names are given, then all nodes are
        queried. Otherwise, only the given nodes will be listed.
      </para>
Iustin Pop's avatar
Iustin Pop committed
575
576
    </refsect2>

577
578
579
580
581
582
583
584
585
586
587
    <refsect2>
      <title>LIST-TAGS</title>

      <cmdsynopsis>
        <command>list-tags</command>
        <arg choice="req"><replaceable>nodename</replaceable></arg>
      </cmdsynopsis>

      <para>List the tags of the given node.</para>
    </refsect2>

588
589
590
591
592
593
    <refsect2>
      <title>MIGRATE</title>
      <cmdsynopsis>
        <command>migrate</command>
        <arg>-f</arg>
        <arg>--non-live</arg>
594
        <arg>--migration-mode=live|non-live</arg>
595
596
597
598
599
600
601
602
603
604
605
        <arg choice="req"><replaceable>node</replaceable></arg>
      </cmdsynopsis>

      <para>
        This command will migrate all instances having the given
        node as primary to their secondary nodes. This works only for
        instances having a drbd disk template.
      </para>

      <para>
        As for the <command>gnt-instance migrate</command> command,
606
        the options <option>--no-live</option>
607
        and <option>--migration-mode</option> can be given to
608
        influence the migration type.
609
610
611
612
613
614
615
616
617
618
619
      </para>

      <para>
        Example:
        <screen>
          # gnt-node migrate node1.example.com
        </screen>
      </para>

    </refsect2>

620
621
622
623
624
625
626
627
628
    <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>
629
        <arg>--master-capable=<option>yes|no</option></arg>
Iustin Pop's avatar
Iustin Pop committed
630
        <arg>--vm-capable=<option>yes|no</option></arg>
631
        <arg>--auto-promote</arg>
632
633
634
635
636
637
638
        <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
639
640
        <literal>yes</literal>. The meaning of the roles and flags are
        described in the manpage <citerefentry>
641
642
643
644
645
        <refentrytitle>ganeti</refentrytitle> <manvolnum>7</manvolnum>
        </citerefentry>.
      </para>

      <para>
646
647
648
649
650
651
652
653
654
        In case a node is demoted from the master candidate role, the
        operation will be refused unless you pass
        the <option>--auto-promote</option> option. This option will
        cause the operation to lock all cluster nodes (thus it will
        not be able to run in parallel with most other jobs), but it
        allows automated maintenance of the cluster candidate pool. If
        locking all cluster node is too expensive, another option is
        to promote manually another node to master candidate before
        demoting the current one.
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
      </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>

Iustin Pop's avatar
Iustin Pop committed
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
    <refsect2>
      <title>REMOVE</title>

      <cmdsynopsis>
        <command>remove</command>
        <arg choice="req"><replaceable>nodename</replaceable></arg>
      </cmdsynopsis>

      <para>
        Removes a node from the cluster. Instances must be removed or
        migrated to another cluster before.
      </para>

      <para>
        Example:
        <screen>
# gnt-node remove node5.example.com
        </screen>
      </para>
    </refsect2>

694
695
696
697
    <refsect2>
      <title>REMOVE-TAGS</title>
      <cmdsynopsis>
        <command>remove-tags</command>
698
        <arg choice="opt">--from <replaceable>file</replaceable></arg>
699
700
701
702
703
704
705
706
707
        <arg choice="req"><replaceable>nodename</replaceable></arg>
        <arg choice="req"
        rep="repeat"><replaceable>tag</replaceable></arg>
      </cmdsynopsis>

      <para>
        Remove tags from the given node. If any of the tags are not
        existing on the node, the entire operation will abort.
      </para>
708
709
710
711
712
713
714
715

      <para>
        If the <option>--from</option> option is given, the list of
        tags will be extended with the contents of that file (each
        line becomes a tag). In this case, there is not need to pass
        tags on the command line (if you do, both sources will be
        used). A file name of - will be interpreted as stdin.
      </para>
716
717
    </refsect2>

718
719
720
721
722
    <refsect2>
      <title>VOLUMES</title>

      <cmdsynopsis>
        <command>volumes</command>
Iustin Pop's avatar
Iustin Pop committed
723
724
725
726
727
        <arg>--no-headers</arg>
        <arg>--human-readable</arg>
        <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
        <arg>--output=<replaceable>FIELDS</replaceable></arg>
        <sbr>
728
729
730
731
732
733
734
735
        <arg rep="repeat"><replaceable>node</replaceable></arg>
      </cmdsynopsis>

      <para>
        Lists all logical volumes and their physical disks from the node(s)
        provided.
      </para>

Iustin Pop's avatar
Iustin Pop committed
736
737
738
739
740
741
742
      <para>
        The <option>--no-headers</option> option will skip the initial
        header line. The <option>--separator</option> option takes an
        argument which denotes what will be used between the output
        fields. Both these options are to help scripting.
      </para>

743
744
745
746
747
748
749
750
751
752
      <para>
        The units used to display the numeric values in the output
        varies, depending on the options given. By default, the values
        will be formatted in the most appropriate unit. If the
        <option>--separator</option> option is given, then the values
        are shown in mebibytes to allow parsing by scripts. In both
        cases, the <option>--units</option> option can be used to
        enforce a given output unit.
      </para>

Iustin Pop's avatar
Iustin Pop committed
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
      <para>
        The <option>-o</option> option takes a comma-separated list of
        output fields. The available fields and their meaning are:
        <variablelist>
          <varlistentry>
            <term>node</term>
            <listitem>
              <simpara>the node name on which the volume exists</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>phys</term>
            <listitem>
              <simpara>the physical drive (on which the LVM physical
              volume lives)</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>vg</term>
            <listitem>
              <simpara>the volume group name</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>name</term>
            <listitem>
              <simpara>the logical volume name</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>size</term>
            <listitem>
              <simpara>the logical volume size</simpara>
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>instance</term>
            <listitem>
              <simpara>The name of the instance to which this volume
              belongs, or (in case it's an orphan volume) the
              character <quote>-</quote></simpara>
            </listitem>
          </varlistentry>
        </variablelist>
      </para>

799
800
801
802
803
804
805
806
807
808
809
      <para>
        Example:
        <screen>
# gnt-node volumes node5.example.com
Node              PhysDev   VG    Name                                 Size Instance
node1.example.com /dev/hdc1 xenvg instance1.example.com-sda_11000.meta 128  instance1.example.com
node1.example.com /dev/hdc1 xenvg instance1.example.com-sda_11001.data 256  instance1.example.com
        </screen>
      </para>
    </refsect2>

810
    <refsect2>
Iustin Pop's avatar
Iustin Pop committed
811
      <title>LIST-STORAGE</title>
812
813

      <cmdsynopsis>
Iustin Pop's avatar
Iustin Pop committed
814
        <command>list-storage</command>
815
816
817
        <arg>--no-headers</arg>
        <arg>--human-readable</arg>
        <arg>--separator=<replaceable>SEPARATOR</replaceable></arg>
818
        <arg>--storage-type=<replaceable>STORAGE_TYPE</replaceable></arg>
819
820
821
822
823
824
        <arg>--output=<replaceable>FIELDS</replaceable></arg>
        <sbr>
        <arg rep="repeat"><replaceable>node</replaceable></arg>
      </cmdsynopsis>

      <para>
Iustin Pop's avatar
Iustin Pop committed
825
826
        Lists the available storage units and their details for the
        given node(s).
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
      </para>

      <para>
        The <option>--no-headers</option> option will skip the initial header
        line. The <option>--separator</option> option takes an argument which
        denotes what will be used between the output fields. Both these options
        are to help scripting.
      </para>

      <para>
        The units used to display the numeric values in the output varies,
        depending on the options given. By default, the values will be
        formatted in the most appropriate unit. If the
        <option>--separator</option> option is given, then the values are shown
        in mebibytes to allow parsing by scripts. In both cases, the
        <option>--units</option> option can be used to enforce a given output
        unit.
      </para>

846
847
848
      <para>
        The <option>--storage-type</option> option can be used to choose a
        storage unit type. Possible choices are <literal>lvm-pv</literal>,
849
        <literal>lvm-vg</literal> or <literal>file</literal>.
850
851
      </para>

852
853
854
855
856
857
858
859
860
861
      <para>
        The <option>-o</option> option takes a comma-separated list of
        output fields. The available fields and their meaning are:
        <variablelist>
          <varlistentry>
            <term>node</term>
            <listitem>
              <simpara>the node name on which the volume exists</simpara>
            </listitem>
          </varlistentry>
862
863
864
865
866
867
868
869
          <varlistentry>
            <term>type</term>
            <listitem>
              <simpara>the type of the storage unit (currently just
              what is passed in via
              <option>--storage-type</option>)</simpara>
            </listitem>
          </varlistentry>
870
871
872
          <varlistentry>
            <term>name</term>
            <listitem>
873
              <simpara>the path/identifier of the storage unit</simpara>
874
875
876
877
878
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>size</term>
            <listitem>
879
              <simpara>
880
                total size of the unit; for the file type see a note below
881
              </simpara>
882
883
884
885
886
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>used</term>
            <listitem>
887
              <simpara>
888
                used space in the unit; for the file type see a note below
889
              </simpara>
890
891
892
893
894
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>free</term>
            <listitem>
895
896
897
              <simpara>
                available disk space
              </simpara>
898
899
900
901
902
            </listitem>
          </varlistentry>
          <varlistentry>
            <term>allocatable</term>
            <listitem>
903
              <simpara>
904
905
906
                whether we the unit is available for allocation
                (only <literal>lvm-pv</literal> can change this
                setting, the other types always report true)
907
              </simpara>
908
909
910
911
912
            </listitem>
          </varlistentry>
        </variablelist>
      </para>

913
914
915
916
917
918
919
920
921
922
923
924
925
      <para>
        Note that for the <quote>file</quote> type, the total disk
        space might not equal to the sum of used and free, due to the
        method Ganeti uses to compute each of them. The total and free
        values are computed as the total and free space values for the
        filesystem to which the directory belongs, but the used space
        is computed from the used space under that directory
        <emphasis>only</emphasis>, which might not be necessarily the
        root of the filesystem, and as such there could be files
        outside the file storage directory using disk space and
        causing a mismatch in the values.
      </para>

926
927
928
      <para>
        Example:
        <screen>
929
930
931
932
node1# gnt-node list-storage node2
Node  Type   Name        Size Used   Free Allocatable
node2 lvm-pv /dev/sda7 673.8G 1.5G 672.3G Y
node2 lvm-pv /dev/sdb1 698.6G   0M 698.6G Y
933
934
935
936
        </screen>
      </para>
    </refsect2>

937
    <refsect2>
Iustin Pop's avatar
Iustin Pop committed
938
      <title>MODIFY-STORAGE</title>
939
940

      <cmdsynopsis>
Iustin Pop's avatar
Iustin Pop committed
941
        <command>modify-storage</command>
942
943
        <arg><option>--allocatable=yes|no</option></arg>
        <sbr>
944
945
946
        <arg choice="req"><replaceable>node</replaceable></arg>
        <arg choice="req"><replaceable>storage-type</replaceable></arg>
        <arg choice="req"><replaceable>volume-name</replaceable></arg>
947
948
949
      </cmdsynopsis>

      <para>
Iustin Pop's avatar
Iustin Pop committed
950
951
952
        Modifies storage volumes on a node. Only LVM physical volumes
        can be modified at the moment. They have a storage type
        of <quote>lvm-pv</quote>.
953
954
955
956
957
      </para>

      <para>
        Example:
        <screen>
Iustin Pop's avatar
Iustin Pop committed
958
# gnt-node modify-storage --allocatable no node5.example.com lvm-pv /dev/sdb1
959
960
961
962
        </screen>
      </para>
    </refsect2>

963
    <refsect2>
Iustin Pop's avatar
Iustin Pop committed
964
      <title>REPAIR-STORAGE</title>
965
966

      <cmdsynopsis>
Iustin Pop's avatar
Iustin Pop committed
967
        <command>repair-storage</command>
968
969
970
971
        <arg>--ignore-consistency</arg>
        <arg choice="req"><replaceable>node</replaceable></arg>
        <arg choice="req"><replaceable>storage-type</replaceable></arg>
        <arg choice="req"><replaceable>volume-name</replaceable></arg>
972
973
974
      </cmdsynopsis>

      <para>
Iustin Pop's avatar
Iustin Pop committed
975
976
        Repairs a storage volume on a node. Only LVM volume groups can
        be repaired at this time. They have the storage type
977
978
979
980
        <quote>lvm-vg</quote>.
      </para>

      <para>
Iustin Pop's avatar
Iustin Pop committed
981
        On LVM volume groups, <command>repair-storage</command> runs
982
983
984
985
986
987
988
989
990
        <quote>vgreduce --removemissing</quote>.
      </para>

      <caution>
        <para>
          Running this command can lead to data loss. Use it with care.
        </para>
      </caution>

991
992
993
994
995
996
      <para>
        The <option>--ignore-consistency</option> option will ignore
        any inconsistent disks (on the nodes paired with this
        one). Use of this option is most likely to lead to data-loss.
      </para>

997
998
999
      <para>
        Example:
        <screen>
Iustin Pop's avatar
Iustin Pop committed
1000
# gnt-node repair-storage node5.example.com lvm-vg xenvg
1001
1002
1003
1004
        </screen>
      </para>
    </refsect2>

Iustin Pop's avatar
Iustin Pop committed
1005
1006
1007
1008
1009
    <refsect2>
      <title>POWERCYCLE</title>

      <cmdsynopsis>
        <command>powercycle</command>
1010
        <arg><option>--yes</option></arg>
Iustin Pop's avatar
Iustin Pop committed
1011
1012
1013
1014
1015
1016
1017
1018
        <arg><option>--force</option></arg>
        <arg choice="req"><replaceable>node</replaceable></arg>
      </cmdsynopsis>

      <para>
        This commands (tries to) forcefully reboot a node. It is a
        command that can be used if the node environemnt is broken,
        such that the admin can no longer login over ssh, but the
1019
        Ganeti node daemon is still working.
Iustin Pop's avatar
Iustin Pop committed
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
      </para>

      <para>
        Note that this command is not guaranteed to work; it depends
        on the hypervisor how effective is the reboot attempt. For
        Linux, this command require that the kernel option
        <literal>CONFIG_MAGIC_SYSRQ</literal> is enabled.
      </para>

      <para>
        The <option>--yes</option> option can be used to skip
        confirmation, while the <option>--force</option> option is
        needed if the target node is the master node.
      </para>

Iustin Pop's avatar
Iustin Pop committed
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
  </refsect1>

  &footer;

</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:2
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:nil
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->