Statistics
| Branch: | Tag: | Revision:

root / docs / admin-guide.rst @ 017b7d20

History | View | Annotate | Download (51.2 kB)

1
.. _admin-guide:
2

    
3
Synnefo Administrator's Guide
4
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5

    
6
This is the complete Synnefo Administrator's Guide.
7

    
8

    
9

    
10
General Synnefo Architecture
11
============================
12

    
13
The following graph shows the whole Synnefo architecture and how it interacts
14
with multiple Ganeti clusters. We hope that after reading the Administrator's
15
Guide you will be able to understand every component and all the interactions
16
between them. It is a good idea to first go through the Quick Administrator's
17
Guide before proceeding.
18

    
19
.. image:: images/synnefo-arch2.png
20
   :width: 100%
21
   :target: _images/synnefo-arch2.png
22

    
23

    
24

    
25
Identity Service (Astakos)
26
==========================
27

    
28

    
29
Overview
30
--------
31

    
32
Authentication methods
33
~~~~~~~~~~~~~~~~~~~~~~
34

    
35
Local Authentication
36
````````````````````
37

    
38
LDAP Authentication
39
```````````````````
40

    
41
.. _shibboleth-auth:
42

    
43
Shibboleth Authentication
44
`````````````````````````
45

    
46
Astakos can delegate user authentication to a Shibboleth federation.
47

    
48
To setup shibboleth, install package::
49

    
50
  apt-get install libapache2-mod-shib2
51

    
52
Change appropriately the configuration files in ``/etc/shibboleth``.
53

    
54
Add in ``/etc/apache2/sites-available/synnefo-ssl``::
55

    
56
  ShibConfig /etc/shibboleth/shibboleth2.xml
57
  Alias      /shibboleth-sp /usr/share/shibboleth
58

    
59
  <Location /im/login/shibboleth>
60
    AuthType shibboleth
61
    ShibRequireSession On
62
    ShibUseHeaders On
63
    require valid-user
64
  </Location>
65

    
66
and before the line containing::
67

    
68
  ProxyPass        / http://localhost:8080/ retry=0
69

    
70
add::
71

    
72
  ProxyPass /Shibboleth.sso !
73

    
74
Then, enable the shibboleth module::
75

    
76
  a2enmod shib2
77

    
78
After passing through the apache module, the following tokens should be
79
available at the destination::
80

    
81
  eppn # eduPersonPrincipalName
82
  Shib-InetOrgPerson-givenName
83
  Shib-Person-surname
84
  Shib-Person-commonName
85
  Shib-InetOrgPerson-displayName
86
  Shib-EP-Affiliation
87
  Shib-Session-ID
88

    
89
Finally, add 'shibboleth' in ``ASTAKOS_IM_MODULES`` list. The variable resides
90
inside the file ``/etc/synnefo/20-snf-astakos-app-settings.conf``
91

    
92
Architecture
93
------------
94

    
95
Prereqs
96
-------
97

    
98
Installation
99
------------
100

    
101
Configuration
102
-------------
103

    
104
Working with Astakos
105
--------------------
106

    
107
User activation methods
108
~~~~~~~~~~~~~~~~~~~~~~~
109

    
110
When a new user signs up, he/she is not marked as active. You can see his/her
111
state by running (on the machine that runs the Astakos app):
112

    
113
.. code-block:: console
114

    
115
   $ snf-manage user-list
116

    
117
There are two different ways to activate a new user. Both need access to a
118
running :ref:`mail server <mail-server>`.
119

    
120
Manual activation
121
`````````````````
122

    
123
You can manually activate a new user that has already signed up, by sending
124
him/her an activation email. The email will contain an approriate activation
125
link, which will complete the activation process if followed. You can send the
126
email by running:
127

    
128
.. code-block:: console
129

    
130
   $ snf-manage user-activation-send <user ID or email>
131

    
132
Be sure to have already setup your mail server and defined it in your Synnefo
133
settings, before running the command.
134

    
135
Automatic activation
136
````````````````````
137

    
138
FIXME: Describe Regex activation method
139

    
140
Setting quota limits
141
~~~~~~~~~~~~~~~~~~~~
142

    
143
Set default quota
144
`````````````````
145

    
146
In 20-snf-astakos-app-settings.conf, 
147
uncomment the default setting ``ASTAKOS_SERVICES``
148
and customize the ``'uplimit'`` values.
149
These are the default base quota for all users.
150

    
151
To apply your configuration run::
152

    
153
    # snf-manage astakos-init --load-service-resources
154
    # snf-manage quota --sync
155

    
156
Set base quota for individual users
157
```````````````````````````````````
158

    
159
For individual users that need different quota than the default
160
you can set it for each resource like this::
161

    
162
    # use this to display quota / uuid
163
    # snf-manage user-show 'uuid or email' --quota
164

    
165
    # snf-manage user-modify 'user-uuid' --set-base-quota 'cyclades.vm' 10
166

    
167

    
168
Enable the Projects feature
169
~~~~~~~~~~~~~~~~~~~~~~~~~~~
170

    
171
If you want to enable the projects feature so that users may apply
172
on their own for resources by creating and joining projects,
173
in ``20-snf-astakos-app-settings.conf`` set::
174

    
175
    # this will make the 'projects' page visible in the dashboard
176
    ASTAKOS_PROJECTS_VISIBLE = True
177

    
178
You can change the maximum allowed number of pending project applications
179
per user with::
180

    
181
    # snf-manage resource-modify astakos.pending_app --limit <number>
182

    
183
You can also set a user-specific limit with::
184

    
185
    # snf-manage user-modify 'user-uuid' --set-base-quota 'astakos.pending_app' 5
186

    
187
When users apply for projects they are not automatically granted
188
the resources. They must first be approved by the administrator.
189

    
190
To list pending project applications in astakos::
191

    
192
    # snf-manage project-list --pending
193

    
194
Note the last column, the application id. To approve it::
195

    
196
    # <app id> from the last column of project-list
197
    # snf-manage project-control --approve <app id>
198

    
199
To deny an application::
200

    
201
    # snf-manage project-control --deny <app id>
202

    
203
Users designated as *project admins* can approve, deny, or modify
204
an application through the web interface. In
205
``20-snf-astakos-app-settings.conf`` set::
206

    
207
    # UUIDs of users that can approve or deny project applications from the web.
208
    ASTAKOS_PROJECT_ADMINS = [<uuid>, ...]
209

    
210

    
211
Astakos advanced operations
212
---------------------------
213

    
214
Adding "Terms of Use"
215
~~~~~~~~~~~~~~~~~~~~~
216

    
217
Astakos supports versioned terms-of-use. First of all you need to create an
218
html file that will contain your terms. For example, create the file
219
``/usr/share/synnefo/sample-terms.html``, which contains the following:
220

    
221
.. code-block:: console
222

    
223
   <h1>~okeanos terms</h1>
224

    
225
   These are the example terms for ~okeanos
226

    
227
Then, add those terms-of-use with the snf-manage command:
228

    
229
.. code-block:: console
230

    
231
   $ snf-manage term-add /usr/share/synnefo/sample-terms.html
232

    
233
Your terms have been successfully added and you will see the corresponding link
234
appearing in the Astakos web pages' footer.
235

    
236
Enabling reCAPTCHA
237
~~~~~~~~~~~~~~~~~~
238

    
239
Astakos supports the `reCAPTCHA <http://www.google.com/recaptcha>`_ feature.
240
If enabled, it protects the Astakos forms from bots. To enable the feature, go
241
to https://www.google.com/recaptcha/admin/create and create your own reCAPTCHA
242
key pair. Then edit ``/etc/synnefo/20-snf-astakos-app-settings.conf`` and set
243
the corresponding variables to reflect your newly created key pair. Finally, set
244
the ``ASTAKOS_RECAPTCHA_ENABLED`` variable to ``True``:
245

    
246
.. code-block:: console
247

    
248
   ASTAKOS_RECAPTCHA_PUBLIC_KEY = 'example_recaptcha_public_key!@#$%^&*('
