Statistics
| Branch: | Tag: | Revision:

root / README.deploy @ 728e7d91

History | View | Annotate | Download (17.7 kB)

1 1c382247 Vangelis Koukis
README.deploy -- Instructions for a basic Synnefo deployment
2 bbd4f788 Georgios Gousios
3 03353341 Vangelis Koukis
This document describes the basic steps to obtain a basic, working Synnefo
4 03353341 Vangelis Koukis
deployment. It begins by examining the different node roles, then moves to the
5 03353341 Vangelis Koukis
installation and setup of distinct software components.
6 c807557e Vangelis Koukis
7 5949b704 Vangelis Koukis
It is current as of Synnefo v0.7.
8 03353341 Vangelis Koukis
9 03353341 Vangelis Koukis
10 03353341 Vangelis Koukis
Node types
11 03353341 Vangelis Koukis
===========
12 03353341 Vangelis Koukis
13 03353341 Vangelis Koukis
Nodes in a Synnefo deployment belong in one of the following types:
14 03353341 Vangelis Koukis
15 03353341 Vangelis Koukis
 * DB:
16 271baf11 Nikos Skalkotos
   A node [or more than one nodes, if using an HA configuration], running a DB
17 271baf11 Nikos Skalkotos
   engine supported by the Django ORM layer. The DB is the single source of
18 271baf11 Nikos Skalkotos
   truth for the servicing of API requests by Synnefo.
19 03353341 Vangelis Koukis
   Services: PostgreSQL / MySQL
20 03353341 Vangelis Koukis
21 03353341 Vangelis Koukis
 * APISERVER:
22 271baf11 Nikos Skalkotos
   A node running the implementation of the OpenStack API, in Django. Any number
23 271baf11 Nikos Skalkotos
   of APISERVERs can be used, in a load-balancing configuration, without any
24 271baf11 Nikos Skalkotos
   special consideration. Access to a common DB ensures consistency.
25 03353341 Vangelis Koukis
   Services: Web server, vncauthproxy
26 03353341 Vangelis Koukis
27 03353341 Vangelis Koukis
 * QUEUE:
28 271baf11 Nikos Skalkotos
   A node running the RabbitMQ software, which provides AMQP functionality. More
29 271baf11 Nikos Skalkotos
   than one QUEUE nodes may be deployed, in an HA configuration. Such
30 03353341 Vangelis Koukis
   deployments require shared storage, provided e.g., by DRBD.
31 03353341 Vangelis Koukis
   Services: RabbitMQ [rabbitmq-server]
32 03353341 Vangelis Koukis
33 03353341 Vangelis Koukis
 * LOGIC:
34 03353341 Vangelis Koukis
   A node running the business logic of Synnefo, in Django. It dequeues
35 271baf11 Nikos Skalkotos
   messages from QUEUE nodes, and provides the context in which business logic
36 271baf11 Nikos Skalkotos
   functions run. It uses Django ORM to connect to the common DB and update the
37 271baf11 Nikos Skalkotos
   state of the system, based on notifications received from the rest of the
38 271baf11 Nikos Skalkotos
   infrastructure, over AMQP.
39 03353341 Vangelis Koukis
   Services: the Synnefo logic dispatcher [/logic/dispatcher.py]
40 03353341 Vangelis Koukis
41 03353341 Vangelis Koukis
 * GANETI-MASTER and GANETI-NODE:
42 03353341 Vangelis Koukis
   A single GANETI-MASTER and a large number of GANETI-NODEs constitute the
43 03353341 Vangelis Koukis
   Ganeti backend for Synnefo, which undertakes all VM management functions.
44 03353341 Vangelis Koukis
   Any APISERVER can issue commands to the GANETI-MASTER, over RAPI, to effect
45 03353341 Vangelis Koukis
   changes in the state of the VMs. The GANETI-MASTER runs the Ganeti request
46 03353341 Vangelis Koukis
   queue.
47 03353341 Vangelis Koukis
   Services:
48 271baf11 Nikos Skalkotos
     only on GANETI-MASTER:
49 3d9ae008 Vangelis Koukis
       the Synnefo Ganeti monitoring daemon [/ganeti/snf-ganeti-eventd]
50 271baf11 Nikos Skalkotos
       the Synnefo Ganeti hook [/ganeti/snf-ganeti-hook.py].
51 271baf11 Nikos Skalkotos
     on each GANETI_NODE:
52 271baf11 Nikos Skalkotos
       a deployment-specific KVM ifup script
53 271baf11 Nikos Skalkotos
       properly configured NFDHCPD
