Update the documentation
[snf-image-creator] / docs / install.rst
1 Installation
2 ^^^^^^^^^^^^
3
4 This guide describes how to install snf-image-creator on a Linux system. It is
5 highly recommended to have virtualization capable hardware. snf-image-creator
6 will work on processors that do not support virtualization but it will be slow.
7
8 Dependencies
9 ============
10
11 snf-image-creator depends on the following programs:
12
13  * Python 2 [http://www.python.org/]
14  * Python setuptools [http://pypi.python.org/pypi/setuptools]
15  * Python Dialog [http://pythondialog.sourceforge.net/]
16  * Python bindings for libguestfs [http://libguestfs.org/]
17  * Python interface to sendfile [http://pypi.python.org/pypi/pysendfile]
18  * pyparted [https://fedorahosted.org/pyparted/]
19  * rsync [http://rsync.samba.org/]
20  * ./kamaki [https://code.grnet.gr/projects/kamaki]
21  * Python sh (previously pbs) [https://github.com/amoffat/sh]
22  * ANSI colors for Python [http://pypi.python.org/pypi/ansicolors]
23  * progress [http://pypi.python.org/pypi/progress]
24
25 The above dependencies are resolved differently, depending on the installation
26 method you choose. There are two installation methods available:
27
28 #. `Installation using packages <#install-snf-image-creator-using-packages>`_ (currently only for Ubuntu and Arch Linux).
29
30 #. `Installation from source <#install-snf-image-creator-from-source>`_
31
32 Install snf-image-creator using packages
33 ========================================
34
35 Ubuntu
36 ------
37
38 For *Ubuntu 12.04 LTS* and *12.10* systems, you can use our official packages
39 found in *grnet/synnefo* Lauchpad PPA.
40
41 Add the synnefo PPA in your system:
42
43 .. code-block:: console
44
45    $ sudo apt-add-repository ppa:grnet/synnefo
46    $ sudo apt-get update
47
48 If *apt-add-repository* is missing, install *software-properties-common* first:
49
50 .. code-block:: console
51
52    $ sudo apt-get install software-properties-common
53
54 After the synnefo repository is set up, you should be able to list
55 snf-image-creator by calling:
56
57 .. code-block:: console
58
59    $ apt-cache showpkg snf-image-creator
60
61 Install the package by issuing:
62
63 .. code-block:: console
64
65    $ sudo apt-get install snf-image-creator
66
67 If you are using Ubuntu 12.10, also install libguestfs-tools:
68
69 .. code-block:: console
70
71    $ sudo apt-get install libguestfs-tools
72
73 .. note::
74    If you are asked during the installation to create/update a
75    "supermin appliance", choose "Yes".
76
77 .. warning::
78    In *Ubuntu 12.10* the current package of libguestfs (1.18-2) is broken. Take
79    a look at the open `bug report <https://bugs.launchpad.net/ubuntu/quantal/+source/libguestfs/+bug/1086974>`_.
80    Until version 1.18-2ubunut1 is out, you may workaround this problem by
81    creating a symlink like this:
82
83    *sudo ln -s /usr/lib/guestfs /usr/lib/x86_64-linux-gnu/guestfs*
84
85 Arch Linux
86 ----------
87
88 For *Arch Linux* there are **unofficial** packages in AUR:
89 https://aur.archlinux.org/packages/snf-image-creator/ kindly provided by
90 Axilleas Pipinellis <axilleas@archlinux.info>.
91
92 .. note::
93     Those packages are not maintained by the Synnefo development team.
94
95     Please direct package-specific questions to Axilleas Pipinellis <axilleas@archlinux.info>,
96     Cc: the Synnefo development team <synnefo-devel@googlegroups.com>
97
98 To install the package you may use *yaourt*. Create and install
99 the *yaourt* package:
100
101 .. code-block:: console
102
103    $ wget https://aur.archlinux.org/packages/pa/package-query/package-query.tar.gz
104    $ tar -xvf package-query.tar.gz
105    $ cd package-query
106    $ makepkg -s
107    $ pacman -U package-query-<VERSION>-<ARCH>.pkg.tar.xz
108    $ cd ..
109    $ wget https://aur.archlinux.org/packages/ya/yaourt/yaourt.tar.gz
110    $ tar -xvf yaourt.tar.gz
111    $ cd yaourt
112    $ makepkg -s
113    $ pacman -U yaourt-<VERSION>-<ARCH>.pkg.tar.xz
114
115 Install *snf-image-creator* using yaourt:
116
117 .. code-block:: console
118
119    $ yaourt -Sa snf-image-creator
120
121 Install snf-image-creator from source
122 =====================================
123
124 Manually install the following dependencies:
125
126  * Python 2 [http://www.python.org/]
127  * Python setuptools [http://pypi.python.org/pypi/setuptools]
128  * Python Dialog [http://pythondialog.sourceforge.net/]
129  * Python bindings for libguestfs [http://libguestfs.org/]
130  * Python interface to sendfile [http://pypi.python.org/pypi/pysendfile]
131  * pyparted [https://fedorahosted.org/pyparted/]
132  * rsync [http://rsync.samba.org/]
133
134 In Ubuntu you can do this using:
135  
136 .. code-block:: console
137
138    $ sudo apt-get install python-setuptools python-guestfs python-dialog \
139      python-sendfile python-parted rsync
140
141 If you are using Ubuntu 12.10 you also need to install libguestfs-tools:
142
143 .. code-block:: console
144
145    $ sudo apt-get install libguestfs-tools
146
147 .. note::
148    If you are asked during the installation to create/update a
149    "supermin appliance", choose "Yes".
150
151 Python Virtual Environment
152 --------------------------
153
154 Since snf-image-creator and the rest of its dependencies won't be installed
155 using packages, it's better to work in an isolated python virtual environment
156 (virtualenv).
157
158 Install the Virtual Python Environment builder:
159 http://pypi.python.org/pypi/virtualenv.
160
161 For Ubuntu use the following command:
162
163 .. code-block:: console
164
165    $ sudo apt-get install python-virtualenv
166
167 Then create a new python virtual environment:
168
169 .. code-block:: console
170
171    $ virtualenv --system-site-packages ~/image-creator-env
172
173 and activate it by executing:
174
175 .. code-block:: console
176
177    $ source ~/image-creator-env/bin/activate
178
179 You may later deactivate it using:
180
181 .. code-block:: console
182
183    $ deactivate
184
185 kamaki Installation
186 -------------------
187
188 Refer to `./kamaki documentation <http://docs.dev.grnet.gr/kamaki/latest/installation.html>`_
189 for instructions. You may install kamaki from source inside the virtualenv
190 you've created above or by using binary packages if they are available for your
191 distribution.
192
193 snf-image-creator Installation
194 ------------------------------
195
196 Download the latest snf-image-creator source package from
197 `here <https://code.grnet.gr/projects/snf-image-creator/files>`_ and install it
198 inside the virtualenv using the following commands:
199
200 .. code-block:: console
201
202    $ tar -xf snf_image_creator-<VERSION>.tar.gz
203    $ cd snf_image_creator-<VERSION>
204    $ python ./setup.py install
205
206 Alternatively, you can install the bleeding edge version of the software by
207 cloning its git repository:
208
209 .. code-block:: console
210
211    $ git clone https://code.grnet.gr/git/snf-image-creator
212    $ cd snf-image-creator
213    $ python ./setup.py install
214
215 To do the latter, you'll need to have git (http://git-scm.com/) installed.
216 For ubuntu this can be done using:
217
218 .. code-block:: console
219
220    $ sudo apt-get install git
221
222 .. warning::
223    Keep in mind that the bleeding edge version may be unstable or even
224    unusable.
225