249
   ASTAKOS_RECAPTCHA_PRIVATE_KEY = 'example_recaptcha_private_key!@#$%^&*('
250

    
251
   ASTAKOS_RECAPTCHA_ENABLED = True
252

    
253
Restart the service on the Astakos node(s) and you are ready:
254

    
255
.. code-block:: console
256

    
257
   # /etc/init.d/gunicorn restart
258

    
259
Checkout your new Sign up page. If you see the reCAPTCHA box, you have setup
260
everything correctly.
261

    
262

    
263

    
264
File Storage Service (Pithos)
265
=============================
266

    
267
Overview
268
--------
269

    
270
Architecture
271
------------
272

    
273
Prereqs
274
-------
275

    
276
Installation
277
------------
278

    
279
Configuration
280
-------------
281

    
282
Working with Pithos
283
-------------------
284

    
285
Pithos advanced operations
286
--------------------------
287

    
288

    
289

    
290
Compute/Network/Image Service (Cyclades)
291
========================================
292

    
293
Compute Overview
294
----------------
295

    
296
Network Overview
297
----------------
298

    
299
Image Overview
300
--------------
301

    
302
Architecture
303
------------
304

    
305
Asynchronous communication with Ganeti backends
306
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
307
Synnefo uses Google Ganeti backends for VM cluster management. In order for
308
Cyclades to be able to handle thousands of user requests, Cyclades and Ganeti
309
communicate asynchronously. Briefly, requests are submitted to Ganeti through
310
Ganeti's RAPI/HTTP interface, and then asynchronous notifications about the
311
progress of Ganeti jobs are being created and pushed upwards to Cyclades. The
312
architecture and communication with a Ganeti backend is shown in the graph
313
below:
314

    
315
.. image:: images/cyclades-ganeti-communication.png
316
   :width: 50%
317
   :target: _images/cyclades-ganeti-communication.png
318

    
319
The Cyclades API server is responsible for handling user requests. Read-only
320
requests are directly served by looking up the Cyclades DB. If the request
321
needs an action in the Ganeti backend, Cyclades submit jobs to the Ganeti
322
master using the `Ganeti RAPI interface
323
<http://docs.ganeti.org/ganeti/2.2/html/rapi.html>`_.
324

    
325
While Ganeti executes the job, `snf-ganeti-eventd`, `snf-ganeti-hook` and
326
`snf-progress-monitor` are monitoring the progress of the job and send
327
corresponding messages to the RabbitMQ servers. These components are part
328
of `snf-cyclades-gtools` and must be installed on all Ganeti nodes. Specially:
329

    
330
* *snf-ganeti-eventd* sends messages about operations affecting the operating
331
  state of instances and networks. Works by monitoring the Ganeti job queue.
332
* *snf-ganeti_hook* sends messages about the NICs of instances. It includes a
333
  number of `Ganeti hooks <http://docs.ganeti.org/ganeti/2.2/html/hooks.html>`_
334
  for customisation of operations.
335
* *snf-progress_monitor* sends messages about the progress of the Image deployment
336
  phase which is done by the Ganeti OS Definition `snf-image`.
337

    
338
Finally, `snf-dispatcher` consumes messages from the RabbitMQ queues, processes
339
these messages and properly updates the state of the Cyclades DB. Subsequent
340
requests to the Cyclades API, will retrieve the updated state from the DB.
341

    
342

    
343
Prereqs
344
-------
345

    
346
Work in progress. Please refer to :ref:`quick administrator quide <quick-install-admin-guide>`.
347

    
348
Installation
349
------------
350

    
351
Work in progress. Please refer to :ref:`quick administrator quide <quick-install-admin-guide>`.
352

    
353
Configuration
354
-------------
355

    
356
Work in progress. Please refer to :ref:`quick administrator quide <quick-install-admin-guide>`.
357

    
358
Working with Cyclades
359
---------------------
360

    
361
Managing Ganeti Backends
362
~~~~~~~~~~~~~~~~~~~~~~~~
363

    
364
Since v0.11, Synnefo is able to manage multiple Ganeti clusters (backends)
365
making it capable to scale linearly to tens of thousands of VMs. Backends
366
can be dynamically added or removed via `snf-manage` commands.
367

    
368
Each newly created VM is allocated to a Ganeti backend by the Cyclades backend
369
allocator. The VM is "pinned" to this backend, and can not change through its
370
lifetime. The backend allocator decides in which backend to spawn the VM based
371
on the available resources of each backend, trying to balance the load between
372
them.
373

    
374
Handling of Networks, as far as backends are concerned, is based on whether the
375
network is public or not. Public networks are created through the `snf-manage
376
network-create` command, and are only created on one backend. Private networks
377
are created on all backends, in order to ensure that VMs residing on different
378
backends can be connected to the same private network.
379

    
380
Listing existing backends
381
`````````````````````````
382
To list all the Ganeti backends known to Synnefo, we run:
383

    
384
.. code-block:: console
385

    
386
   $ snf-manage backend-list
387

    
388
Adding a new Ganeti backend
389
```````````````````````````
390
Backends are dynamically added under the control of Synnefo with `snf-manage
391
backend-add` command. In this section it is assumed that a Ganeti cluster,
392
named ``cluster.example.com`` is already up and running and configured to be
393
able to host Synnefo VMs.
394

    
395
To add this Ganeti cluster, we run:
396

    
397
.. code-block:: console
398

    
399
   $ snf-manage backend-add --clustername=cluster.example.com --user="synnefo_user" --pass="synnefo_pass"
400

    
401
where ``clustername`` is the Cluster hostname of the Ganeti cluster, and
402
``user`` and ``pass`` are the credentials for the `Ganeti RAPI user
403
<http://docs.ganeti.org/ganeti/2.2/html/rapi.html#users-and-passwords>`_.  All
404
backend attributes can be also changed dynamically using the `snf-manage
405
backend-modify` command.
406

    
407
``snf-manage backend-add`` will also create all existing private networks to
408
the new backend. You can verify that the backend is added, by running
409
`snf-manage backend-list`.
410

    
411
Note that no VMs will be spawned to this backend, since by default it is in a
412
``drained`` state after addition and also it has no public network assigned to
413
it.
414

    
415
So, first you need to create its public network, make sure everything works as
416
expected and finally make it active by un-setting the ``drained`` flag. You can
417
do this by running:
418

    
419
.. code-block:: console
420

    
421
   $ snf-manage backend-modify --drained=False <backend_id>