54 03353341 Vangelis Koukis
55 03353341 Vangelis Koukis
56 03353341 Vangelis Koukis
Installation Process
57 03353341 Vangelis Koukis
=====================
58 03353341 Vangelis Koukis
59 271baf11 Nikos Skalkotos
This section describes the installation process of the various node roles in a
60 271baf11 Nikos Skalkotos
Synnefo deployment.
61 03353341 Vangelis Koukis
62 03353341 Vangelis Koukis
63 03353341 Vangelis Koukis
0. Allocation of physical nodes:
64 03353341 Vangelis Koukis
   Determine the role of every physical node in your deployment.
65 03353341 Vangelis Koukis
66 03353341 Vangelis Koukis
67 03353341 Vangelis Koukis
1. Ganeti installation:
68 03353341 Vangelis Koukis
   Synnefo requires a working Ganeti installation at the backend. Installation
69 03353341 Vangelis Koukis
   of Ganeti is not covered by this document, please refer to
70 03353341 Vangelis Koukis
   http://docs.ganeti.org/ganeti/current/html for all the gory details. A
71 03353341 Vangelis Koukis
   successful Ganeti installation concludes with a working GANETI-MASTER and a
72 03353341 Vangelis Koukis
   number of GANETI-NODEs.
73 03353341 Vangelis Koukis
74 03353341 Vangelis Koukis
75 03353341 Vangelis Koukis
2. RabbitMQ installation:
76 271baf11 Nikos Skalkotos
   RabbitMQ is used as a generic message broker for the system. It should be
77 271baf11 Nikos Skalkotos
   installed on two seperate QUEUE nodes (VMs should be enough for the moment)
78 271baf11 Nikos Skalkotos
   in a high availability configuration as described here:
79 03353341 Vangelis Koukis
80 03353341 Vangelis Koukis
     http://www.rabbitmq.com/pacemaker.html
81 03353341 Vangelis Koukis
82 03353341 Vangelis Koukis
   After installation, create a user and set its permissions
83 03353341 Vangelis Koukis
     rabbitmqctl add_user okeanos 0k3@n0s
84 03353341 Vangelis Koukis
     rabbitmqctl set_permissions -p / okeanos  "^.*" ".*" ".*"
85 03353341 Vangelis Koukis
86 03353341 Vangelis Koukis
   The values set for the user and password must be mirrored in the
87 03353341 Vangelis Koukis
   RABBIT_* variables in settings.py (see step 6)
88 03353341 Vangelis Koukis
89 03353341 Vangelis Koukis
90 03353341 Vangelis Koukis
3. Web server installation:
91 03353341 Vangelis Koukis
   A Web Server (e.g., Apache) needs to be installed on the APISERVERs,
92 271baf11 Nikos Skalkotos
   and be configured to run the Synnefo Django project appropriately. Selection
93 271baf11 Nikos Skalkotos
   and configuration of a Web server is outside the scope of this document.
94 03353341 Vangelis Koukis
95 03353341 Vangelis Koukis
   For testing or development purposes, Django's own development server,
