Statistics
| Branch: | Revision:

root / README @ 79224631

History | View | Annotate | Download (6.1 kB)

1 79224631 Lance Albertson
ganeti-instance-debootstrap
2 79224631 Lance Albertson
===========================
3 79224631 Lance Albertson
4 79224631 Lance Albertson
This is a guest OS definition for Ganeti (http://code.google.com/p/ganeti).
5 79224631 Lance Albertson
It will install a minimal version of Debian or Ubuntu via debootstrap (thus it
6 79224631 Lance Albertson
requires network access). This only works if you have a Debian-based node or
7 79224631 Lance Albertson
you have debootstrap installed by hand on another distribution.
8 79224631 Lance Albertson
9 79224631 Lance Albertson
Installation
10 79224631 Lance Albertson
------------
11 79224631 Lance Albertson
12 79224631 Lance Albertson
In order to install this package from source, you need to determine what
13 79224631 Lance Albertson
options ganeti itself has been configured with. If ganeti was built
14 79224631 Lance Albertson
directly from source, then the only place it looks for OS definitions is
15 79224631 Lance Albertson
``/srv/ganeti/os``, and you need to install the OS under it::
16 79224631 Lance Albertson
17 79224631 Lance Albertson
  ./configure --prefix=/usr --localstatedir=/var \
18 79224631 Lance Albertson
    --sysconfdir=/etc \
19 79224631 Lance Albertson
    --with-os-dir=/srv/ganeti/os
20 79224631 Lance Albertson
  make && make install
21 79224631 Lance Albertson
22 79224631 Lance Albertson
If ganeti was installed from a package, its default OS path should
23 79224631 Lance Albertson
already include /usr/share/ganeti/os, so you can just run::
24 79224631 Lance Albertson
25 79224631 Lance Albertson
  ./configure -prefix=/usr --localstatedir=/var \
26 79224631 Lance Albertson
    --sysconfdir=/etc
27 79224631 Lance Albertson
  make && make install
28 79224631 Lance Albertson
29 79224631 Lance Albertson
Note that you need to repeat this procedure on all nodes of the cluster.
30 79224631 Lance Albertson
31 79224631 Lance Albertson
The actual path that ganeti has been installed with can be determined by
32 79224631 Lance Albertson
looking for a file named _autoconf.py under a ganeti directory in the
33 79224631 Lance Albertson
python modules tree (e.g.
34 79224631 Lance Albertson
``/usr/lib/python2.4/site-packages/ganeti/_autoconf.py``). In this file,
35 79224631 Lance Albertson
a variable named OS_SEARCH_PATH will list all the directories in which
36 79224631 Lance Albertson
ganeti will look for OS definitions.
37 79224631 Lance Albertson
38 79224631 Lance Albertson
Configuration of instance creation
39 79224631 Lance Albertson
----------------------------------
40 79224631 Lance Albertson
41 79224631 Lance Albertson
The kind of instance created can be customized via a settings file. This
42 79224631 Lance Albertson
file is not installed by default, as the instance creation will work
43 79224631 Lance Albertson
without it. The creation scripts will look for it in
44 79224631 Lance Albertson
``$sysconfdir/default/ganeti-instance-debootstrap``, so if you have run
45 79224631 Lance Albertson
configure with the parameter ``--sysconfdir=/etc``, the final filename
46 79224631 Lance Albertson
will be ``/etc/default/ganeti-instance-debootstrap``.
47 79224631 Lance Albertson
48 79224631 Lance Albertson
The following settings will be examined in this file (see also the file
49 79224631 Lance Albertson
named 'defaults' in the source distribution for more details):
50 79224631 Lance Albertson
51 79224631 Lance Albertson
- PROXY: http proxy to use for non-cached installs
52 79224631 Lance Albertson
- MIRROR: the mirror to use if not the default one
53 79224631 Lance Albertson
- ARCH: either i386 or amd64, otherwise your current architecture will
54 79224631 Lance Albertson
  be used
55 79224631 Lance Albertson
- SUITE: the actual OS to be installed; the current default is Debian
56 79224631 Lance Albertson
  *lenny*, and you can choose any of the OSes supported deboostrap (on
57 79224631 Lance Albertson
  Debian, look into /usr/share/deboostrap/scripts)
58 79224631 Lance Albertson
- EXTRAPKGS: most OSes will need some extra packages installed to make
59 79224631 Lance Albertson
  them work nicely under Xen; the example file containts a few
60 79224631 Lance Albertson
  suggestions
61 79224631 Lance Albertson
- CUSTOMIZE_DIR: a directory containing customization script for the instance.
62 79224631 Lance Albertson
  (by default $sysconfdir/ganeti/instance-debootstrap.d) See "Customization of
63 79224631 Lance Albertson
  the instance" below.
64 79224631 Lance Albertson
- GENERATE_CACHE: if 'yes' (the default), the installation process will
65 79224631 Lance Albertson
  save and reuse a cache file to speed reinstalls (located under
66 79224631 Lance Albertson
  $localstatedir/cache/ganeti-instance-debootstrap)
67 79224631 Lance Albertson
- CLEAN_CACHE: if empty, the cached files will never be cleaned and thus
68 79224631 Lance Albertson
  the installation will definitely need to be updated after install;
69 79224631 Lance Albertson
  otherwise, the value of this variable will be taken as the number of
70 79224631 Lance Albertson
  days after which to remove the cache file; the default is 14 (two
71 79224631 Lance Albertson
  weeks)
72 79224631 Lance Albertson
- PARTITION_STYLE: if 'none' the device will be formatted directly, if 'msdos'
73 79224631 Lance Albertson
  a partition table will be installed on it. You need to have kpartx installed
74 79224631 Lance Albertson
  to use the 'msdos' option. The default is 'msdos' from Ganeti 2.0 onwards,
75 79224631 Lance Albertson
  but still 'none' if installing under Ganeti 1.2
76 79224631 Lance Albertson
77 79224631 Lance Albertson
Note that the settings file is important on the node that the instance
78 79224631 Lance Albertson
is installed on, not the cluster master. This is indeed not a very good
79 79224631 Lance Albertson
model of using this OS but currently the OS interface in ganeti is
80 79224631 Lance Albertson
limiting.
81 79224631 Lance Albertson
82 79224631 Lance Albertson
Customization of the instance
83 79224631 Lance Albertson
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
84 79224631 Lance Albertson
85 79224631 Lance Albertson
If run-parts is in the os create script, and the CUSTOMIZE_DIR (by default
86 79224631 Lance Albertson
$sysconfdir/ganeti/instance-debootstrap.d, /etc/ganeti/instance-debootstrap.d
87 79224631 Lance Albertson
if you configured the os with --sysconfdir=/etc) directory exists any
88 79224631 Lance Albertson
executable whose name matches the run-parts execution rules (quoting
89 79224631 Lance Albertson
run-parts(8): the  names  must consist entirely of upper and lower case
90 79224631 Lance Albertson
letters, digits, underscores, and hyphens) is executed to allow further
91 79224631 Lance Albertson
personalization of the installation. The following environment variables are
92 79224631 Lance Albertson
passed, in addition to the ones ganeti passes to the OS scripts:
93 79224631 Lance Albertson
94 79224631 Lance Albertson
TARGET: directory in which the filesystem is mounted
95 79224631 Lance Albertson
SUITE: suite installed by debootstrap (eg: lenny)
96 79224631 Lance Albertson
ARCH: target architecture
97 79224631 Lance Albertson
PARTITION_STYLE: style of the disk partitioning (see above)
98 79224631 Lance Albertson
EXTRA_PKGS: extra packages installed by debootstrap
99 79224631 Lance Albertson
BLOCKDEV: ganeti block device
100 79224631 Lance Albertson
FSYSDEV: device in which the filesystem resides (the one mounted in TARGET)
101 79224631 Lance Albertson
102 79224631 Lance Albertson
The scripts in CUSTOMIZE_DIR can exit with an error code to signal an error in
103 79224631 Lance Albertson
the instance creation, should they fail.
104 79224631 Lance Albertson
105 79224631 Lance Albertson
The scripts in CUSTOMIZE_DIR should not start any long-term processes or
106 79224631 Lance Albertson
daemons using this directory, otherwise the installation will fail because it
107 79224631 Lance Albertson
won't be able to umount the filesystem from the directory, and hand the
108 79224631 Lance Albertson
instance back to Ganeti.
109 79224631 Lance Albertson
110 79224631 Lance Albertson
111 79224631 Lance Albertson
Caching
112 79224631 Lance Albertson
~~~~~~~
113 79224631 Lance Albertson
114 79224631 Lance Albertson
As described above, the install process uses a cache file in order to
115 79224631 Lance Albertson
speed up repeated installs. If you only rarely do installs, this will
116 79224631 Lance Albertson
not matter to you, but if you want to install 10 instances in a row, the
117 79224631 Lance Albertson
difference will be visible.
118 79224631 Lance Albertson
119 79224631 Lance Albertson
The default settings are to generate a cache, and to clean it up after
120 79224631 Lance Albertson
two weeks.
121 79224631 Lance Albertson
122 79224631 Lance Albertson
Note that the cache will use one file per architecture per suite, so if
123 79224631 Lance Albertson
you install multiple suites there might be a non-trivial amount of space
124 79224631 Lance Albertson
used in the cache directory. It is safe to remove manually the files.
125 79224631 Lance Albertson
126 79224631 Lance Albertson
It is also possible, if done with care, to modify and regenerate the
127 79224631 Lance Albertson
cache file (which is simply a tar archive) in order to preseed your
128 79224631 Lance Albertson
installs with site-specific customizations.
129 79224631 Lance Albertson
130 79224631 Lance Albertson
Instance notes
131 79224631 Lance Albertson
--------------
132 79224631 Lance Albertson
133 79224631 Lance Albertson
The instance is a minimal install:
134 79224631 Lance Albertson
135 79224631 Lance Albertson
 - it has no password for root; simply login at the console
136 79224631 Lance Albertson
 - it has no network interfaces defined (besides lo); add your own
137 79224631 Lance Albertson
   definitions to /etc/network/interfaces
138 79224631 Lance Albertson
 - after configuring the network, it is recommended to run ``apt-get
139 79224631 Lance Albertson
   update`` so that signatures for the release files are picked up