422

    
423
Removing an existing Ganeti backend
424
```````````````````````````````````
425
In order to remove an existing backend from Synnefo, we run:
426

    
427
.. code-block:: console
428

    
429
   # snf-manage backend-remove <backend_id>
430

    
431
This command will fail if there are active VMs on the backend. Also, the
432
backend is not cleaned before removal, so all the Synnefo private networks
433
will be left on the Ganeti nodes. You need to remove them manually.
434

    
435
Allocation of VMs in Ganeti backends
436
````````````````````````````````````
437
As already mentioned, the Cyclades backend allocator is responsible for
438
allocating new VMs to backends. This allocator does not choose the exact Ganeti
439
node that will host the VM but just the Ganeti backend. The exact node is
440
chosen by the Ganeti cluster's allocator (hail).
441

    
442
The decision about which backend will host a VM is based on the available
443
resources. The allocator computes a score for each backend, that shows its load
444
factor, and the one with the minimum score is chosen. The admin can exclude
445
backends from the allocation phase by marking them as ``drained`` by running:
446

    
447
.. code-block:: console
448

    
449
   $ snf-manage backend-modify --drained=True <backend_id>
450

    
451
The backend resources are periodically updated, at a period defined by
452
the ``BACKEND_REFRESH_MIN`` setting, or by running `snf-manage backend-update-status`
453
command. It is advised to have a cron job running this command at a smaller
454
interval than ``BACKEND_REFRESH_MIN`` in order to remove the load of refreshing
455
the backends stats from the VM creation phase.
456

    
457
Finally, the admin can decide to have a user's VMs being allocated to a
458
specific backend, with the ``BACKEND_PER_USER`` setting. This is a mapping
459
between users and backends. If the user is found in ``BACKEND_PER_USER``, then
460
Synnefo allocates all his/hers VMs to the specific backend in the variable,
461
even if is marked as drained (useful for testing).
462

    
463

    
464
Managing Virtual Machines
465
~~~~~~~~~~~~~~~~~~~~~~~~~
466

    
467
As mentioned, Cyclades uses Ganeti for management of VMs. The administrator can
468
handle Cyclades VMs just like any other Ganeti instance, via `gnt-instance`
469
commands. All Ganeti instances that belong to Synnefo, are separated from
470
others, by a prefix in their names. This prefix is defined in
471
``BACKEND_PREFIX_ID`` setting in
472
``/etc/synnefo/20-snf-cyclades-app-backend.conf``.
473

    
474
Apart from handling instances directly in the Ganeti level, a number of `snf-manage`
475
commands are available:
476

    
477
* ``snf-manage server-list``: List servers
478
* ``snf-manage server-show``: Show information about a server in the Cyclades DB
479
* ``snf-manage server-inspect``: Inspect the state of a server both in DB and Ganeti
480
* ``snf-manage server-modify``: Modify the state of a server in the Cycldes DB
481
* ``snf-manage server-create``: Create a new server
482
* ``snf-manage server-import``: Import an existing Ganeti instance to Cyclades
483

    
484

    
485
Managing Virtual Networks
486
~~~~~~~~~~~~~~~~~~~~~~~~~
487

    
488
Cyclades is able to create and manage Virtual Networks. Networking is
489
desployment specific and must be customized based on the specific needs of the
490
system administrator. For better understanding of networking please refer to
491
the :ref:`Network <networks>` section.
492

    
493
Exactly as Cyclades VMs can be handled like Ganeti instances, Cyclades Networks
494
can also by handled as Ganeti networks, via `gnt-network commands`. All Ganeti
495
networks that belong to Synnefo are named with the prefix
496
`${BACKEND_PREFIX_ID}-net-`.
497

    
498
There are also the following `snf-manage` commands for managing networks:
499

    
500
* ``snf-manage network-list``: List networks
501
* ``snf-manage network-show``: Show information about a network in the Cyclades DB
502
* ``snf-manage network-inspect``: Inspect the state of the network in DB and Ganeti backends
503
* ``snf-manage network-modify``: Modify the state of a network in the Cycldes DB
504
* ``snf-manage network-create``: Create a new network
505
* ``snf-manage network-remove``: Remove an existing network
506

    
507
Managing Network Resources
508
``````````````````````````
509

    
510
Proper operation of the Cyclades Network Service depends on the unique
511
assignment of specific resources to each type of virtual network. Specifically,
512
these resources are:
513

    
514
* IP addresses. Cyclades creates a Pool of IPs for each Network, and assigns a
515
  unique IP address to each VM, thus connecting it to this Network. You can see
516
  the IP pool of each network by running `snf-manage network-inspect
517
  <network_ID>`. IP pools are automatically created and managed by Cyclades,
518
  depending on the subnet of the Network.
519
* Bridges corresponding to physical VLANs, which are required for networks of
520
  type `PRIVATE_PHYSICAL_VLAN`.
521
* One Bridge corresponding to one physical VLAN which is required for networks of
522
  type `PRIVATE_MAC_PREFIX`.
523

    
524
Cyclades allocates those resources from pools that are created by the
525
administrator with the `snf-manage pool-create` management command.
526

    
527
Pool Creation
528
`````````````
529
Pools are created using the `snf-manage pool-create` command:
530

    
531
.. code-block:: console
532

    
533
   # snf-manage pool-create --type=bridge --base=prv --size=20
534

    
535
will create a pool of bridges, containing bridges prv1, prv2,..prv21.
536

    
537
You can verify the creation of the pool, and check its contents by running:
538

    
539
.. code-block:: console
540

    
541
   # snf-manage pool-list
542
   # snf-manage pool-show --type=bridge 1
543

    
544
With the same commands you can handle a pool of MAC prefixes. For example:
545

    
546
.. code-block:: console
547

    
548
   # snf-manage pool-create --type=mac-prefix --base=aa:00:0 --size=65536
549

    
550
will create a pool of MAC prefixes from ``aa:00:1`` to ``b9:ff:f``. The MAC
551
prefix pool is responsible for providing only unicast and locally administered
552
MAC addresses, so many of these prefixes will be externally reserved, to
553
exclude from allocation.
554

    
555
Cyclades advanced operations
556
----------------------------
557

    
558
Reconciliation mechanism
559
~~~~~~~~~~~~~~~~~~~~~~~~
560

    
561
On certain occasions, such as a Ganeti or RabbitMQ failure, the state of
562
Cyclades database may differ from the real state of VMs and networks in the
563
Ganeti backends. The reconciliation process is designed to synchronize
564
the state of the Cyclades DB with Ganeti. There are two management commands
565
for reconciling VMs and Networks
566

    
567
Reconciling Virtual Machines
568
````````````````````````````
569

    
570
Reconciliation of VMs detects the following conditions:
571

    
572
 * Stale DB servers without corresponding Ganeti instances
573
 * Orphan Ganeti instances, without corresponding DB entries
574
 * Out-of-sync state for DB entries wrt to Ganeti instances
575

    
576
To detect all inconsistencies you can just run:
577

    
578
.. code-block:: console
579

    
580
  $ snf-manage reconcile-servers
581

    
582
Adding the `--fix-all` option, will do the actual synchronization:
583

    
584
.. code-block:: console
585

    
586
  $ snf-manage reconcile --fix-all
587

    
588
Please see ``snf-manage reconcile --help`` for all the details.
589

    
590

    
591
Reconciling Networks
592
````````````````````
593

    
594
Reconciliation of Networks detects the following conditions:
595

    
596
  * Stale DB networks without corresponding Ganeti networks
597
  * Orphan Ganeti networks, without corresponding DB entries
598
  * Private networks that are not created to all Ganeti backends
599
  * Unsynchronized IP pools
600

    
601
To detect all inconsistencies you can just run:
602

    
603
.. code-block:: console
604

    
605
  $ snf-manage reconcile-networks