96 271baf11 Nikos Skalkotos
   `./manage.py runserver' can be used.
97 03353341 Vangelis Koukis
98 03353341 Vangelis Koukis
99 03353341 Vangelis Koukis
4. Installation of the Synnefo Django project:
100 3d9ae008 Vangelis Koukis
   As of v0.5 the Synnefo Django project needs to be installed on nodes
101 02728a9a Vangelis Koukis
   of type APISERVER, and LOGIC, with a properly configured settings.py. In
102 02728a9a Vangelis Koukis
   later revisions, the specific parts of the Django project which need to run
103 02728a9a Vangelis Koukis
   on each node type will be identified.
104 03353341 Vangelis Koukis
105 271baf11 Nikos Skalkotos
   Synnefo is written in Python 2.6 and depends on the following Python modules:
106 271baf11 Nikos Skalkotos
   [package versions confirmed to be compatible are in braces]
107 c807557e Vangelis Koukis
108 c807557e Vangelis Koukis
    * django 1.2 [Django==1.2.4]
109 c807557e Vangelis Koukis
    * simplejson [simplejson==2.1.3]
110 c807557e Vangelis Koukis
    * pycurl [pycurl==7.19.0]
111 c807557e Vangelis Koukis
    * python-dateutil  [python-dateutil==1.4.1]
112 36cf1973 Vangelis Koukis
      WARNING: version python-dateutil==2.0 downloaded by pip known *not* to
113 36cf1973 Vangelis Koukis
               work with Python 2.6
114 92ab6b1c Vangelis Koukis
    * python-ipy [IPy==0.75]
115 92ab6b1c Vangelis Koukis
        also verified to work with python-ipy 0.70-1 as shipped with Squeeze
116 c807557e Vangelis Koukis
    * south [south==0.7.1]
117 b8498a99 Vangelis Koukis
      WARNING: might not work with Debian Squeeze's default south-0.7-1 package.
118 c807557e Vangelis Koukis
    * amqplib [amqplib==0.6.1]
119 4ed2e471 Georgios Gousios
    * lockfile [lockfile==0.8]
120 4ed2e471 Georgios Gousios
    * python-daemon [python-daemon==1.5.5]
121 b8498a99 Vangelis Koukis
    * python-prctl [python-prctl==1.3.0]
122 03353341 Vangelis Koukis
123 03353341 Vangelis Koukis
   also, depending on the database engine of choice, on one of the following:
124 c807557e Vangelis Koukis
    * MySQL-python [MySQL-python==1.2.3]
125 c807557e Vangelis Koukis
    * psycopg2 [psycopg2==2.4]
126 03353341 Vangelis Koukis
127 271baf11 Nikos Skalkotos
   if the invitations application is deployed, the following dependencies should
128 271baf11 Nikos Skalkotos
   be installed:
129 c807557e Vangelis Koukis
    * pycrypto==2.1.0
130 728e7d91 Vangelis Koukis
131 23f583a3 Kostas Papadimitriou
   for server side ssh key pair generation to work the following module is required:
132 23f583a3 Kostas Papadimitriou
    * M2Crypto==0.20.1
133 03353341 Vangelis Koukis
134 480051fe Vangelis Koukis
   The integration test suite snf-tools/snf-test depends on:
135 480051fe Vangelis Koukis
    * python-unittest2 [unittest2==0.5.1]
136 480051fe Vangelis Koukis
    * python-paramiko  [paramiko==1.7.6], version included in Debian Squeeze
137 480051fe Vangelis Koukis
      is broken wrt to use of RandomPool, see Debian bug #576697
138 480051fe Vangelis Koukis
    * python-ipy [IPy==0.75]
139 480051fe Vangelis Koukis
    * python-prctl [python-prctl==1.3.0]
140 480051fe Vangelis Koukis
    * the client component of vncauthproxy, see Step 12
141 480051fe Vangelis Koukis
    * the kamaki client library, please see
142 480051fe Vangelis Koukis
      https://code.grnet.gr/projects/kamaki for installation instructions.
143 480051fe Vangelis Koukis
      [FIXME: Update instructions on kamaki installation]
144 480051fe Vangelis Koukis
145 45e3d1ac Vangelis Koukis
   To run the user interface tests, selenium must be installed
146 c807557e Vangelis Koukis
    * selenium [?]
147 c807557e Vangelis Koukis
148 03353341 Vangelis Koukis
   The easiest method for installation of the Django project is to setup a
149 03353341 Vangelis Koukis
   working environment through virtualenv. Alternatively, you can use your
150 03353341 Vangelis Koukis
   system's package manager to install the dependencies (e.g. Macports has them
151 03353341 Vangelis Koukis
   all).
152 a06deab3 Vangelis Koukis
153 36cf1973 Vangelis Koukis
   * On Snow Leopard and linux (64-bit), you have to set the following
154 36cf1973 Vangelis Koukis
     environment variable for pip to compile the dependencies correctly.
155 a06deab3 Vangelis Koukis
156 03353341 Vangelis Koukis
  	   $ export ARCHFLAGS="-arch x86_64"
157 a06deab3 Vangelis Koukis
158 03353341 Vangelis Koukis
   * On Ubuntu, a few more packages must be installed before installing the
159 03353341 Vangelis Koukis
     prerequisite Python libraries
160 a06deab3 Vangelis Koukis
161 03353341 Vangelis Koukis
	   $ sudo aptitude install libcurl3-gnutls libcurl3-gnutls-dev uuid-dev
162 a06deab3 Vangelis Koukis
163 271baf11 Nikos Skalkotos
   Checkout the code and install the Python prerequisites. This assumes that
164 271baf11 Nikos Skalkotos
   python is already installed on the host.
165 a06deab3 Vangelis Koukis
166 03353341 Vangelis Koukis
    $ sudo easy_install virtualenv
167 03353341 Vangelis Koukis
    $ git clone https://user@code.grnet.gr/git/synnefo synnefo
168 03353341 Vangelis Koukis
    $ virtualenv --python=python2.6 synnefo --no-site-packages
169 03353341 Vangelis Koukis
    ...
170 03353341 Vangelis Koukis
    $ cd synnefo
171 03353341 Vangelis Koukis
    $ ./bin/pip install <list_of_dependencies>
172 fc2afa67 Vangelis Koukis
173 33f3103d Georgios Gousios
    [WARNING]: The software must be checked out in a directory named synnefo,
174 33f3103d Georgios Gousios
    otherwise python imports will not work. Therefore, do not change the
175 33f3103d Georgios Gousios
    or rename the checkout path.
176 a06deab3 Vangelis Koukis
177 937ac8bf Vangelis Koukis
178 03353341 Vangelis Koukis
5. Database installation:
179 03353341 Vangelis Koukis
   A database supported by the Django ORM layer must be installed on nodes
180 03353341 Vangelis Koukis
   of type DB. The choices are: SQLIte, MySQL, PostgreSQL.
181 a06deab3 Vangelis Koukis
182 03353341 Vangelis Koukis
   * SQLite:
183 36cf1973 Vangelis Koukis
     The python sqlite driver is available by default with Python so no
184 36cf1973 Vangelis Koukis
     additional configuration is required. Also, most self-respecting systems
185 36cf1973 Vangelis Koukis
     have the sqlite library installed by default.
186 03353341 Vangelis Koukis
187 271baf11 Nikos Skalkotos
   * MySQL:
188 03353341 Vangelis Koukis
      MySQL must be installed first:
189 03353341 Vangelis Koukis
190 03353341 Vangelis Koukis
      * Ubuntu - Debian
191 03353341 Vangelis Koukis
	      $ sudo apt-get install libmysqlclient-dev
192 03353341 Vangelis Koukis
193 03353341 Vangelis Koukis
      * MacPorts
194 03353341 Vangelis Koukis
	      $ sudo port install mysql5
195 03353341 Vangelis Koukis
196 03353341 Vangelis Koukis
      Install the MySQL python library on servers running the Django project:
197 a06deab3 Vangelis Koukis
198 03353341 Vangelis Koukis
	    $ bin/pip install MySQL-python
199 a06deab3 Vangelis Koukis
200 36cf1973 Vangelis Koukis
      Note: On MacOSX with Mysql install from MacPorts the above command will
201 271baf11 Nikos Skalkotos
            fail complaining that it cannot find the mysql_config command. Do
202 271baf11 Nikos Skalkotos
            the following and restart the installation
203 271baf11 Nikos Skalkotos
	        $ echo "mysql_config = /opt/local/bin/mysql_config5" >> \
204 271baf11 Nikos Skalkotos
                                         ./build/MySQL-python/site.cfg
205 7e8b41e7 Vangelis Koukis
206 03353341 Vangelis Koukis
      Configure a MySQL db/account for synnefo
207 03353341 Vangelis Koukis
	    $ mysql -u root -p
208 a06deab3 Vangelis Koukis
209 03353341 Vangelis Koukis
    	mysql> create database synnefo;
210 03353341 Vangelis Koukis
	    mysql> show databases;
211 03353341 Vangelis Koukis
	    mysql> GRANT ALL on synnefo.* TO username IDENTIFIED BY 'password';
212 fc2afa67 Vangelis Koukis
213 e71be688 Vangelis Koukis
     IMPORTANT:
214 e71be688 Vangelis Koukis
        MySQL *must* be set in READ-COMMITED mode, e.g. by setting
215 e71be688 Vangelis Koukis
216 e71be688 Vangelis Koukis
        transaction-isolation = READ-COMMITTED
217 e71be688 Vangelis Koukis
218 96b635d9 Vangelis Koukis
        in the [mysqld] section of /etc/mysql/my.cnf.
219 e71be688 Vangelis Koukis
220 96b635d9 Vangelis Koukis
        Alternatively, make sure the following code fragment stays enabled
221 96b635d9 Vangelis Koukis
        in settings.d/10-database.conf:
222 96b635d9 Vangelis Koukis
223 96b635d9 Vangelis Koukis
            if DATABASES['default']['ENGINE'].endswith('mysql'):
224 96b635d9 Vangelis Koukis
                DATABASES['default']['OPTIONS'] = {
225 96b635d9 Vangelis Koukis
                        'init_command': 'SET storage_engine=INNODB; ' +
226 96b635d9 Vangelis Koukis
                            'SET SESSION TRANSACTION ISOLATION LEVEL READ COMMITTED',
227 96b635d9 Vangelis Koukis
                }
228 96b635d9 Vangelis Koukis
          
229 03353341 Vangelis Koukis
   * PostgreSQL
230 03353341 Vangelis Koukis
     You need to install the PostgreSQL binaries:
231 03353341 Vangelis Koukis
     * Ubuntu - Debian
232 03353341 Vangelis Koukis
	     $ sudo apt-get install postgresql-8.4 libpq-dev
233 fc2afa67 Vangelis Koukis
234 03353341 Vangelis Koukis
     * MacPorts
235 03353341 Vangelis Koukis
	     $ sudo port install postgresql84
236 6ec8927b Vangelis Koukis
237 03353341 Vangelis Koukis
     Install the postgres Python library
238 03353341 Vangelis Koukis
	    $ bin/pip install psycopg2
239 6f339260 Georgios Gousios
240 03353341 Vangelis Koukis
     Configure a postgres db/account for synnefo:
241 6f339260 Georgios Gousios
242 03353341 Vangelis Koukis
     Become the postgres user, connect to PostgreSQL:
243 03353341 Vangelis Koukis
       $ sudo su - postgres
244 03353341 Vangelis Koukis
       $ psql
245 03353341 Vangelis Koukis
	
246 03353341 Vangelis Koukis
	 Run the following commands:
247 03353341 Vangelis Koukis
	   DROP DATABASE synnefo;
248 03353341 Vangelis Koukis
	   DROP USER username;
249 03353341 Vangelis Koukis
	   CREATE USER username WITH PASSWORD 'password';
250 03353341 Vangelis Koukis
	   CREATE DATABASE synnefo;
251 03353341 Vangelis Koukis
	   GRANT ALL PRIVILEGES ON DATABASE synnefo TO username;
252 03353341 Vangelis Koukis
	   ALTER DATABASE synnefo OWNER TO username;
253 03353341 Vangelis Koukis
	   ALTER USER username CREATEDB;
254 6f339260 Georgios Gousios
255 36cf1973 Vangelis Koukis
     The last line enables the newly created user to create own databases. This
256 36cf1973 Vangelis Koukis
     is needed for Django to create and drop the test_synnefo database for unit
257 03353341 Vangelis Koukis
     testing.
258 6f339260 Georgios Gousios
259 6f339260 Georgios Gousios
260 03353341 Vangelis Koukis
6. Setting up the Django project:
261 03353341 Vangelis Koukis
   The settings.py file for Django may be derived by concatenating the
262 03353341 Vangelis Koukis
   settings.py.dist file contained in the Synnefo distribution with a file
263 03353341 Vangelis Koukis
   containing custom modifications, which shall override all settings deviating
264 03353341 Vangelis Koukis
   from the supplied settings.py.dist. This is recommended to minimize the load
265 03353341 Vangelis Koukis
   of reconstructing settings.py from scratch, since each release currently
266 03353341 Vangelis Koukis
   brings heavy changes to settings.py.dist.
267 7e8b41e7 Vangelis Koukis
268 36cf1973 Vangelis Koukis
   Add the following to your custom settings.py, depending on your choice
269 36cf1973 Vangelis Koukis
   of DB:
270 03353341 Vangelis Koukis
   * SQLite
271 7e8b41e7 Vangelis Koukis
272 03353341 Vangelis Koukis
	 PROJECT_PATH = os.path.dirname(os.path.abspath(__file__)) + '/'
273 7e8b41e7 Vangelis Koukis
274 03353341 Vangelis Koukis
	 DATABASES = {
275 03353341 Vangelis Koukis
	     'default': {
276 03353341 Vangelis Koukis
		     'ENGINE': 'django.db.backends.sqlite3',
277 36cf1973 Vangelis Koukis
		     'NAME': PROJECT_PATH + 'synnefo.db' # WARN: This must be an absolute path
278 03353341 Vangelis Koukis
	     }
279 03353341 Vangelis Koukis
	 }
280 7e8b41e7 Vangelis Koukis
281 03353341 Vangelis Koukis
   * MySQL
282 7e8b41e7 Vangelis Koukis
283 03353341 Vangelis Koukis
 	 DATABASES = {
284 03353341 Vangelis Koukis
	     'default': {
285 03353341 Vangelis Koukis
             'ENGINE': 'django.db.backends.mysql',
286 03353341 Vangelis Koukis
             'NAME': 'synnefo',
287 03353341 Vangelis Koukis
             'USER': 'USERNAME',
288 03353341 Vangelis Koukis
             'PASSWORD': 'PASSWORD',
289 03353341 Vangelis Koukis
             'HOST': 'HOST',
290 03353341 Vangelis Koukis
             'PORT': 'PORT',
291 03353341 Vangelis Koukis
             'OPTIONS': {
292 03353341 Vangelis Koukis
                 'init_command': 'SET storage_engine=INNODB',
293 03353341 Vangelis Koukis
             }
294 03353341 Vangelis Koukis
	    }
295 03353341 Vangelis Koukis
	}
296 7e8b41e7 Vangelis Koukis
297 03353341 Vangelis Koukis
   * PostgreSQL
298 6f339260 Georgios Gousios
299 03353341 Vangelis Koukis
     DATABASES = {
300 03353341 Vangelis Koukis
	     'default': {
301 03353341 Vangelis Koukis
             'ENGINE': 'django.db.backends.postgresql_psycopg2',
302 03353341 Vangelis Koukis
             'NAME': 'DATABASE',
303 03353341 Vangelis Koukis
             'USER': 'USERNAME',
304 03353341 Vangelis Koukis
             'PASSWORD': 'PASSWORD',
305 03353341 Vangelis Koukis
             'HOST': 'HOST',
306 03353341 Vangelis Koukis
             'PORT': 'PORT',
307 03353341 Vangelis Koukis
	     }
308 03353341 Vangelis Koukis
     }
309 7e8b41e7 Vangelis Koukis
310 03353341 Vangelis Koukis
    Try it out. The following command will attempt to connect to the DB and
311 03353341 Vangelis Koukis
    print out DDL statements. It should not fail.
312 7e8b41e7 Vangelis Koukis
313 03353341 Vangelis Koukis
	$ ./bin/python manage.py sql db
314 6ec8927b Vangelis Koukis
315 6ec8927b Vangelis Koukis
316 03353341 Vangelis Koukis
7. Initialization of Synnefo DB:
317 03353341 Vangelis Koukis
   You need to initialize the Synnefo DB and load fixtures
318 3d9f561d Vangelis Koukis
   db/fixtures/{users,flavors,images}.json, which make the API usable by end
319 3d9f561d Vangelis Koukis
   users by defining a sample set of users, hardware configurations (flavors)
320 3d9f561d Vangelis Koukis
   and OS images.
321 03353341 Vangelis Koukis
322 3d9f561d Vangelis Koukis
   IMPORTANT: Be sure to modify db/fixtures/users.json and select
323 a6ff022a Vangelis Koukis
   a unique token for each of the initial and any other users defined in this
324 a6ff022a Vangelis Koukis
   file. DO NOT LEAVE THE SAMPLE AUTHENTICATION TOKENS enabled in deployed
325 a6ff022a Vangelis Koukis
   configurations.
326 a6ff022a Vangelis Koukis
327 03353341 Vangelis Koukis
     $ ./bin/python manage.py syncdb
328 03353341 Vangelis Koukis
     $ ./bin/python manage.py migrate db
329 3d9f561d Vangelis Koukis
     $ ./bin/python manage.py loaddata db/fixtures/users.json
330 03353341 Vangelis Koukis
     $ ./bin/python manage.py loaddata db/fixtures/flavors.json
331 03353341 Vangelis Koukis
     $ ./bin/python manage.py loaddata db/fixtures/images.json
332 03353341 Vangelis Koukis
333 03353341 Vangelis Koukis
334 03353341 Vangelis Koukis
8. Finalization of settings.py:
335 03353341 Vangelis Koukis
   Set the BACKEND_PREFIX_ID variable to some unique prefix, e.g. your commit
336 03353341 Vangelis Koukis
   username in settings.py. Several functional conventions within the system
337 03353341 Vangelis Koukis
   require this variable to include a dash at its end (e.g. snf-)
338 03353341 Vangelis Koukis
339 03353341 Vangelis Koukis
340 36cf1973 Vangelis Koukis
9. Installation of the Ganeti monitoring daemon, /ganeti/snf-ganeti-eventd:
341 36cf1973 Vangelis Koukis
   The Ganeti monitoring daemon must run on GANETI-MASTER.
342 937ac8bf Vangelis Koukis
343 02728a9a Vangelis Koukis
   The monitoring daemon is configured through /etc/synnefo/settings.conf.
344 02728a9a Vangelis Koukis
   An example is provided under snf-ganeti-tools/.
345 03353341 Vangelis Koukis
346 02728a9a Vangelis Koukis
   If run from the repository directory, make sure to have snf-ganeti-tools/
347 02728a9a Vangelis Koukis
   in the PYTHONPATH.
348 02728a9a Vangelis Koukis
349 02728a9a Vangelis Koukis
   You may also build Debian packages directly from the repository:
350 02728a9a Vangelis Koukis
   $ cd snf-ganeti-tools
351 02728a9a Vangelis Koukis
   $ dpkg-buildpackage -b -uc -us
352 02728a9a Vangelis Koukis
   # dpkg -i ../snf-ganeti-tools-*deb
353 03353341 Vangelis Koukis
354 03353341 Vangelis Koukis
   TBD: how to handle master migration.
355 03353341 Vangelis Koukis
356 6ec8927b Vangelis Koukis
357 03353341 Vangelis Koukis
10. Installation of the Synnefo dispatcher, /logic/dispatcher.py:
358 03353341 Vangelis Koukis
    The logic dispatcher is part of the Synnefo Django project and must run
359 03353341 Vangelis Koukis
    on LOGIC nodes.
360 ff55193e Vangelis Koukis
361 271baf11 Nikos Skalkotos
    The dispatcher retrieves messages from the queue and calls the appropriate
362 271baf11 Nikos Skalkotos
    handler function as defined in the queue configuration in `setttings.py'.
