This file is indexed.

/usr/share/doc/ganeti/html/install.html is in ganeti-doc 2.16.0~rc2-1build1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
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
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
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
444
445
446
447
448
449
450
451
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
481
482
483
484
485
486
487
488
489
490
491
492
493
494
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
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
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
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Ganeti installation tutorial &#8212; Ganeti 2.16.0~rc2 documentation</title>
    <link rel="stylesheet" href="_static/style.css" type="text/css" />
    <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    './',
        VERSION:     '2.16.0~rc2',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true,
        SOURCELINK_SUFFIX: '.txt'
      };
    </script>
    <script type="text/javascript" src="_static/jquery.js"></script>
    <script type="text/javascript" src="_static/underscore.js"></script>
    <script type="text/javascript" src="_static/doctools.js"></script>
    <link rel="search" title="Search" href="search.html" />
    <link rel="next" title="Ganeti quick installation guide" href="install-quick.html" />
    <link rel="prev" title="Ganeti automatic instance allocation" href="iallocator.html" /> 
  </head>
  <body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="install-quick.html" title="Ganeti quick installation guide"
             accesskey="N">next</a></li>
        <li class="right" >
          <a href="iallocator.html" title="Ganeti automatic instance allocation"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">Ganeti 2.16.0~rc2 documentation</a> &#187;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="ganeti-installation-tutorial">