606

    
607
Adding the `--fix-all` option, will do the actual synchronization:
608

    
609
.. code-block:: console
610

    
611
  $ snf-manage reconcile-networks --fix-all
612

    
613
Please see ``snf-manage reconcile-networks --help`` for all the details.
614

    
615

    
616

    
617
Block Storage Service (Archipelago)
618
===================================
619

    
620
Overview
621
--------
622
Archipelago offers Copy-On-Write snapshotable volumes. Pithos images can be used
623
to provision a volume with Copy-On-Write semantics (i.e. a clone). Snapshots
624
offer a unique deduplicated image of a volume, that reflects the volume state
625
during snapshot creation and are indistinguishable from a Pithos image.
626

    
627
Archipelago is used by Cyclades and Ganeti for fast provisioning of VMs based on
628
CoW volumes. Moreover, it enables live migration of thinly-provisioned VMs with
629
no physically shared storage.
630

    
631
Archipelago Architecture
632
------------------------
633

    
634
.. image:: images/archipelago-architecture.png
635
   :width: 50%
636
   :target: _images/archipelago-architecture.png
637

    
638
.. _syn+archip+rados:
639

    
640
Overview of Synnefo + Archipelago + RADOS
641
-----------------------------------------
642

    
643
.. image:: images/synnefo-arch3.png
644
   :width: 100%
645
   :target: _images/synnefo-arch3.png
646

    
647
Prereqs
648
-------
649

    
650
The administrator must initialize the storage backend where archipelago volume
651
blocks will reside.
652

    
653
In case of a files backend, the administrator must create two directories. One
654
for the archipelago data blocks and one for the archipelago map blocks. These
655
should probably be over shared storage to enable sharing archipelago volumes
656
between multiple nodes. He or she, must also be able to supply a directory where
657
the pithos data and map blocks reside.
658

    
659
In case of a RADOS backend, the administrator must create two rados pools, one
660
for data blocks, and one for the map blocks. These pools, must be the same pools
661
used in pithos, in order to enable volume creation based on pithos images.
662

    
663
Installation
664
------------
665

    
666
Archipelago consists of
667

    
668
* ``libxseg0``: libxseg used to communicate over shared memory segments
669
* ``python-xseg``: python bindings for libxseg
670
* ``archipelago-kernel-dkms``: contains archipelago kernel modules to provide
671
  block devices to be used as vm disks
672
* ``python-archipelago``: archipelago python module. Includes archipelago and
673
  vlmc functionality.
674
* ``archipelago``: user space tools and peers for the archipelago management and
675
  volume composition
676
* ``archipelago-ganeti``: ganeti ext storage scripts, that enable ganeti to
677
  provision VMs over archipelago
678

    
679
Performing
680

    
681
.. code-block:: console
682

    
683
  $ apt-get install archipelago-ganeti 
684

    
685
should fetch all the required packages and get you up 'n going with archipelago
686

    
687
Bare in mind, that custom librados is required, which is provided in the apt
688
repo of GRNet.
689

    
690

    
691
For now, librados is a dependency of archipelago, even if you do not intend to
692
use archipelago over RADOS.
693

    
694
Configuration
695
-------------
696
Archipelago should work out of the box with a RADOS backend, but basic
697
configuration can be done in ``/etc/default/archipelago`` .
698

    
699
If you wish to change the storage backend to files, set
700

    
701
.. code-block:: console
702

    
703
   STORAGE="files"
704

    
705
and provide the appropriate settings for files storage backend in the conf file.
706

    
707
These are:
708

    
709
* ``FILED_IMAGES``: directory for archipelago data blocks.
710
* ``FILED_MAPS``: directory for archipelago map blocks.
711
* ``PITHOS``: directory of pithos data blocks.
712
* ``PITHOSMAPS``: directory of pithos map blocks.
713

    
714
The settings for RADOS storage backend are:
715

    
716
* ``RADOS_POOL_MAPS``: The pool where archipelago and pithos map blocks reside.
717
* ``RADOS_POOL_BLOCKS``: The pool where archipelago and pithos data blocks
718
  reside.
719

    
720
Examples can be found in the conf file.
721

    
722
Be aware that archipelago infrastructure doesn't provide default values for this
723
settings. If they are not set in the conf file, archipelago will not be able to
724
function.
725

    
726
Archipelago also provides ``VERBOSITY`` config options to control the output
727
generated by the userspace peers.
728

    
729
The available options are:
730

    
731
* ``VERBOSITY_BLOCKERB``
732
* ``VERBOSITY_BLOCKERM``
733
* ``VERBOSITY_MAPPER``
734
* ``VERBOSITY_VLMC``
735

    
736
and the available values are:
737

    
738
* 0 : Error only logging.
739
* 1 : Warning logging.
740
* 2 : Info logging.
741
* 3 : Debug logging. WARNING: This options produces tons of output, but the
742
  logrotate daemon should take care of it.
743

    
744
Working with Archipelago
745
------------------------
746

    
747
``archipelago`` provides basic functionality for archipelago.
748

    
749
Usage:
750

    
751
.. code-block:: console
752

    
753
  $ archipelago [-u] command
754

    
755

    
756
Currently it supports the following commands:
757

    
758
* ``start [peer]``
759
  Starts archipelago or the specified peer.
760
* ``stop [peer]``
761
  Stops archipelago or the specified peer.
762
* ``restart [peer]``
763
  Restarts archipelago or the specified peer.
764
* ``status``
765
  Show the status of archipelago.
766

    
767
Available peers: ``blockerm``, ``blockerb``, ``mapperd``, ``vlmcd``.
768

    
769

    
770
``start``, ``stop``, ``restart`` can be combined with the ``-u / --user`` option
771
to affect only the userspace peers supporting archipelago.
772

    
773

    
774

    
775
Archipelago advanced operations
776
-------------------------------
777
The ``vlmc`` tool provides a way to interact with archipelago volumes
778

    
779
* ``vlmc map <volumename>``: maps the volume to a xsegbd device.
780

    
781
* ``vlmc unmap </dev/xsegbd[1-..]>``: unmaps the specified device from the
782
  system.
783

    
784
* ``vlmc create <volumename> --snap <snapname> --size <size>``: creates a new
785
  volume named <volumename> from snapshot name <snapname> with size <size>.
786
  The ``--snap`` and ``--size`` are optional, but at least one of them is
787
  mandatory. e.g:
788

    
789
  ``vlmc create <volumename> --snap <snapname>`` creates a volume named
790
  volumename from snapshot snapname. The size of the volume is the same as
791
  the size of the snapshot.
792

    
793
  ``vlmc create <volumename> --size <size>`` creates an empty volume of size
794
  <size> named <volumename>.
795

    
796
* ``vlmc remove <volumename>``: removes the volume and all the related
797
  archipelago blocks from storage.
798

    
799
* ``vlmc list``: provides a list of archipelago volumes. Currently only works
800
  with RADOS storage backend.
801

    
802
* ``vlmc info <volumename>``: shows volume information. Currently returns only
803
  volume size.
804

    
805
* ``vlmc open <volumename>``: opens an archipelago volume. That is, taking all
806
  the necessary locks and also make the rest of the infrastructure aware of the
807
  operation.
808

    
809
  This operation succeeds if the volume is alread opened.
810

    
811
* ``vlmc close <volumename>``: closes an archipelago volume. That is, performing
812
  all the necessary functions in the insfrastrure to successfully release the
813
  volume. Also releases all the acquired locks.
814

    
815
  ``vlmc close`` should be performed after a ``vlmc open`` operation.