363 271baf11 Nikos Skalkotos
    The default configuration should work directly without any modifications.
364 6ec8927b Vangelis Koukis
365 03353341 Vangelis Koukis
    For the time being The dispatcher must be run by hand:
366 03353341 Vangelis Koukis
      $ ./bin/python ./logic/dispatcher.py
367 6ec8927b Vangelis Koukis
368 03353341 Vangelis Koukis
    The dispatcher should run in at least 2 instances to ensure high
369 03353341 Vangelis Koukis
    (actually, increased) availability.
370 6ec8927b Vangelis Koukis
371 7e8b41e7 Vangelis Koukis
372 03353341 Vangelis Koukis
11. Installation of the Synnefo Ganeti hook:
373 02728a9a Vangelis Koukis
    The generic Synnefo Ganeti hook wrapper resides in the snf-ganeti-tools/
374 02728a9a Vangelis Koukis
    directory of the Synnefo repository.
375 7e8b41e7 Vangelis Koukis
376 271baf11 Nikos Skalkotos
    The hook needs to be enabled for phases post-{add,modify,reboot,start,stop}
377 271baf11 Nikos Skalkotos
    by *symlinking* in
378 271baf11 Nikos Skalkotos
    /etc/ganeti/hooks/instance-{add,modify,reboot,start,stop}-post.d on