<h1><a class="toc-backref" href="#id3">Ganeti installation tutorial</a><a class="headerlink" href="#ganeti-installation-tutorial" title="Permalink to this headline"></a></h1>
<p>Documents Ganeti version 2.16</p>
<div class="contents topic" id="contents">
<p class="topic-title first">Contents</p>
<ul class="simple">
<li><a class="reference internal" href="#ganeti-installation-tutorial" id="id3">Ganeti installation tutorial</a><ul>
<li><a class="reference internal" href="#introduction" id="id4">Introduction</a></li>
<li><a class="reference internal" href="#installing-the-base-system-and-base-components" id="id5">Installing the base system and base components</a><ul>
<li><a class="reference internal" href="#hardware-requirements" id="id6">Hardware requirements</a></li>
<li><a class="reference internal" href="#installing-the-base-system" id="id7">Installing the base system</a><ul>
<li><a class="reference internal" href="#hostname-issues" id="id8">Hostname issues</a></li>
</ul>
</li>
<li><a class="reference internal" href="#installing-the-hypervisor" id="id9">Installing The Hypervisor</a><ul>
<li><a class="reference internal" href="#xen-settings" id="id10">Xen settings</a></li>
<li><a class="reference internal" href="#selecting-the-instance-kernel" id="id11">Selecting the instance kernel</a></li>
</ul>
</li>
<li><a class="reference internal" href="#installing-drbd" id="id12">Installing DRBD</a></li>
<li><a class="reference internal" href="#installing-rbd" id="id13">Installing RBD</a><ul>
<li><a class="reference internal" href="#rados-cluster" id="id14">RADOS Cluster</a></li>
<li><a class="reference internal" href="#kernel-modules" id="id15">Kernel Modules</a></li>
<li><a class="reference internal" href="#userspace-utils" id="id16">Userspace Utils</a></li>
<li><a class="reference internal" href="#kvm-userspace-access" id="id17">KVM userspace access</a></li>
<li><a class="reference internal" href="#configuration-file" id="id18">Configuration file</a></li>
</ul>
</li>
<li><a class="reference internal" href="#installing-gluster" id="id19">Installing Gluster</a><ul>
<li><a class="reference internal" href="#id2" id="id20">KVM userspace access</a></li>
</ul>
</li>
<li><a class="reference internal" href="#other-required-software" id="id21">Other required software</a></li>
</ul>
</li>
<li><a class="reference internal" href="#setting-up-the-environment-for-ganeti" id="id22">Setting up the environment for Ganeti</a><ul>
<li><a class="reference internal" href="#configuring-the-network" id="id23">Configuring the network</a></li>
<li><a class="reference internal" href="#configuring-lvm" id="id24">Configuring LVM</a></li>
<li><a class="reference internal" href="#installing-ganeti" id="id25">Installing Ganeti</a><ul>
<li><a class="reference internal" href="#what-gets-installed" id="id26">What gets installed</a></li>
</ul>
</li>
<li><a class="reference internal" href="#installing-the-operating-system-support-packages" id="id27">Installing the Operating System support packages</a></li>
<li><a class="reference internal" href="#initializing-the-cluster" id="id28">Initializing the cluster</a><ul>
<li><a class="reference internal" href="#hypervisor-network-cluster-parameters" id="id29">Hypervisor/Network/Cluster parameters</a></li>
</ul>
</li>
<li><a class="reference internal" href="#joining-the-nodes-to-the-cluster" id="id30">Joining the nodes to the cluster</a></li>
<li><a class="reference internal" href="#separate-replication-network" id="id31">Separate replication network</a></li>
<li><a class="reference internal" href="#testing-the-setup" id="id32">Testing the setup</a><ul>
<li><a class="reference internal" href="#cluster-burnin" id="id33">Cluster burnin</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#further-steps" id="id34">Further steps</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="introduction">
<h2><a class="toc-backref" href="#id4">Introduction</a><a class="headerlink" href="#introduction" title="Permalink to this headline"></a></h2>
<p>Ganeti is a cluster virtualization management system based on Xen or
KVM. This document explains how to bootstrap a Ganeti node (Xen <em>dom0</em>,
the host Linux system for KVM), create a running cluster and install
virtual instances (Xen <em>domUs</em>, KVM guests).  You need to repeat most of
the steps in this document for every node you want to install, but of
course we recommend creating some semi-automatic procedure if you plan
to deploy Ganeti on a medium/large scale.</p>
<p>A basic Ganeti terminology glossary is provided in the introductory
section of the <a class="reference internal" href="admin.html"><span class="doc">Ganeti administrator’s guide</span></a>. Please refer to that document if you are
uncertain about the terms we are using.</p>
<p>Ganeti has been developed for Linux and should be distribution-agnostic.
This documentation will use Debian Squeeze as an example system but the
examples can be translated to any other distribution. You are expected
to be familiar with your distribution, its package management system,
and Xen or KVM before trying to use Ganeti.</p>
<p>This document is divided into two main sections:</p>
<ul class="simple">
<li>Installation of the base system and base components</li>
<li>Configuration of the environment for Ganeti</li>
</ul>
<p>Each of these is divided into sub-sections. While a full Ganeti system
will need all of the steps specified, some are not strictly required for
every environment. Which ones they are, and why, is specified in the
corresponding sections.</p>
</div>
<div class="section" id="installing-the-base-system-and-base-components">
<h2><a class="toc-backref" href="#id5">Installing the base system and base components</a><a class="headerlink" href="#installing-the-base-system-and-base-components" title="Permalink to this headline"></a></h2>
<div class="section" id="hardware-requirements">
<h3><a class="toc-backref" href="#id6">Hardware requirements</a><a class="headerlink" href="#hardware-requirements" title="Permalink to this headline"></a></h3>
<p>Any system supported by your Linux distribution is fine. 64-bit systems
are better as they can support more memory.</p>
<p>Any disk drive recognized by Linux (<code class="docutils literal"><span class="pre">IDE</span></code>/<code class="docutils literal"><span class="pre">SCSI</span></code>/<code class="docutils literal"><span class="pre">SATA</span></code>/etc.) is
supported in Ganeti. Note that no shared storage (e.g. <code class="docutils literal"><span class="pre">SAN</span></code>) is
needed to get high-availability features (but of course, one can be used
to store the images). Whilte it is highly recommended to use more than
one disk drive in order to improve speed, Ganeti also works with one
disk per machine.</p>
</div>
<div class="section" id="installing-the-base-system">
<h3><a class="toc-backref" href="#id7">Installing the base system</a><a class="headerlink" href="#installing-the-base-system" title="Permalink to this headline"></a></h3>
<p><strong>Mandatory</strong> on all nodes.</p>
<p>It is advised to start with a clean, minimal install of the operating
system. The only requirement you need to be aware of at this stage is to
partition leaving enough space for a big (<strong>minimum</strong> 20GiB) LVM volume
group which will then host your instance filesystems, if you want to use
all Ganeti features. The volume group name Ganeti uses (by default) is
<code class="docutils literal"><span class="pre">xenvg</span></code>.</p>
<p>You can also use file-based storage only, without LVM, but this setup is
not detailed in this document.</p>
<p>If you choose to use RBD-based instances, there’s no need for LVM
provisioning. However, this feature is experimental, and is not yet
recommended for production clusters.</p>
<p>While you can use an existing system, please note that the Ganeti
installation is intrusive in terms of changes to the system
configuration, and it’s best to use a newly-installed system without
important data on it.</p>
<p>Also, for best results, it’s advised that the nodes have as much as
possible the same hardware and software configuration. This will make
administration much easier.</p>
<div class="section" id="hostname-issues">
<h4><a class="toc-backref" href="#id8">Hostname issues</a><a class="headerlink" href="#hostname-issues" title="Permalink to this headline"></a></h4>
<p>Note that Ganeti requires the hostnames of the systems (i.e. what the
<code class="docutils literal"><span class="pre">hostname</span></code> command outputs to be a fully-qualified name, not a short
name. In other words, you should use <em>node1.example.com</em> as a hostname
and not just <em>node1</em>.</p>
<div class="admonition-debian admonition">
<p class="first admonition-title">Debian</p>
<p>Debian usually configures the hostname differently than you need it
for Ganeti. For example, this is what it puts in <code class="docutils literal"><span class="pre">/etc/hosts</span></code> in
certain situations:</p>
<div class="highlight-shell-example"><div class="highlight"><pre><span></span>127.0.0.1       localhost
127.0.1.1       node1.example.com node1
</pre></div>
</div>
<p>but for Ganeti you need to have:</p>
<div class="highlight-shell-example"><div class="highlight"><pre><span></span>127.0.0.1       localhost
192.0.2.1       node1.example.com node1
</pre></div>
</div>
<p class="last">replacing <code class="docutils literal"><span class="pre">192.0.2.1</span></code> with your node’s address. Also, the file
<code class="docutils literal"><span class="pre">/etc/hostname</span></code> which configures the hostname of the system
should contain <code class="docutils literal"><span class="pre">node1.example.com</span></code> and not just <code class="docutils literal"><span class="pre">node1</span></code> (you
need to run the command <code class="docutils literal"><span class="pre">/etc/init.d/hostname.sh</span> <span class="pre">start</span></code> after
changing the file).</p>
</div>
<div class="admonition-why-a-fully-qualified-host-name admonition">
<p class="first admonition-title">Why a fully qualified host name</p>
<p>Although most distributions use only the short name in the
/etc/hostname file, we still think Ganeti nodes should use the full
name. The reason for this is that calling ‘hostname –fqdn’ requires
the resolver library to work and is a ‘guess’ via heuristics at what
is your domain name. Since Ganeti can be used among other things to
host DNS servers, we don’t want to depend on them as much as
possible, and we’d rather have the uname() syscall return the full
node name.</p>
<p class="last">We haven’t ever found any breakage in using a full hostname on a
Linux system, and anyway we recommend to have only a minimal
installation on Ganeti nodes, and to use instances (or other
dedicated machines) to run the rest of your network services. By
doing this you can change the /etc/hostname file to contain an FQDN
without the fear of breaking anything unrelated.</p>
</div>
</div>
</div>
<div class="section" id="installing-the-hypervisor">
<h3><a class="toc-backref" href="#id9">Installing The Hypervisor</a><a class="headerlink" href="#installing-the-hypervisor" title="Permalink to this headline"></a></h3>
<p><strong>Mandatory</strong> on all nodes.</p>
<p>While Ganeti is developed with the ability to modularly run on different
virtualization environments in mind the only two currently useable on a
live system are Xen and KVM. Supported Xen versions are: 3.0.3 and later
3.x versions, and 4.x (tested up to 4.1).  Supported KVM versions are 72
and above.</p>
<p>Please follow your distribution’s recommended way to install and set up
Xen, or install Xen from the upstream source, if you wish, following
their manual. For KVM, make sure you have a KVM-enabled kernel and the
KVM tools.</p>
<p>After installing Xen, you need to reboot into your new system. On some
distributions this might involve configuring GRUB appropriately, whereas
others will configure it automatically when you install the respective
kernels. For KVM no reboot should be necessary.</p>
<div class="admonition-xen-on-debian admonition">
<p class="first admonition-title">Xen on Debian</p>
<p class="last">Under Debian you can install the relevant <code class="docutils literal"><span class="pre">xen-linux-system</span></code>
package, which will pull in both the hypervisor and the relevant
kernel. Also, if you are installing a 32-bit system, you should
install the <code class="docutils literal"><span class="pre">libc6-xen</span></code> package (run <code class="docutils literal"><span class="pre">apt-get</span> <span class="pre">install</span>
<span class="pre">libc6-xen</span></code>).</p>
</div>
<div class="section" id="xen-settings">
<h4><a class="toc-backref" href="#id10">Xen settings</a><a class="headerlink" href="#xen-settings" title="Permalink to this headline"></a></h4>
<p>Depending on which toolstack you are using, the hypervisor parameter
<code class="docutils literal"><span class="pre">xen_cmd</span></code> has to be set to the matching value, either <code class="docutils literal"><span class="pre">xm</span></code> or
<code class="docutils literal"><span class="pre">xl</span></code>.</p>
<p>Some useful best practices for Xen are to restrict the amount of memory
dom0 has available, and pin the dom0 to a limited number of CPUs.
Instructions for how to achieve this for various toolstacks can be found
on the Xen <a class="reference external" href="http://wiki.xenproject.org/wiki/Xen_Project_Best_Practices">wiki</a>.</p>
<p>It is recommended that you disable Xen’s automatic save of virtual
machines at system shutdown and subsequent restore of them at reboot.
To obtain this make sure the variable <code class="docutils literal"><span class="pre">XENDOMAINS_SAVE</span></code> in the file
<code class="docutils literal"><span class="pre">/etc/default/xendomains</span></code> is set to an empty value.</p>
<p>You may need to restart the Xen daemon for some of these settings to
take effect. The best way to do this depends on your distribution.</p>
</div>
<div class="section" id="selecting-the-instance-kernel">
<h4><a class="toc-backref" href="#id11">Selecting the instance kernel</a><a class="headerlink" href="#selecting-the-instance-kernel" title="Permalink to this headline"></a></h4>
<p>After you have installed Xen, you need to tell Ganeti exactly what
kernel to use for the instances it will create. This is done by creating
a symlink from your actual kernel to <code class="docutils literal"><span class="pre">/boot/vmlinuz-3-xenU</span></code>, and one
from your initrd to <code class="docutils literal"><span class="pre">/boot/initrd-3-xenU</span></code> <a class="footnote-reference" href="#defkernel" id="id1">[1]</a>. Note that
if you don’t use an initrd for the domU kernel, you don’t need to create
the initrd symlink.</p>
<div class="admonition-debian admonition">
<p class="first admonition-title">Debian</p>
<p>After installation of the <code class="docutils literal"><span class="pre">xen-linux-system</span></code> package, you need to
run (replace the exact version number with the one you have):</p>
<div class="highlight-shell-example"><div class="highlight"><pre><span></span>$ <span class="gs">cd</span> <span class="gs">/boot</span>
$ <span class="gs">ln</span> <span class="gs">-s</span> <span class="gs">vmlinuz-</span><span class="nv">2.6.26-1</span><span class="gs">-xen-amd64</span> <span class="gs">vmlinuz-3-xenU</span>
$ <span class="gs">ln</span> <span class="gs">-s</span> <span class="gs">initrd.img-</span><span class="nv">2.6.26-1</span><span class="gs">-xen-amd64</span> <span class="gs">initrd-3-xenU</span>
</pre></div>
</div>
<p>By default, the initrd doesn’t contain the Xen block drivers needed
to mount the root device, so it is recommended to update the initrd
by following these two steps:</p>
<ul class="last simple">
<li>edit <code class="docutils literal"><span class="pre">/etc/initramfs-tools/modules</span></code> and add <code class="docutils literal"><span class="pre">xen_blkfront</span></code></li>
<li>run <code class="docutils literal"><span class="pre">update-initramfs</span> <span class="pre">-u</span></code></li>
</ul>
</div>
</div>
</div>
<div class="section" id="installing-drbd">
<h3><a class="toc-backref" href="#id12">Installing DRBD</a><a class="headerlink" href="#installing-drbd" title="Permalink to this headline"></a></h3>
<p>Recommended on all nodes: <a class="reference external" href="http://www.drbd.org/">DRBD</a> is required if you want to use the high
availability (HA) features of Ganeti, but optional if you don’t require
them or only run Ganeti on single-node clusters. You can upgrade a
non-HA cluster to an HA one later, but you might need to convert all
your instances to DRBD to take advantage of the new features.</p>
<p>Supported DRBD versions: 8.0-8.4. It’s recommended to have at least
version 8.0.12. Note that for version 8.2 and newer it is needed to pass
the <code class="docutils literal"><span class="pre">usermode_helper=/bin/true</span></code> parameter to the module, either by
configuring <code class="docutils literal"><span class="pre">/etc/modules</span></code> or when inserting it manually. When using
Xen and DRBD 8.3.2 or higher, it is <a class="reference external" href="https://drbd.linbit.com/users-guide/s-xen-drbd-mod-params.html">recommended</a> to use the
<code class="docutils literal"><span class="pre">disable_sendpage=1</span></code> setting as well.</p>
<p>Now the bad news: unless your distribution already provides it
installing DRBD might involve recompiling your kernel or anyway fiddling
with it. Hopefully at least the Xen-ified kernel source to start from
will be provided (if you intend to use Xen).</p>
<p>The good news is that you don’t need to configure DRBD at all. Ganeti
will do it for you for every instance you set up.  If you have the DRBD
utils installed and the module in your kernel you’re fine. Please check
that your system is configured to load the module at every boot, and
that it passes the following option to the module:
<code class="docutils literal"><span class="pre">minor_count=NUMBER</span></code>. We recommend that you use 128 as the value of
the minor_count - this will allow you to use up to 64 instances in total
per node (both primary and secondary, when using only one disk per
instance). You can increase the number up to 255 if you need more
instances on a node.</p>
<div class="admonition-debian admonition">
<p class="first admonition-title">Debian</p>
<p>On Debian, you can just install (build) the DRBD module with the
following commands, making sure you are running the target (Xen or
KVM) kernel:</p>
<div class="highlight-shell-example"><div class="highlight"><pre><span></span>$ <span class="gs">apt-get</span> <span class="gs">install</span> <span class="gs">drbd8-source</span> <span class="gs">drbd8-utils</span>
$ <span class="gs">m-a</span> <span class="gs">update</span>
$ <span class="gs">m-a</span> <span class="gs">a-i</span> <span class="gs">drbd8</span>
</pre></div>
</div>
<p>Or on newer versions, if the kernel already has modules:</p>
<blockquote>
<div>$ apt-get install drbd8-utils</div></blockquote>
<p>Then to configure it for Ganeti:</p>
<div class="highlight-shell-example"><div class="highlight"><pre><span></span>$ <span class="gs">echo</span> <span class="gs">&quot;options</span> <span class="gs">drbd</span> <span class="gs">minor_count=128</span> <span class="gs">usermode_helper=/bin/true&quot;</span> <span class="gs">\</span>
   <span class="gs">&gt;</span> <span class="gs">/etc/modprobe.d/drbd.conf</span>
$ <span class="gs">echo</span> <span class="gs">&quot;drbd&quot;</span> <span class="gs">&gt;&gt;</span> <span class="gs">/etc/modules</span>
$ <span class="gs">depmod</span> <span class="gs">-a</span>
$ <span class="gs">modprobe</span> <span class="gs">drbd</span>
</pre></div>
</div>
<p>It is also recommended that you comment out the default resources (if any)
in the <code class="docutils literal"><span class="pre">/etc/drbd.conf</span></code> file, so that the init script doesn’t try to
configure any drbd devices. You can do this by prefixing all
<em>resource</em> lines in the file with the keyword <em>skip</em>, like this:</p>
<div class="last highlight-text"><div class="highlight"><pre><span></span>skip {
  resource r0 {
    ...
  }
}

skip {
  resource &quot;r1&quot; {
    ...
  }
}
</pre></div>
</div>
</div>
</div>
<div class="section" id="installing-rbd">
<h3><a class="toc-backref" href="#id13">Installing RBD</a><a class="headerlink" href="#installing-rbd" title="Permalink to this headline"></a></h3>
<p>Recommended on all nodes: <a class="reference external" href="http://ceph.newdream.net/">RBD</a> is required if you want to create
instances with RBD disks residing inside a RADOS cluster (make use of
the rbd disk template). RBD-based instances can failover or migrate to
any other node in the ganeti cluster, enabling you to exploit of all
Ganeti’s high availabilily (HA) features.</p>
<div class="admonition attention">
<p class="first admonition-title">Attention</p>
<p class="last">Be careful though: rbd is still experimental! For now it is
recommended only for testing purposes.  No sensitive data should be
stored there.</p>
</div>
<p>You will need the <code class="docutils literal"><span class="pre">rbd</span></code> and <code class="docutils literal"><span class="pre">libceph</span></code> kernel modules, the RBD/Ceph
userspace utils (ceph-common Debian package) and an appropriate
Ceph/RADOS configuration file on every VM-capable node.</p>
<p>You will also need a working RADOS Cluster accessible by the above
nodes.</p>
<div class="section" id="rados-cluster">
<h4><a class="toc-backref" href="#id14">RADOS Cluster</a><a class="headerlink" href="#rados-cluster" title="Permalink to this headline"></a></h4>
<p>You will need a working RADOS Cluster accesible by all VM-capable nodes
to use the RBD template. For more information on setting up a RADOS
Cluster, refer to the <a class="reference external" href="http://ceph.newdream.net/">official docs</a>.</p>
<p>If you want to use a pool for storing RBD disk images other than the
default (<code class="docutils literal"><span class="pre">rbd</span></code>), you should first create the pool in the RADOS
Cluster, and then set the corresponding rbd disk parameter named
<code class="docutils literal"><span class="pre">pool</span></code>.</p>
</div>
<div class="section" id="kernel-modules">
<h4><a class="toc-backref" href="#id15">Kernel Modules</a><a class="headerlink" href="#kernel-modules" title="Permalink to this headline"></a></h4>
<p>Unless your distribution already provides it, you might need to compile
the <code class="docutils literal"><span class="pre">rbd</span></code> and <code class="docutils literal"><span class="pre">libceph</span></code> modules from source. You will need Linux
Kernel 3.2 or above for the kernel modules. Alternatively you will have
to build them as external modules (from Linux Kernel source 3.2 or
above), if you want to run a less recent kernel, or your kernel doesn’t
include them.</p>
</div>
<div class="section" id="userspace-utils">
<h4><a class="toc-backref" href="#id16">Userspace Utils</a><a class="headerlink" href="#userspace-utils" title="Permalink to this headline"></a></h4>
<p>The RBD template has been tested with <code class="docutils literal"><span class="pre">ceph-common</span></code> v0.38 and
above. We recommend using the latest version of <code class="docutils literal"><span class="pre">ceph-common</span></code>.</p>
<div class="admonition-debian admonition">
<p class="first admonition-title">Debian</p>
<p>On Debian, you can just install the RBD/Ceph userspace utils with
the following command:</p>
<div class="last highlight-shell-example"><div class="highlight"><pre><span></span>$ <span class="gs">apt-get</span> <span class="gs">install</span> <span class="gs">ceph-common</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="kvm-userspace-access">
<h4><a class="toc-backref" href="#id17">KVM userspace access</a><a class="headerlink" href="#kvm-userspace-access" title="Permalink to this headline"></a></h4>
<p>If your cluster uses a sufficiently new version of KVM (you will need at
least QEMU 0.14 with RBD support compiled in), you can take advantage of
KVM’s native support for ceph in order to have better performance and
avoid potential <a class="reference external" href="http://tracker.ceph.com/issues/3076">deadlocks</a> in low memory scenarios.</p>
<p>To initialize a cluster with support for this feature, use a command
like the following. Note, that you possibly need to follow the more
general installation instructions before invoking this command (see
<a class="reference internal" href="#initializing-the-cluster">Initializing the cluster</a> ).</p>
<blockquote>
<div><dl class="docutils">
<dt>$ gnt-cluster init </dt>
<dd>–enabled-disk-templates=rbd –ipolicy-disk-templates=rbd –enabled-hypervisors=kvm -D rbd:access=userspace</dd>
</dl>
</div></blockquote>
<p>(You may want to enable more templates than just <code class="docutils literal"><span class="pre">rbd</span></code>.)</p>
<p>You can also change this setting on a live cluster by giving the same
switches to <code class="docutils literal"><span class="pre">gnt-cluster</span> <span class="pre">modify</span></code>, or change those settings at the node
group level with <code class="docutils literal"><span class="pre">gnt-group</span> <span class="pre">modify</span></code>.</p>
</div>
<div class="section" id="configuration-file">
<h4><a class="toc-backref" href="#id18">Configuration file</a><a class="headerlink" href="#configuration-file" title="Permalink to this headline"></a></h4>
<p>You should also provide an appropriate configuration file
(<code class="docutils literal"><span class="pre">ceph.conf</span></code>) in <code class="docutils literal"><span class="pre">/etc/ceph</span></code>. For the rbd userspace utils, you’ll
only need to specify the IP addresses of the RADOS Cluster monitors.</p>
<div class="admonition-ceph-conf admonition">
<p class="first admonition-title">ceph.conf</p>
<p>Sample configuration file:</p>
<div class="last highlight-text"><div class="highlight"><pre><span></span>[mon.a]
       host = example_monitor_host1
       mon addr = 1.2.3.4:6789
[mon.b]
       host = example_monitor_host2
       mon addr = 1.2.3.5:6789
[mon.c]
       host = example_monitor_host3
       mon addr = 1.2.3.6:6789
</pre></div>
</div>
</div>
<p>For more information, please see the <a class="reference external" href="http://ceph.newdream.net/docs/latest/">Ceph Docs</a></p>
</div>
</div>
<div class="section" id="installing-gluster">
<h3><a class="toc-backref" href="#id19">Installing Gluster</a><a class="headerlink" href="#installing-gluster" title="Permalink to this headline"></a></h3>
<p>For Gluster integration, Ganeti requires that <code class="docutils literal"><span class="pre">mount.glusterfs</span></code> is
installed on each and every node. On Debian Wheezy and newer, you can
satisfy this requirement with the <code class="docutils literal"><span class="pre">glusterfs-client</span></code> package; see
<a class="reference external" href="http://gluster.org/community/documentation/index.php/Gluster_3.2:_Installing_the_Gluster_Native_Client">this guide</a>
for details.</p>
<div class="section" id="id2">
<h4><a class="toc-backref" href="#id20">KVM userspace access</a><a class="headerlink" href="#id2" title="Permalink to this headline"></a></h4>
<p>If your cluster uses a sufficiently new version of KVM (you will need at
least QEMU 1.3 with Gluster support compiled in), you can take advantage
of KVM’s native support for gluster in order to have better performance
and avoid potential deadlocks in low memory scenarios.</p>
<p>Please be aware that QEMU 1.3 was released in December 3, 2012, and as
such this feature is not available out of the box in any distribution
older than Ubuntu 13.04; this excludes Ubuntu 12.04 LTS and Debian
Wheezy.</p>
</div>
</div>
<div class="section" id="other-required-software">
<h3><a class="toc-backref" href="#id21">Other required software</a><a class="headerlink" href="#other-required-software" title="Permalink to this headline"></a></h3>
<p>Please install all software requirements mentioned in <a class="reference internal" href="install-quick.html"><span class="doc">Ganeti quick installation guide</span></a>.
If you want to build Ganeti from source, don’t forget to follow the steps
required for that as well.</p>
</div>
</div>
<div class="section" id="setting-up-the-environment-for-ganeti">
<h2><a class="toc-backref" href="#id22">Setting up the environment for Ganeti</a><a class="headerlink" href="#setting-up-the-environment-for-ganeti" title="Permalink to this headline"></a></h2>
<div class="section" id="configuring-the-network">
<h3><a class="toc-backref" href="#id23">Configuring the network</a><a class="headerlink" href="#configuring-the-network" title="Permalink to this headline"></a></h3>
<p><strong>Mandatory</strong> on all nodes.</p>
<p>You can run Ganeti either in “bridged mode”, “routed mode” or
“openvswitch mode”. In bridged mode, the default, the instances network
interfaces will be attached to a software bridge running in dom0. Xen by
default creates such a bridge at startup, but your distribution might
have a different way to do things, and you’ll definitely need to
manually set it up under KVM.</p>
<p>Beware that the default name Ganeti uses is <code class="docutils literal"><span class="pre">xen-br0</span></code> (which was used
in Xen 2.0) while Xen 3.0 uses <code class="docutils literal"><span class="pre">xenbr0</span></code> by default. See the
<a class="reference internal" href="#initializing-the-cluster">Initializing the cluster</a> section to learn how to choose a different
bridge, or not to use one at all and use “routed mode”.</p>
<p>In order to use “routed mode” under Xen, you’ll need to change the
relevant parameters in the Xen config file. Under KVM instead, no config
change is necessary, but you still need to set up your network
interfaces correctly.</p>
<p>By default, under KVM, the “link” parameter you specify per-nic will
represent, if non-empty, a different routing table name or number to use
for your instances. This allows isolation between different instance
groups, and different routing policies between node traffic and instance
traffic.</p>
<p>You will need to configure your routing table basic routes and rules
outside of ganeti. The vif scripts will only add /32 routes to your
instances, through their interface, in the table you specified (under
KVM, and in the main table under Xen).</p>
<p>Also for “openvswitch mode” under Xen a custom network script is needed.
Under KVM everything should work, but you’ll need to configure your
switches outside of Ganeti (as for bridges).</p>
<div class="admonition-bridging-issues-with-certain-kernels admonition">
<p class="first admonition-title">Bridging issues with certain kernels</p>
<p>Some kernel versions (e.g. 2.6.32) have an issue where the bridge
will automatically change its <code class="docutils literal"><span class="pre">MAC</span></code> address to the lower-numbered
slave on port addition and removal. This means that, depending on
the <code class="docutils literal"><span class="pre">MAC</span></code> address of the actual NIC on the node and the addresses
of the instances, it could be that starting, stopping or migrating
instances will lead to timeouts due to the address of the bridge
(and thus node itself) changing.</p>
<p>To prevent this, it’s enough to set the bridge manually to a
specific <code class="docutils literal"><span class="pre">MAC</span></code> address, which will disable this automatic address
change. In Debian, this can be done as follows in the bridge
configuration snippet:</p>
<div class="highlight-shell-example"><div class="highlight"><pre><span></span>up ip link set addr $(cat /sys/class/net/$IFACE/address) dev $IFACE
</pre></div>
</div>
<p class="last">which will “set” the bridge address to the initial one, disallowing
changes.</p>
</div>
<div class="admonition-bridging-under-debian admonition">
<p class="first admonition-title">Bridging under Debian</p>
<p>The recommended way to configure the Xen bridge is to edit your
<code class="docutils literal"><span class="pre">/etc/network/interfaces</span></code> file and substitute your normal
Ethernet stanza with the following snippet:</p>
<div class="last highlight-shell-example"><div class="highlight"><pre><span></span>auto xen-br0
iface xen-br0 inet static
   address <span class="nv">YOUR_IP_ADDRESS</span>
   netmask <span class="nv">YOUR_NETMASK</span>
   network <span class="nv">YOUR_NETWORK</span>
   broadcast <span class="nv">YOUR_BROADCAST_ADDRESS</span>
   gateway <span class="nv">YOUR_GATEWAY</span>
   bridge_ports eth0
   bridge_stp off
   bridge_fd 0
   <span class="c1"># example for setting manually the bridge address to the eth0 NIC</span>
   up ip link set addr $(cat /sys/class/net/eth0/address) dev $IFACE
</pre></div>
</div>
</div>
<p>The following commands need to be executed on the local console:</p>
<div class="highlight-shell-example"><div class="highlight"><pre><span></span>$ <span class="gs">ifdown</span> <span class="gs">eth0</span>
$ <span class="gs">ifup</span> <span class="gs">xen-br0</span>
</pre></div>
</div>
<p>To check if the bridge is setup, use the <code class="docutils literal"><span class="pre">ip</span></code> and <code class="docutils literal"><span class="pre">brctl</span> <span class="pre">show</span></code>
commands:</p>
<div class="highlight-shell-example"><div class="highlight"><pre><span></span>$ <span class="gs">ip</span> <span class="gs">a</span> <span class="gs">show</span> <span class="gs">xen-br0</span>
9: xen-br0: &lt;BROADCAST,MULTICAST,UP,10000&gt; mtu 1500 qdisc noqueue
    link/ether 00:20:fc:1e:d5:5d brd ff:ff:ff:ff:ff:ff
    inet 10.1.1.200/24 brd 10.1.1.255 scope global xen-br0
    inet6 fe80::220:fcff:fe1e:d55d/64 scope link
       valid_lft forever preferred_lft forever

$ <span class="gs">brctl</span> <span class="gs">show</span> <span class="gs">xen-br0</span>
bridge name     bridge id               STP enabled     interfaces
xen-br0         8000.0020fc1ed55d       no              eth0
</pre></div>
</div>
<p>In order to have a custom and more advanced networking configuration in Xen
which can vary among instances, after having successfully installed Ganeti
you have to create a symbolic link to the vif-script provided by Ganeti
inside /etc/xen/scripts (assuming you installed Ganeti under /usr/lib):</p>
<div class="highlight-shell-example"><div class="highlight"><pre><span></span>$ <span class="gs">ln</span> <span class="gs">-s</span> <span class="gs">/usr/lib/ganeti/vif-ganeti</span> <span class="gs">/etc/xen/scripts/vif-ganeti</span>
</pre></div>
</div>
<p>This has to be done on all nodes. Afterwards you can set the <code class="docutils literal"><span class="pre">vif_script</span></code>
hypervisor parameter to point to that script by:</p>
<div class="highlight-shell-example"><div class="highlight"><pre><span></span>$ <span class="gs">gnt-cluster</span> <span class="gs">modify</span> <span class="gs">-H</span> <span class="gs">xen-pvm:vif_script=/etc/xen/scripts/vif-ganeti</span>
</pre></div>
</div>
<p>Having this hypervisor parameter you are able to create your own scripts
and create instances with different networking configurations.</p>
</div>
<div class="section" id="configuring-lvm">
<span id="configure-lvm-label"></span><h3><a class="toc-backref" href="#id24">Configuring LVM</a><a class="headerlink" href="#configuring-lvm" title="Permalink to this headline"></a></h3>
<p><strong>Mandatory</strong> on all nodes.</p>
<p>The volume group is required to be at least 20GiB.</p>
<p>If you haven’t configured your LVM volume group at install time you need
to do it before trying to initialize the Ganeti cluster. This is done by
formatting the devices/partitions you want to use for it and then adding
them to the relevant volume group:</p>
<div class="highlight-shell-example"><div class="highlight"><pre><span></span>$ <span class="gs">pvcreate</span> <span class="gs">/dev/</span><span class="nv">sda3</span>
$ <span class="gs">vgcreate</span> <span class="gs">xenvg</span> <span class="gs">/dev/</span><span class="nv">sda3</span>
</pre></div>
</div>
<p>or:</p>
<div class="highlight-shell-example"><div class="highlight"><pre><span></span>$ <span class="gs">pvcreate</span> <span class="gs">/dev/</span><span class="nv">sdb1</span>
$ <span class="gs">pvcreate</span> <span class="gs">/dev/</span><span class="nv">sdc1</span>
$ <span class="gs">vgcreate</span> <span class="gs">xenvg</span> <span class="gs">/dev/</span><span class="nv">sdb1</span> <span class="gs">/dev/</span><span class="nv">sdc1</span>
</pre></div>
</div>
<p>If you want to add a device later you can do so with the <em>vgextend</em>
command:</p>
<div class="highlight-shell-example"><div class="highlight"><pre><span></span>$ <span class="gs">pvcreate</span> <span class="gs">/dev/</span><span class="nv">sdd1</span>
$ <span class="gs">vgextend</span> <span class="gs">xenvg</span> <span class="gs">/dev/</span><span class="nv">sdd1</span>
</pre></div>
</div>
<p>Optional: it is recommended to configure LVM not to scan the DRBD
devices for physical volumes. This can be accomplished by editing
<code class="docutils literal"><span class="pre">/etc/lvm/lvm.conf</span></code> and adding the <code class="docutils literal"><span class="pre">/dev/drbd[0-9]+</span></code> regular
expression to the <code class="docutils literal"><span class="pre">filter</span></code> variable, like this:</p>
<div class="highlight-text"><div class="highlight"><pre><span></span>filter = [&quot;r|/dev/cdrom|&quot;, &quot;r|/dev/drbd[0-9]+|&quot; ]
</pre></div>
</div>
<p>Note that with Ganeti a helper script is provided - <code class="docutils literal"><span class="pre">lvmstrap</span></code> which
will erase and configure as LVM any not in-use disk on your system. This
is dangerous and it’s recommended to read its <code class="docutils literal"><span class="pre">--help</span></code> output if you
want to use it.</p>
</div>
<div class="section" id="installing-ganeti">
<h3><a class="toc-backref" href="#id25">Installing Ganeti</a><a class="headerlink" href="#installing-ganeti" title="Permalink to this headline"></a></h3>
<p><strong>Mandatory</strong> on all nodes.</p>
<p>It’s now time to install the Ganeti software itself.  Download the
source from the project page at <a class="reference external" href="http://downloads.ganeti.org/releases/">http://downloads.ganeti.org/releases/</a>,
and install it (replace 2.6.0 with the latest version):</p>
<div class="highlight-shell-example"><div class="highlight"><pre><span></span>$ <span class="gs">tar</span> <span class="gs">xvzf</span> <span class="gs">ganeti-</span><span class="nv">2.6.0</span><span class="gs">.tar.gz</span>
$ <span class="gs">cd</span> <span class="gs">ganeti-</span><span class="nv">2.6.0</span>
$ <span class="gs">./configure</span> <span class="gs">--localstatedir=/var</span> <span class="gs">--sysconfdir=/etc</span>
$ <span class="gs">make</span>
$ <span class="gs">make</span> <span class="gs">install</span>
$ <span class="gs">mkdir</span> <span class="gs">/srv/ganeti/</span> <span class="gs">/srv/ganeti/os</span> <span class="gs">/srv/ganeti/export</span>
</pre></div>
</div>
<p>You also need to copy the file <code class="docutils literal"><span class="pre">doc/examples/ganeti.initd</span></code> from the
source archive to <code class="docutils literal"><span class="pre">/etc/init.d/ganeti</span></code> and register it with your
distribution’s startup scripts, for example in Debian:</p>
<div class="highlight-shell-example"><div class="highlight"><pre><span></span>$ <span class="gs">chmod</span> <span class="gs">+x</span> <span class="gs">/etc/init.d/ganeti</span>
$ <span class="gs">update-rc.d</span> <span class="gs">ganeti</span> <span class="gs">defaults</span> <span class="gs">20</span> <span class="gs">80</span>
</pre></div>
</div>
<p>In order to automatically restart failed instances, you need to setup a
cron job run the <em>ganeti-watcher</em> command. A sample cron file is
provided in the source at <code class="docutils literal"><span class="pre">doc/examples/ganeti.cron</span></code> and you can copy
that (eventually altering the path) to <code class="docutils literal"><span class="pre">/etc/cron.d/ganeti</span></code>. Finally,
a sample logrotate snippet is provided in the source at
<code class="docutils literal"><span class="pre">doc/examples/ganeti.logrotate</span></code> and you can copy it to
<code class="docutils literal"><span class="pre">/etc/logrotate.d/ganeti</span></code> to have Ganeti’s logs rotated automatically.</p>
<div class="section" id="what-gets-installed">
<h4><a class="toc-backref" href="#id26">What gets installed</a><a class="headerlink" href="#what-gets-installed" title="Permalink to this headline"></a></h4>
<p>The above <code class="docutils literal"><span class="pre">make</span> <span class="pre">install</span></code> invocation, or installing via your
distribution mechanisms, will install on the system:</p>
<ul class="simple">
<li>a set of python libraries under the <em>ganeti</em> namespace (depending on
the python version this can be located in either
<code class="docutils literal"><span class="pre">lib/python-$ver/site-packages</span></code> or various other locations)</li>
<li>a set of programs under <code class="docutils literal"><span class="pre">/usr/local/sbin</span></code> or <code class="docutils literal"><span class="pre">/usr/sbin</span></code></li>
<li>if the htools component was enabled, a set of programs under
<code class="docutils literal"><span class="pre">/usr/local/bin</span></code> or <code class="docutils literal"><span class="pre">/usr/bin/</span></code></li>
<li>man pages for the above programs</li>
<li>a set of tools under the <code class="docutils literal"><span class="pre">lib/ganeti/tools</span></code> directory</li>
<li>an example iallocator script (see the admin guide for details) under
<code class="docutils literal"><span class="pre">lib/ganeti/iallocators</span></code></li>
<li>a cron job that is needed for cluster maintenance</li>
<li>an init script for automatic startup of Ganeti daemons</li>
<li>provided but not installed automatically by <code class="docutils literal"><span class="pre">make</span> <span class="pre">install</span></code> is a bash
completion script that hopefully will ease working with the many
cluster commands</li>
</ul>
</div>
</div>
<div class="section" id="installing-the-operating-system-support-packages">
<h3><a class="toc-backref" href="#id27">Installing the Operating System support packages</a><a class="headerlink" href="#installing-the-operating-system-support-packages" title="Permalink to this headline"></a></h3>
<p><strong>Mandatory</strong> on all nodes.</p>
<p>To be able to install instances you need to have an Operating System
installation script. An example OS that works under Debian and can
install Debian and Ubuntu instace OSes is provided on the project web
site.  Download it from the project page and follow the instructions in
the <code class="docutils literal"><span class="pre">README</span></code> file.  Here is the installation procedure (replace 0.14
with the latest version that is compatible with your ganeti version):</p>
<div class="highlight-shell-example"><div class="highlight"><pre><span></span>$ <span class="gs">cd</span> <span class="gs">/usr/local/src/</span>
$ <span class="gs">wget</span> <span class="gs">http://ganeti.googlecode.com/files/ganeti-instance-debootstrap-</span><span class="nv">0.14</span><span class="gs">.tar.gz</span>
$ <span class="gs">tar</span> <span class="gs">xzf</span> <span class="gs">ganeti-instance-debootstrap-</span><span class="nv">0.14</span><span class="gs">.tar.gz</span>
$ <span class="gs">cd</span> <span class="gs">ganeti-instance-debootstrap-</span><span class="nv">0.14</span>
$ <span class="gs">./configure</span> <span class="gs">--with-os-dir=/srv/ganeti/os</span>
$ <span class="gs">make</span>
$ <span class="gs">make</span> <span class="gs">install</span>
</pre></div>
</div>
<p>In order to use this OS definition, you need to have internet access
from your nodes and have the <em>debootstrap</em>, <em>dump</em> and <em>restore</em>
commands installed on all nodes. Also, if the OS is configured to
partition the instance’s disk in
<code class="docutils literal"><span class="pre">/etc/default/ganeti-instance-debootstrap</span></code>, you will need <em>kpartx</em>
installed.</p>
<div class="admonition-debian admonition">
<p class="first admonition-title">Debian</p>
<p>Use this command on all nodes to install the required packages:</p>
<div class="highlight-shell-example"><div class="highlight"><pre><span></span>$ <span class="gs">apt-get</span> <span class="gs">install</span> <span class="gs">debootstrap</span> <span class="gs">dump</span> <span class="gs">kpartx</span>
</pre></div>
</div>
<p>Or alternatively install the OS definition from the Debian package:</p>
<div class="last highlight-shell-example"><div class="highlight"><pre><span></span>$ <span class="gs">apt-get</span> <span class="gs">install</span> <span class="gs">ganeti-instance-debootstrap</span>
</pre></div>
</div>
</div>
<div class="admonition-kvm admonition">
<p class="first admonition-title">KVM</p>
<p>In order for debootstrap instances to be able to shutdown cleanly
they must install have basic ACPI support inside the instance. Which
packages are needed depend on the exact flavor of Debian or Ubuntu
which you’re installing, but the example defaults file has a
commented out configuration line that works for Debian Lenny and
Squeeze:</p>
<div class="highlight-shell-example"><div class="highlight"><pre><span></span>EXTRA_PKGS=&quot;acpi-support-base,console-tools,udev&quot;
</pre></div>
</div>
<p class="last"><code class="docutils literal"><span class="pre">kbd</span></code> can be used instead of <code class="docutils literal"><span class="pre">console-tools</span></code>, and more packages
can be added, of course, if needed.</p>
</div>
<p>Please refer to the <code class="docutils literal"><span class="pre">README</span></code> file of <code class="docutils literal"><span class="pre">ganeti-instance-debootstrap</span></code> for
further documentation.</p>
<p>Alternatively, you can create your own OS definitions. See the manpage
<em class="manpage">ganeti-os-interface(7)</em>.</p>
</div>
<div class="section" id="initializing-the-cluster">
<h3><a class="toc-backref" href="#id28">Initializing the cluster</a><a class="headerlink" href="#initializing-the-cluster" title="Permalink to this headline"></a></h3>
<p><strong>Mandatory</strong> once per cluster, on the first node.</p>
<p>The last step is to initialize the cluster. After you have repeated the
above process on all of your nodes and choose one as the master. Make sure
there is a SSH key pair on the master node (optionally generating one using
<code class="docutils literal"><span class="pre">ssh-keygen</span></code>). Finally execute:</p>
<div class="highlight-shell-example"><div class="highlight"><pre><span></span>$ <span class="gs">gnt-cluster</span> <span class="gs">init</span> <span class="nv">CLUSTERNAME</span>
</pre></div>
</div>
<p>The <em>CLUSTERNAME</em> is a hostname, which must be resolvable (e.g. it must
exist in DNS or in <code class="docutils literal"><span class="pre">/etc/hosts</span></code>) by all the nodes in the cluster. You
must choose a name different from any of the nodes names for a
multi-node cluster. In general the best choice is to have a unique name
for a cluster, even if it consists of only one machine, as you will be
able to expand it later without any problems. Please note that the
hostname used for this must resolve to an IP address reserved
<strong>exclusively</strong> for this purpose, and cannot be the name of the first
(master) node.</p>
<p>If you want to use a bridge which is not <code class="docutils literal"><span class="pre">xen-br0</span></code>, or no bridge at
all, change it with the <code class="docutils literal"><span class="pre">--nic-parameters</span></code> option. For example to
bridge on br0 you can add:</p>
<div class="highlight-shell-example"><div class="highlight"><pre><span></span>--nic-parameters link=br0
</pre></div>
</div>
<p>Or to not bridge at all, and use a separate routing table:</p>
<div class="highlight-shell-example"><div class="highlight"><pre><span></span>--nic-parameters mode=routed,link=100
</pre></div>
</div>
<p>If you don’t have a <code class="docutils literal"><span class="pre">xen-br0</span></code> interface you also have to specify a
different network interface which will get the cluster IP, on the master
node, by using the <code class="docutils literal"><span class="pre">--master-netdev</span> <span class="pre">&lt;device&gt;</span></code> option.</p>
<p>You can use a different name than <code class="docutils literal"><span class="pre">xenvg</span></code> for the volume group (but
note that the name must be identical on all nodes). In this case you
need to specify it by passing the <em>–vg-name &lt;VGNAME&gt;</em> option to
<code class="docutils literal"><span class="pre">gnt-cluster</span> <span class="pre">init</span></code>.</p>
<p>To set up the cluster as an Xen HVM cluster, use the
<code class="docutils literal"><span class="pre">--enabled-hypervisors=xen-hvm</span></code> option to enable the HVM hypervisor
(you can also add <code class="docutils literal"><span class="pre">,xen-pvm</span></code> to enable the PVM one too). You will also
need to create the VNC cluster password file
<code class="docutils literal"><span class="pre">/etc/ganeti/vnc-cluster-password</span></code> which contains one line with the
default VNC password for the cluster.</p>
<p>To setup the cluster for KVM-only usage (KVM and Xen cannot be mixed),
pass <code class="docutils literal"><span class="pre">--enabled-hypervisors=kvm</span></code> to the init command.</p>
<p>You can also invoke the command with the <code class="docutils literal"><span class="pre">--help</span></code> option in order to
see all the possibilities.</p>
<div class="section" id="hypervisor-network-cluster-parameters">
<h4><a class="toc-backref" href="#id29">Hypervisor/Network/Cluster parameters</a><a class="headerlink" href="#hypervisor-network-cluster-parameters" title="Permalink to this headline"></a></h4>
<p>Please note that the default hypervisor/network/cluster parameters may
not be the correct one for your environment. Carefully check them, and
change them either at cluster init time, or later with <code class="docutils literal"><span class="pre">gnt-cluster</span>
<span class="pre">modify</span></code>.</p>
<p>Your instance types, networking environment, hypervisor type and version
may all affect what kind of parameters should be used on your cluster.</p>
<div class="admonition-kvm admonition">
<p class="first admonition-title">KVM</p>
<p>Instances are by default configured to use a host kernel, and to be
reached via serial console, which works nice for Linux paravirtualized
instances. If you want fully virtualized instances you may want to
handle their kernel inside the instance, and to use VNC.</p>
<p class="last">Some versions of KVM have a bug that will make an instance hang when
configured to use the serial console (which is the default) unless a
connection is made to it within about 2 seconds of the instance’s
startup. For such case it’s recommended to disable the
<code class="docutils literal"><span class="pre">serial_console</span></code> option.</p>
</div>
</div>
</div>
<div class="section" id="joining-the-nodes-to-the-cluster">
<h3><a class="toc-backref" href="#id30">Joining the nodes to the cluster</a><a class="headerlink" href="#joining-the-nodes-to-the-cluster" title="Permalink to this headline"></a></h3>
<p><strong>Mandatory</strong> for all the other nodes.</p>
<p>After you have initialized your cluster you need to join the other nodes
to it. You can do so by executing the following command on the master
node:</p>
<div class="highlight-shell-example"><div class="highlight"><pre><span></span>$ <span class="gs">gnt-node</span> <span class="gs">add</span> <span class="nv">NODENAME</span>
</pre></div>
</div>
</div>
<div class="section" id="separate-replication-network">
<h3><a class="toc-backref" href="#id31">Separate replication network</a><a class="headerlink" href="#separate-replication-network" title="Permalink to this headline"></a></h3>
<p><strong>Optional</strong></p>
<p>Ganeti uses DRBD to mirror the disk of the virtual instances between
nodes. To use a dedicated network interface for this (in order to
improve performance or to enhance security) you need to configure an
additional interface for each node.  Use the <em>-s</em> option with
<code class="docutils literal"><span class="pre">gnt-cluster</span> <span class="pre">init</span></code> and <code class="docutils literal"><span class="pre">gnt-node</span> <span class="pre">add</span></code> to specify the IP address of
this secondary interface to use for each node. Note that if you
specified this option at cluster setup time, you must afterwards use it
for every node add operation.</p>
</div>
<div class="section" id="testing-the-setup">
<h3><a class="toc-backref" href="#id32">Testing the setup</a><a class="headerlink" href="#testing-the-setup" title="Permalink to this headline"></a></h3>
<p>Execute the <code class="docutils literal"><span class="pre">gnt-node</span> <span class="pre">list</span></code> command to see all nodes in the cluster:</p>
<div class="highlight-shell-example"><div class="highlight"><pre><span></span>$ <span class="gs">gnt-node</span> <span class="gs">list</span>
Node              DTotal  DFree MTotal MNode MFree Pinst Sinst
node1.example.com 197404 197404   2047  1896   125     0     0
</pre></div>
</div>
<p>The above shows a couple of things:</p>
<ul class="simple">
<li>The various Ganeti daemons can talk to each other</li>
<li>Ganeti can examine the storage of the node (DTotal/DFree)</li>
<li>Ganeti can talk to the selected hypervisor (MTotal/MNode/MFree)</li>
</ul>
<div class="section" id="cluster-burnin">
<h4><a class="toc-backref" href="#id33">Cluster burnin</a><a class="headerlink" href="#cluster-burnin" title="Permalink to this headline"></a></h4>
<p>With Ganeti a tool called <strong class="command">burnin</strong> is provided that can test
most of the Ganeti functionality. The tool is installed under the
<code class="docutils literal"><span class="pre">lib/ganeti/tools</span></code> directory (either under <code class="docutils literal"><span class="pre">/usr</span></code> or <code class="docutils literal"><span class="pre">/usr/local</span></code>
based on the installation method). See more details under
<a class="reference internal" href="admin.html#burnin-label"><span class="std std-ref">burnin</span></a>.</p>
</div>
</div>
</div>
<div class="section" id="further-steps">
<h2><a class="toc-backref" href="#id34">Further steps</a><a class="headerlink" href="#further-steps" title="Permalink to this headline"></a></h2>
<p>You can now proceed either to the <a class="reference internal" href="admin.html"><span class="doc">Ganeti administrator’s guide</span></a>, or read the manpages of
the various commands (<em class="manpage">ganeti(7)</em>, <em class="manpage">gnt-cluster(8)</em>,
<em class="manpage">gnt-node(8)</em>, <em class="manpage">gnt-instance(8)</em>,
<em class="manpage">gnt-job(8)</em>).</p>
<p class="rubric">Footnotes</p>
<table class="docutils footnote" frame="void" id="defkernel" rules="none">
<colgroup><col class="label" /><col /></colgroup>
<tbody valign="top">
<tr><td class="label"><a class="fn-backref" href="#id1">[1]</a></td><td>The kernel and initrd paths can be changed at either
cluster level (which changes the default for all instances) or at
instance level.</td></tr>
</tbody>
</table>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Ganeti installation tutorial</a><ul>
<li><a class="reference internal" href="#introduction">Introduction</a></li>
<li><a class="reference internal" href="#installing-the-base-system-and-base-components">Installing the base system and base components</a><ul>
<li><a class="reference internal" href="#hardware-requirements">Hardware requirements</a></li>
<li><a class="reference internal" href="#installing-the-base-system">Installing the base system</a><ul>
<li><a class="reference internal" href="#hostname-issues">Hostname issues</a></li>
</ul>
</li>
<li><a class="reference internal" href="#installing-the-hypervisor">Installing The Hypervisor</a><ul>
<li><a class="reference internal" href="#xen-settings">Xen settings</a></li>
<li><a class="reference internal" href="#selecting-the-instance-kernel">Selecting the instance kernel</a></li>
</ul>
</li>
<li><a class="reference internal" href="#installing-drbd">Installing DRBD</a></li>
<li><a class="reference internal" href="#installing-rbd">Installing RBD</a><ul>
<li><a class="reference internal" href="#rados-cluster">RADOS Cluster</a></li>
<li><a class="reference internal" href="#kernel-modules">Kernel Modules</a></li>
<li><a class="reference internal" href="#userspace-utils">Userspace Utils</a></li>
<li><a class="reference internal" href="#kvm-userspace-access">KVM userspace access</a></li>
<li><a class="reference internal" href="#configuration-file">Configuration file</a></li>
</ul>
</li>
<li><a class="reference internal" href="#installing-gluster">Installing Gluster</a><ul>
<li><a class="reference internal" href="#id2">KVM userspace access</a></li>
</ul>
</li>
<li><a class="reference internal" href="#other-required-software">Other required software</a></li>
</ul>
</li>
<li><a class="reference internal" href="#setting-up-the-environment-for-ganeti">Setting up the environment for Ganeti</a><ul>
<li><a class="reference internal" href="#configuring-the-network">Configuring the network</a></li>
<li><a class="reference internal" href="#configuring-lvm">Configuring LVM</a></li>
<li><a class="reference internal" href="#installing-ganeti">Installing Ganeti</a><ul>
<li><a class="reference internal" href="#what-gets-installed">What gets installed</a></li>
</ul>
</li>
<li><a class="reference internal" href="#installing-the-operating-system-support-packages">Installing the Operating System support packages</a></li>
<li><a class="reference internal" href="#initializing-the-cluster">Initializing the cluster</a><ul>
<li><a class="reference internal" href="#hypervisor-network-cluster-parameters">Hypervisor/Network/Cluster parameters</a></li>
</ul>
</li>
<li><a class="reference internal" href="#joining-the-nodes-to-the-cluster">Joining the nodes to the cluster</a></li>
<li><a class="reference internal" href="#separate-replication-network">Separate replication network</a></li>
<li><a class="reference internal" href="#testing-the-setup">Testing the setup</a><ul>
<li><a class="reference internal" href="#cluster-burnin">Cluster burnin</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#further-steps">Further steps</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="iallocator.html"
                        title="previous chapter">Ganeti automatic instance allocation</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="install-quick.html"
                        title="next chapter">Ganeti quick installation guide</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="_sources/install.rst.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <form class="search" action="search.html" method="get">
      <div><input type="text" name="q" /></div>
      <div><input type="submit" value="Go" /></div>
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="install-quick.html" title="Ganeti quick installation guide"
             >next</a></li>
        <li class="right" >
          <a href="iallocator.html" title="Ganeti automatic instance allocation"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="index.html">Ganeti 2.16.0~rc2 documentation</a> &#187;</li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
        &#169; Copyright 2018, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015 Google Inc..
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.7.
    </div>
  </body>
</html>