816

    
817
* ``vlmc lock <volumename>``: locks a volume. This step allow the administrator
818
  to lock an archipelago volume, independently from the rest of the
819
  infrastrure.
820

    
821
* ``vlmc unlock [-f] <volumename>``: unlocks a volume. This allow the
822
  administrator to unlock a volume, independently from the rest of the
823
  infrastructure.
824
  The unlock option can be performed only by the blocker that acquired the lock
825
  in the first place. To unlock a volume from another blocker, ``-f`` option
826
  must be used to break the lock.
827

    
828

    
829
The "kamaki" API client
830
=======================
831

    
832
To upload, register or modify an image you will need the **kamaki** tool.
833
Before proceeding make sure that it is configured properly. Verify that
834
*image.url*, *file.url*, *user.url* and *token* are set as needed:
835

    
836
.. code-block:: console
837

    
838
   $ kamaki config list
839

    
840
To chage a setting use ``kamaki config set``:
841

    
842
.. code-block:: console
843

    
844
   $ kamaki config set image.url https://cyclades.example.com/plankton
845
   $ kamaki config set file.url https://pithos.example.com/v1
846
   $ kamaki config set user.url https://accounts.example.com
847
   $ kamaki config set token ...
848

    
849
To test that everything works, try authenticating the current account with
850
kamaki:
851

    
852
.. code-block:: console
853

    
854
  $ kamaki user authenticate
855

    
856
This will output user information.
857

    
858
Upload Image
859
------------
860

    
861
By convention, images are stored in a container called ``images``. Check if the
862
container exists, by listing all containers in your account:
863

    
864
.. code-block:: console
865

    
866
   $ kamaki file list
867

    
868
If the container ``images`` does not exist, create it:
869

    
870
.. code-block:: console
871

    
872
  $ kamaki file create images
873

    
874
You are now ready to upload an image to container ``images``. You can upload it
875
with a Pithos+ client, or use kamaki directly:
876

    
877
.. code-block:: console
878

    
879
   $ kamaki file upload ubuntu.iso images
880

    
881
You can use any Pithos+ client to verify that the image was uploaded correctly,
882
or you can list the contents of the container with kamaki:
883

    
884
.. code-block:: console
885

    
886
  $ kamaki file list images
887

    
888
The full Pithos URL for the previous example will be
889
``pithos://u53r-un1qu3-1d/images/ubuntu.iso`` where ``u53r-un1qu3-1d`` is the
890
unique user id (uuid).
891

    
892
Register Image
893
--------------
894

    
895
To register an image you will need to use the full Pithos+ URL. To register as
896
a public image the one from the previous example use:
897

    
898
.. code-block:: console
899

    
900
   $ kamaki image register Ubuntu pithos://u53r-un1qu3-1d/images/ubuntu.iso --public
901

    
902
The ``--public`` flag is important, if missing the registered image will not
903
be listed by ``kamaki image list``.
904

    
905
Use ``kamaki image register`` with no arguments to see a list of available
906
options. A more complete example would be the following:
907

    
908
.. code-block:: console
909

    
910
   $ kamaki image register Ubuntu pithos://u53r-un1qu3-1d/images/ubuntu.iso \
911
            --public --disk-format diskdump --property kernel=3.1.2
912

    
913
To verify that the image was registered successfully use:
914

    
915
.. code-block:: console
916

    
917
   $ kamaki image list --name-like=ubuntu
918

    
919

    
920
Miscellaneous
921
=============
922

    
923
.. snf-branding
924

    
925
Snf-branding
926
------------
927
Snf-branding  allows you to adapt Astakos, Pithos  and Cyclades UI  to your 
928
company’s  visual identity.  
929

    
930

    
931

    
932
Configuration
933
~~~~~~~~~~~~~
934

    
935
The settings for the snf-branding application can be found in the configuration 
936
file   <path_to_conf_file>/15-snf-branding.conf
937

    
938
By default, the service name is Synnefo and the company name is GRNET. 
939
These name and their respective logos and urls are used throughout Astakos, 
940
Pithos and Cyclades UI.
941

    
942
**Name and logos:**
943

    
944
The first group of branding customization regards company and service info.
945

    
946
You can overwrite the company and the service name and url respectively  by 
947
uncommenting  and setting the following:
948

    
949
.. code-block:: console
950

    
951
  #BRANDING_SERVICE_NAME = 'Synnefo'
952
  #BRANDING_SERVICE_URL = 'http://www.synnefo.org/'
953
  #BRANDING_COMPANY_NAME = 'GRNET'
954
  #BRANDING_COMPANY_URL = 'https://www.grnet.gr/en/'
955

    
956

    
957
BRANDING_COMPANY_NAME and BRANDING_COMPANY_URL  appear in Astakos, Cyclades and 
958
Pithos footer.
959
In addition to that, BRANDING_COMPANY_NAME appears in Astakos project tab.
960

    
961
**Copyright options:**
962

    
963
By default, no copyright message is shown in the UI. If you want to make it 
964
visible to the footer of Astakos, Cyclades and Pithos UI,  you can uncomment and
965
set True the setting:
966

    
967
.. code-block:: console
968

    
969
  #BRANDING_SHOW_COPYRIGHT = False
970

    
971
Copyright message defaults to 'Copyright (c) 2011-<current_year> GRNET.'  
972
but you can alter it using the setting:
973

    
974
.. code-block:: console
975

    
976
  #BRANDING_COPYRIGHT_MESSAGE = 'Copyright (c) 2011-<current_year> GRNET S.A.'
977

    
978
**Images:**
979

    
980
The branding-related images are presented in  the following table:
981

    
982
===============  ============================  =========
983
Image            Name/extension  convention    Usage
984
===============  ============================  =========
985
Favicon          favicon.ico                   Favicon for all services
986
Dashboard logo   dashboard_logo.png            Visible in all Astakos UI pages
987
Compute logo     compute_logo.png              Visible in all Cyclades UI pages
988
Console logo     console_logo.png              Visible in Console Page for VMs
989
Storage logo     storage_logo.png              Visible in Pithos UI pages
990
===============  ============================  =========
991

    
992
There are two methods  available for replacing all or individual 
993
branding-related images:
994

    
995
1. Create a new directory and  place there  some or all of your images.
996

    
997
If you want to replace all images, keep the name/extension conventions as 
998
indicated in the above table and set:
999

    
1000
.. code-block:: console
1001

    
1002
  #BRANDING_IMAGE_MEDIA_URL= MEDIA_URL + 'branding/images/' 