379 271baf11 Nikos Skalkotos
    GANETI-MASTER, e.g.:
380 7e8b41e7 Vangelis Koukis
381 03353341 Vangelis Koukis
    root@ganeti-master:/etc/ganeti/hooks/instance-start-post.d# ls -l
382 02728a9a Vangelis Koukis
    lrwxrwxrwx 1 root root 45 May   3 13:45 00-snf-ganeti-hook -> /home/devel/synnefo/snf-ganeti-hook/snf-ganeti-hook.py
383 b6382dc5 Vangelis Koukis
384 03353341 Vangelis Koukis
    IMPORTANT: The link name may only contain "upper and lower case, digits,
385 03353341 Vangelis Koukis
    underscores and hyphens. In other words, the regexp ^[a-zA-Z0-9_-]+$."
386 271baf11 Nikos Skalkotos
    See:
387 02728a9a Vangelis Koukis
    http://docs.ganeti.org/ganeti/master/html/hooks.html?highlight=hooks#naming
388 02728a9a Vangelis Koukis
389 02728a9a Vangelis Koukis
    If run from the repository directory, make sure to have snf-ganeti-tools/
390 02728a9a Vangelis Koukis
    in the PYTHONPATH.
391 7e8b41e7 Vangelis Koukis
392 02728a9a Vangelis Koukis
    Alternative, build Debian packages which take care of building, installing