1003

    
1004
to the relative path of your directory.
1005

    
1006
If you wish to replace individual images, **do not uncomment**  
1007
BRANDING_IMAGE_MEDIA_URL but instead provide a relative path, 
1008
pointing to the file inside your directory for each BRANDING_<image>_URL that 
1009
will be replaced.
1010

    
1011
2. Upload some or all of your images to a server and replace each 
1012
BRANDING_<image>_URL with the absolute url of the image ( i.e.  
1013
BRANDING_DASHBOARD_URL=’https://www.example.com/images/my_dashboard.jpg’ ).
1014

    
1015
Note that the alternative text  for each image tag inside html documents  is 
1016
alt=“BRANDING_SERVICE_NAME {Dashboad, Compute. Console, Storage}” respectively.
1017

    
1018

    
1019
.. note:: Retina optimised images:
1020

    
1021
  Synnefo UI is optimised for Retina displays. As far as images are concerned,  
1022
  `retina.js <http://retinajs.com/>`_ is used.
1023

    
1024
  Retina.js checks each image on a page to  see if there is a high-resolution 
1025
  version of that image on your server. If a high-resolution variant exists, 
1026
  the script will swap in that image in-place.
1027

    
1028
  The script assumes you use  `Apple's prescribed high-resolution modifier (@2x)
1029
  <http://developer.apple.com/library/ios/#documentation/2DDrawing/Conceptual/
1030
  DrawingPrintingiOS/SupportingHiResScreensInViews/SupportingHiResScreensInViews
1031
  .html#//apple_ref/doc/uid/TP40010156-CH15-SW1>`_ to denote high-resolution 
1032
  image variants on your server.
1033

    
1034
  For each of the images that you wish the script to  replace you must have a 
1035
  high-resolution variant in the same folder  named correctly and it will be 
1036
  detected automatically. For example if your image is in <my_directory> and is 
1037
  named "my_image.jpg" the script will look in the same directory for an image 
1038
  named "my_image@2x.jpg".
1039

    
1040
  In case that you don’t want to use a high-resolution image, the 
1041
  normal-resolution image will be visible.
1042

    
1043
Branding-related issues:
1044
~~~~~~~~~~~~~~~~~~~~~~~~
1045

    
1046
Although, it is not strictly-speaking branding-related, further verbal 
1047
customization  is feasible. 
1048

    
1049
**EMAILS**
1050

    
1051
The output of all email *.txt files will be already customized to contain your 
1052
company and service names but you can further alter their content if you feel 
1053
it best fits your needs  using django’s TEMPLATE_DIRS setting.    
1054

    
1055
For more information visit  
1056
https://docs.djangoproject.com/en/1.2/ref/settings/#template-dirs.                           
1057

    
1058
In order to overwrite one or more email-templates you need to create a new one 
1059
directory and  provide its path to the TEMPLATE_DIRS. Inside this directory, you
1060
must place your <email-file>.txt files respecting the following structure:
1061
  
1062
  *<emails-dir>*/
1063
      *im*/
1064
          | activation_email.txt
1065
          | email.txt
1066
          | invitation.txt
1067
          | switch_accounts_email.txt
1068
          | welcome_email.txt
1069
          *projects*/
1070
              | project_approval_notification.txt
1071
              | project_denial_notification.txt    
1072
              | project_membership_change_notification.txt
1073
              | project_membership_enroll_notification.txt
1074
              | project_membership_leave_request_notification.txt
1075
              | project_membership_request_notification.txt
1076
              | project_suspension_notification.txt
1077
              | project_termination_notification.txt
1078
      *registration*/
1079
          | email_change_email.txt
1080
          | password_email.txt
1081

    
1082
Feel free to omit any of the above files you do not wish to overwrite.
1083

    
1084

    
1085

    
1086

    
1087
Below is a list of all emails sent by Synnefo to users along with a short 
1088
description and a link to their content:
1089

    
1090

    
1091
* ``snf-astakos-app/astakos/im/templates/im/email.txt`` Base email template. 
1092
Contains a contact email  and a “ thank you” message. 
1093
(Link: https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/im/email.txt )
1094

    
1095

    
1096
* ``snf-astakos-app/astakos/im/templates/im/activation_email.txt`` Email sent to user that prompts  him/her to click on a link provided to activate the account.
1097
Extends “email.txt”
1098
(Link: https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/im/activation_email.txt  )
1099

    
1100
* ``snf-astakos-app/astakos/im/templates/im/invitation.txt:``  Email sent to invited user. He/she has to click on a link provided to activate the  account. 
1101
Extends “email.txt” 
1102
(Link: https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/im/invitation.txt )
1103

    
1104
* ``snf-astakos-app/astakos/im/templates/im/switch_accounts_email.txt`` Email sent to user upon his/her request to associate this email address with a 
1105
shibboleth account. He/she has to click on a link provided to activate the  
1106
association. Extends “email.txt”
1107
(Link: https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/im/switch_accounts_email.txt )
1108

    
1109
* ``snf-astakos-app/astakos/im/templates/im/welcome_email.txt`` Email sent to inform the user that his/ her account has been activated. Extends “email.txt”
1110
(Link: https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/im/welcome_email.txt )
1111

    
1112
* ``snf-astakos-app/astakos/im/templates/registration/email_change_email.txt`` Email sent to user when he/she has requested new email address assignment. The user has to click on link provided to validate this action. Extends “email.txt” 
1113
(Link: https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/registration/email_change_email.txt )
1114

    
1115
* ``snf-astakos-app/astakos/im/templates/registration/password_email.txt`` Email sent for resetting password purpose.  The user has to click on link provided to validate this action. Extends “email.txt” 
1116
(Link: https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/registration/password_email.txt )
1117

    
1118
* ``snf-astakos-app/astakos/im/templates/im/projects/project_approval_notification.txt`` Informs  the project owner that his/her project has been approved.  Extends “email.txt” 
1119
(Link: https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/im/projects/project_approval_notification.txt )
1120

    
1121
* ``snf-astakos-app/astakos/im/templates/im/projects/project_denial_notification.txt`` Informs the project owner that his/her  project application has been denied explaining the reasons.  Extends “email.txt”  
1122
( Link: https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/im/projects/project_denial_notification.txt )
1123

    
1124
* ``snf-astakos-app/astakos/im/templates/im/projects/project_membership_change_notification.txt`` An email is sent to a user containing information about his project membership (whether he has been accepted, rejected or removed). Extends “email.txt” 
1125
(Link:  https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/im/projects/project_membership_change_notification.txt )
1126

    
1127
* ``snf-astakos-app/astakos/im/templates/im/projects/project_membership_enroll_notification.txt`` Informs a user that he/she  has been enrolled to a project.  Extends “email.txt” 
1128
( Link: https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/im/projects/project_membership_enroll_notification.txt )
1129

    
1130
* ``snf-astakos-app/astakos/im/templates/im/projects/project_membership_leave_request_notification.txt`` An email is sent to the project owner to make him aware of a  user having requested to leave his project.  Extends “email.txt” 
1131
( Link: https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/im/projects/project_membership_leave_request_notification.txt )
1132

    
1133
* ``snf-astakos-app/astakos/im/templates/im/projects/project_membership_request_notification.txt`` An email is sent to the project owner to make him/her aware of a user having requested to join  his project. Extends “email.txt” 
1134
(Link: https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/im/projects/project_membership_request_notification.txt )
1135

    
1136
* ``snf-astakos-app/astakos/im/templates/im/projects/project_suspension_notification.txt`` An email is sent to the project owner to make him/her aware of his/her project having  been suspended.   Extends “email.txt” 
1137
(Link: https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/im/projects/project_suspension_notification.txt )
1138

    
1139
* ``snf-astakos-app/astakos/im/templates/im/projects/project_termination_notification.txt`` An email is sent to the project owner to make him/her aware of his/her project having  been terminated. Extends “email.txt”  
1140
(Link: https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/im/projects/project_termination_notification.txt )
1141

    
1142

    
1143
.. warning:: Django templates language:
1144

    
1145
  If you choose to  overwrite these email templates, be mindful of the necessary 
1146
  information contained in django template variables that must not be omitted, 
1147
  such as the activation link for activating one’s account and many more. 
1148
  These variables are contained into {{}} inside the templates.
1149

    
1150

    
1151

    
1152
.. RabbitMQ
1153

    
1154
RabbitMQ Broker
1155
---------------
1156

    
1157
Queue nodes run the RabbitMQ sofware, which provides AMQP functionality. To
1158
guarantee high-availability, more than one Queue nodes should be deployed, each
1159
of them belonging to the same `RabbitMQ cluster
1160
<http://www.rabbitmq.com/clustering.html>`_. Synnefo uses the RabbitMQ
1161
active/active `High Available Queues <http://www.rabbitmq.com/ha.html>`_ which
1162
are mirrored between two nodes within a RabbitMQ cluster.
1163

    
1164
The RabbitMQ nodes that form the cluster, are declared to Synnefo through the
1165
`AMQP_HOSTS` setting. Each time a Synnefo component needs to connect to
1166
RabbitMQ, one of these nodes is chosen in a random way. The client that Synnefo
1167
uses to connect to RabbitMQ, handles connection failures transparently and
1168
tries to reconnect to a different node. As long as one of these nodes are up
1169
and running, functionality of Synnefo should not be downgraded by the RabbitMQ
1170
node failures.
1171

    
1172
All the queues that are being used are declared as durable, meaning that
1173
messages are persistently stored to RabbitMQ, until they get successfully
1174
processed by a client.
1175

    
1176
Currently, RabbitMQ is used by the following components:
1177

    
1178
* `snf-ganeti-eventd`, `snf-ganeti-hook` and `snf-progress-monitor`:
1179
  These components send messages concerning the status and progress of
1180
  jobs in the Ganeti backend.
1181
* `snf-dispatcher`: This daemon, consumes the messages that are sent from
1182
  the above components, and updates the Cyclades DB accordingly.
1183

    
1184

    
1185
Installation
1186
~~~~~~~~~~~~
1187

    
1188
Please check the RabbitMQ documentation which covers extensively the
1189
`installation of RabbitMQ server <http://www.rabbitmq.com/download.html>`_ and
1190
the setup of a `RabbitMQ cluster <http://www.rabbitmq.com/clustering.html>`_.
1191
Also, check out the `web management plugin
1192
<http://www.rabbitmq.com/management.html>`_ that can be useful for managing and
1193
monitoring RabbitMQ.
1194

    
1195
For a basic installation of RabbitMQ on two nodes (node1 and node2) you can do
1196
the following:
1197

    
1198
On both nodes, install rabbitmq-server and create a Synnefo user:
1199

    
1200
.. code-block:: console
1201

    
1202
  $ apt-get install rabbitmq-server
1203
  $ rabbitmqctl add_user synnefo "example_pass"
1204
  $ rabbitmqctl set_permissions synnefo  ".*" ".*" ".*"
1205

    
1206
Also guarantee that both nodes share the same cookie, by running:
1207

    
1208
.. code-block:: console
1209

    
1210
  $ scp node1:/var/lib/rabbitmq/.erlang.cookie node2:/var/lib/rabbitmq/.erlang.cookie
1211

    
1212
and restart the nodes:
1213

    
1214
.. code-block:: console
1215

    
1216
  $ /etc/init.d/rabbitmq-server restart
1217

    
1218

    
1219
To setup the RabbitMQ cluster run:
1220

    
1221
.. code-block:: console
1222

    
1223
  root@node2: rabbitmqctl stop_app
1224
  root@node2: rabbitmqctl reset
1225
  root@node2: rabbitmqctl cluster rabbit@node1 rabbit@node2
1226
  root@node2: rabbitmqctl start_app
1227

    
1228
You can verify that the cluster is set up correctly by running:
1229

    
1230
.. code-block:: console
1231

    
1232
  root@node2: rabbitmqctl cluster_status
1233

    
1234

    
1235

    
1236

    
1237

    
1238
Admin tool: snf-manage
1239
----------------------
1240

    
1241
``snf-manage`` is a tool used to perform various administrative tasks. It needs
1242
to be able to access the django database, so the following should be able to
1243
import the Django settings.
1244

    
1245
Additionally, administrative tasks can be performed via the admin web interface
1246
located in /admin. Only users of type ADMIN can access the admin pages. To
1247
change the type of a user to ADMIN, snf-manage can be used:
1248

    
1249
.. code-block:: console
1250

    
1251
   $ snf-manage user-modify 42 --type ADMIN
1252

    
1253
Logging
1254
-------
1255

    
1256
Logging in Synnefo is using Python's logging module. The module is configured
1257
using dictionary configuration, whose format is described here:
1258

    
1259
http://docs.python.org/release/2.7.1/library/logging.html#logging-config-dictschema
1260

    
1261
Note that this is a feature of Python 2.7 that we have backported for use in
1262
Python 2.6.
1263

    
1264
The logging configuration dictionary is defined in
1265
``/etc/synnefo/10-snf-webproject-logging.conf``
1266

    
1267
The administrator can have finer logging control by modifying the
1268
``LOGGING_SETUP`` dictionary, and defining subloggers with different handlers
1269
and log levels.  e.g. To enable debug messages only for the API set the level
1270
of 'synnefo.api' to ``DEBUG``
1271

    
1272
By default, the Django webapp and snf-manage logs to syslog, while
1273
`snf-dispatcher` logs to `/var/log/synnefo/dispatcher.log`.
1274

    
1275

    
1276
.. _scale-up:
1277

    
1278
Scaling up to multiple nodes
1279
============================
1280

    
1281
Here we will describe how should a large scale Synnefo deployment look like. Make
1282
sure you are familiar with Synnefo and Ganeti before proceeding with this section.
1283
This means you should at least have already set up successfully a working Synnefo
1284
deployment as described in the :ref:`Admin's Quick Installation Guide
1285
<quick-install-admin-guide>` and also read the Administrator's Guide until this
1286
section.
1287

    
1288
Graph of a scale-out Synnefo deployment
1289
---------------------------------------
1290

    
1291
Each box in the following graph corresponds to a distinct physical node:
1292

    
1293
.. image:: images/synnefo-arch2-roles.png
1294
   :width: 100%
1295
   :target: _images/synnefo-arch2-roles.png
1296

    
1297
The above graph is actually the same with the one at the beginning of this
1298
:ref:`guide <admin-guide>`, with the only difference that here we show the
1299
Synnefo roles of each physical node. These roles are described in the
1300
following section.
1301

    
1302
.. _physical-node-roles:
1303

    
1304
Physical Node roles
1305
-------------------
1306

    
1307
As appears in the previous graph, a scale-out Synnefo deployment consists of
1308
multiple physical nodes that have the following roles:
1309

    
1310
* **WEBSERVER**: A web server running in front of gunicorn (e.g.: Apache, nginx)
1311
* **ASTAKOS**: The Astakos application (gunicorn)
1312
* **ASTAKOS_DB**: The Astakos database (postgresql)
1313
* **PITHOS**: The Pithos application (gunicorn)
1314
* **PITHOS_DB**: The Pithos database (postgresql)
1315
* **CYCLADES**: The Cyclades application (gunicorn)
1316
* **CYCLADES_DB**: The Cyclades database (postgresql)
1317
* **MQ**: The message queue (RabbitMQ)
1318
* **GANETI_MASTER**: The Ganeti master of a Ganeti cluster
1319
* **GANETI_NODE** : A VM-capable Ganeti node of a Ganeti cluster
1320

    
1321
You will probably also have:
1322

    
1323
* **CMS**: The CMS used as a frotend portal for the Synnefo services
1324
* **NS**: A nameserver serving all other Synnefo nodes and resolving Synnefo FQDNs
1325
* **CLIENT**: A machine that runs the Synnefo clients (e.g.: kamaki, Web UI),
1326
              most of the times, the end user's local machine
1327

    
1328
From this point we will also refer to the following groups of roles:
1329

    
1330
* **SYNNEFO**: [ **ASTAKOS**, **ASTAKOS_DB**, **PITHOS**, **PITHOS_DB**, **CYCLADES**, **CYCLADES_DB**, **MQ**, **CMS**]
1331
* **G_BACKEND**: [**GANETI_MASTER**, **GANETI_NODE**]
1332

    
1333
Of course, when deploying Synnefo you can combine multiple of the above roles on a
1334
single physical node, but if you are trying to scale out, the above separation
1335
gives you significant advantages.
1336

    
1337
So, in the next section we will take a look on what components you will have to
1338
install on each physical node depending on its Synnefo role. We assume the graph's
1339
architecture.
1340

    
1341
Components for each role
1342
------------------------
1343

    
1344
When deploying Synnefo in large scale, you need to install different Synnefo
1345
or/and third party components on different physical nodes according to their
1346
Synnefo role, as stated in the previous section.
1347

    
1348
Specifically:
1349

    
1350
Role **WEBSERVER**
1351
    * Synnefo components: `None`
1352
    * 3rd party components: Apache
1353
Role **ASTAKOS**
1354
    * Synnefo components: `snf-webproject`, `snf-astakos-app`
1355
    * 3rd party components: Django, Gunicorn
1356
Role **ASTAKOS_DB**
1357
    * Synnefo components: `None`
1358
    * 3rd party components: PostgreSQL
1359
Role **PITHOS**
1360
    * Synnefo components: `snf-webproject`, `snf-pithos-app`, `snf-pithos-webclient`
1361
    * 3rd party components: Django, Gunicorn
1362
Role **PITHOS_DB**
1363
    * Synnefo components: `None`
1364
    * 3rd party components: PostgreSQL
1365
Role **CYCLADES**
1366
    * Synnefo components: `snf-webproject`, `snf-cyclades-app`, `snf-vncauthproxy`
1367
    * 3rd party components: Django Gunicorn
1368
Role **CYCLADES_DB**
1369
    * Synnefo components: `None`
1370
    * 3rd party components: PostgreSQL
1371
Role **MQ**
1372
    * Synnefo components: `None`
1373
    * 3rd party components: RabbitMQ
1374
Role **GANETI_MASTER**
1375
    * Synnefo components: `snf-cyclades-gtools`
1376
    * 3rd party components: Ganeti
1377
Role **GANETI_NODE**
1378
    * Synnefo components: `snf-cyclades-gtools`, `snf-network`, `snf-image`, `nfdhcpd`
1379
    * 3rd party components: Ganeti
1380
Role **CMS**
1381
    * Synnefo components: `snf-webproject`, `snf-cloudcms`
1382
    * 3rd party components: Django, Gunicorn
1383
Role **NS**
1384
    * Synnefo components: `None`
1385
    * 3rd party components: BIND
1386
Role **CLIENT**
1387
    * Synnefo components: `kamaki`, `snf-image-creator`
1388
    * 3rd party components: `None`
1389

    
1390
Example scale out installation
1391
------------------------------
1392

    
1393
In this section we describe an example of a medium scale installation which
1394
combines multiple roles on 10 different physical nodes. We also provide a
1395
:ref:`guide <i-synnefo>` to help with such an install.
1396

    
1397
We assume that we have the following 10 physical nodes with the corresponding
1398
roles:
1399

    
1400
Node1:
1401
    **WEBSERVER**, **ASTAKOS**
1402
      Guide sections:
1403
        * :ref:`apt <i-apt>`
1404
        * :ref:`gunicorn <i-gunicorn>`
1405
        * :ref:`apache <i-apache>`
1406
        * :ref:`snf-webproject <i-webproject>`
1407
        * :ref:`snf-astakos-app <i-astakos>`
1408
Node2:
1409
    **WEBSERVER**, **PITHOS**
1410
      Guide sections:
1411
        * :ref:`apt <i-apt>`
1412
        * :ref:`gunicorn <i-gunicorn>`
1413
        * :ref:`apache <i-apache>`
1414
        * :ref:`snf-webproject <i-webproject>`
1415
        * :ref:`snf-pithos-app <i-pithos>`
1416
        * :ref:`snf-pithos-webclient <i-pithos>`
1417
Node3:
1418
    **WEBSERVER**, **CYCLADES**
1419
      Guide sections:
1420
        * :ref:`apt <i-apt>`
1421
        * :ref:`gunicorn <i-gunicorn>`
1422
        * :ref:`apache <i-apache>`
1423
        * :ref:`snf-webproject <i-webproject>`
1424
        * :ref:`snf-cyclades-app <i-cyclades>`
1425
        * :ref:`snf-vncauthproxy <i-cyclades>`
1426
Node4:
1427
    **WEBSERVER**, **CMS**
1428
      Guide sections:
1429
        * :ref:`apt <i-apt>`
1430
        * :ref:`gunicorn <i-gunicorn>`
1431
        * :ref:`apache <i-apache>`
1432
        * :ref:`snf-webproject <i-webproject>`
1433
        * :ref:`snf-cloudcms <i-cms>`
1434
Node5:
1435
    **ASTAKOS_DB**, **PITHOS_DB**, **CYCLADES_DB**
1436
      Guide sections:
1437
        * :ref:`apt <i-apt>`
1438
        * :ref:`postgresql <i-db>`
1439
Node6:
1440
    **MQ**
1441
      Guide sections:
1442
        * :ref:`apt <i-apt>`
1443
        * :ref:`rabbitmq <i-mq>`
1444
Node7:
1445
    **GANETI_MASTER**, **GANETI_NODE**
1446
      Guide sections:
1447
        * :ref:`apt <i-apt>`
1448
        * :ref:`general <i-backends>`
1449
        * :ref:`ganeti <i-ganeti>`
1450
        * :ref:`snf-cyclades-gtools <i-gtools>`
1451
        * :ref:`snf-network <i-network>`
1452
        * :ref:`snf-image <i-image>`
1453
        * :ref:`nfdhcpd <i-network>`
1454
Node8:
1455
    **GANETI_NODE**
1456
      Guide sections:
1457
        * :ref:`apt <i-apt>`
1458
        * :ref:`general <i-backends>`
1459
        * :ref:`ganeti <i-ganeti>`
1460
        * :ref:`snf-cyclades-gtools <i-gtools>`
1461
        * :ref:`snf-network <i-network>`
1462
        * :ref:`snf-image <i-image>`
1463
        * :ref:`nfdhcpd <i-network>`
1464
Node9:
1465
    **GANETI_NODE**
1466
      Guide sections:
1467
        `Same as Node8`
1468
Node10:
1469
    **GANETI_NODE**
1470
      Guide sections:
1471
        `Same as Node8`
1472

    
1473
All sections: :ref:`Scale out Guide <i-synnefo>`
1474

    
1475

    
1476
Upgrade Notes
1477
=============
1478

    
1479
.. toctree::
1480
   :maxdepth: 1
1481

    
1482
   v0.12 -> v0.13 <upgrade/upgrade-0.13>
1483

    
1484

    
1485
Changelog, NEWS
1486
===============
1487

    
1488
* v0.13 :ref:`Changelog <Changelog-0.13>`, :ref:`NEWS <NEWS-0.13>`