393 02728a9a Vangelis Koukis
    and activating the Ganeti hook automatically, see step. 9.
394 81d1a961 Constantinos Venetsanopoulos
395 81d1a961 Constantinos Venetsanopoulos
396 03353341 Vangelis Koukis
12. Installation of the VNC authentication proxy, vncauthproxy:
397 03353341 Vangelis Koukis
    To support OOB console access to the VMs over VNC, the vncauthproxy
398 03353341 Vangelis Koukis
    daemon must be running on every node of type APISERVER.
399 81d1a961 Constantinos Venetsanopoulos
400 03353341 Vangelis Koukis
    Download and install vncauthproxy from its own repository,
401 50a48b39 Vangelis Koukis
    at https://code.grnet.gr/git/vncauthproxy (known good commit: tag v1.0).
402 a06deab3 Vangelis Koukis
403 937ac8bf Vangelis Koukis
    Download and install a specific repository commit:
404 937ac8bf Vangelis Koukis
405 937ac8bf Vangelis Koukis
    $ bin/pip install -e git+https://code.grnet.gr/git/vncauthproxy@INSERT_COMMIT_HERE#egg=vncauthproxy
406 937ac8bf Vangelis Koukis
407 03353341 Vangelis Koukis
    Create /var/log/vncauthproxy and set its permissions appropriately.
408 fc2afa67 Vangelis Koukis
409 937ac8bf Vangelis Koukis
    Alternatively, you can build Debian packages. To do so,
410 937ac8bf Vangelis Koukis
    checkout the "debian" branch of the vncauthproxy repository
411 50a48b39 Vangelis Koukis
    (known good commit: tag debian/v1.0):
412 937ac8bf Vangelis Koukis
413 937ac8bf Vangelis Koukis
    $ git checkout debian
414 937ac8bf Vangelis Koukis
415 937ac8bf Vangelis Koukis
    Then build debian package, and install as root:
416 937ac8bf Vangelis Koukis
417 937ac8bf Vangelis Koukis
    $ dpkg-buildpackage -b -uc -us
418 937ac8bf Vangelis Koukis
    # dpkg -i ../vncauthproxy_1.0-1_all.deb
419 937ac8bf Vangelis Koukis
420 141f3009 Georgios Gousios
    --Failure to build the package on the Mac.
421 141f3009 Georgios Gousios
422 141f3009 Georgios Gousios
    libevent, a requirement for gevent which in turn is a requirement for
423 141f3009 Georgios Gousios
    vncauthproxy is not included in MacOSX by default and installing it with
424 141f3009 Georgios Gousios
    MacPorts does not lead to a version that can be found by the gevent
425 141f3009 Georgios Gousios
    build process. A quick workaround is to execute the following commands:
426 141f3009 Georgios Gousios
427 141f3009 Georgios Gousios
    cd $SYNNEFO
428 141f3009 Georgios Gousios
    sudo pip install -e git+https://code.grnet.gr/git/vncauthproxy@5a196d8481e171a#egg=vncauthproxy
429 141f3009 Georgios Gousios
    <the above fails>
430 141f3009 Georgios Gousios
    cd build/gevent
431 141f3009 Georgios Gousios
    sudo python setup.py -I/opt/local/include -L/opt/local/lib build
432 141f3009 Georgios Gousios
    cd $SYNNEFO
433 141f3009 Georgios Gousios
    sudo pip install -e git+https://code.grnet.gr/git/vncauthproxy@5a196d8481e171a#egg=vncauthproxy
434 fc2afa67 Vangelis Koukis
435 02728a9a Vangelis Koukis
436 5949b704 Vangelis Koukis
13. Installation of the snf-image Ganeti OS provider for image deployment:
437 03353341 Vangelis Koukis
    For Synnefo to be able to launch VMs from specified Images, you need
438 5949b704 Vangelis Koukis
    the snf-image OS Provider installed on *all* Ganeti nodes.
439 5949b704 Vangelis Koukis
440 5949b704 Vangelis Koukis
    Please see https://code.grnet.gr/projects/snf-image/wiki
441 5949b704 Vangelis Koukis
    for installation instructions and documentation on the design
442 5949b704 Vangelis Koukis
    and implementation of snf-image.
443 5949b704 Vangelis Koukis
444 5949b704 Vangelis Koukis
    Please see https://code.grnet.gr/projects/snf-image/files
445 5949b704 Vangelis Koukis
    for the latest packages.
446 5949b704 Vangelis Koukis
447 5949b704 Vangelis Koukis
    Images should be stored under extdump format in a directory
448 5949b704 Vangelis Koukis
    of your choice, configurable as IMAGE_DIR in /etc/default/snf-image.
449 76a429fb Georgios Gousios
450 02728a9a Vangelis Koukis
451 03353341 Vangelis Koukis
14. Setup Synnefo-specific networking on the Ganeti backend:
452 03353341 Vangelis Koukis
    This part is deployment-specific and must be customized based on the
453 03353341 Vangelis Koukis
    specific needs of the system administrators.
454 76a429fb Georgios Gousios
455 03353341 Vangelis Koukis
    A reference installation will use a Synnefo-specific KVM ifup script,
456 03353341 Vangelis Koukis
    NFDHCPD and pre-provisioned Linux bridges to support public and private
457 03353341 Vangelis Koukis
    network functionality. For this:
458 76a429fb Georgios Gousios
459 03353341 Vangelis Koukis
    Grab NFDHCPD from its own repository (https://code.grnet.gr/git/nfdhcpd),
460 03353341 Vangelis Koukis
    install it, modify /etc/nfdhcpd/nfdhcpd.conf to reflect your network
461 03353341 Vangelis Koukis
    configuration.
462 76a429fb Georgios Gousios
463 03353341 Vangelis Koukis
    Install a custom KVM ifup script for use by Ganeti, as
464 03353341 Vangelis Koukis
    /etc/ganeti/kvm-vif-bridge, on GANETI-NODEs. A sample implementation is
465 03353341 Vangelis Koukis
    provided under /contrib/ganeti-hooks. Set NFDHCPD_STATE_DIR to point
466 03353341 Vangelis Koukis
    to NFDHCPD's state directory, usually /var/lib/nfdhcpd.
467 76a429fb Georgios Gousios
468 76a429fb Georgios Gousios
469 9e98ba3c Giorgos Verigakis
15. See section "Logging" in README.admin, and edit settings.d/00-logging.conf
470 10b3cf02 Vangelis Koukis
    according to your OS and individual deployment characteristics.
471 76a429fb Georgios Gousios
472 7e8b41e7 Vangelis Koukis
473 8b5381f3 Kostas Papadimitriou
16. Optionally, read the okeanos_site/README file to setup ~okeanos introductory 
474 3c27c268 Vangelis Koukis
    site (intro, video/info pages). Please see okeanos_site/90-okeanos.sample
475 3c27c268 Vangelis Koukis
    for a sample configuration file which overrides site-specific variables,
476 3c27c268 Vangelis Koukis
    to be placed under settings.d/, after customization.
477 3c27c268 Vangelis Koukis
478 3c27c268 Vangelis Koukis
479 8b5381f3 Kostas Papadimitriou
17. (Hopefully) Done
480 8b5381f3 Kostas Papadimitriou