Statistics
| Branch: | Tag: | Revision:

root / docs / admin-guide.rst @ 08ad5b01

History | View | Annotate | Download (51.9 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
.. _branding:
924

    
925
Branding
926
--------
927

    
928
Since Synnefo v0.14, you are able to adapt the Astakos, Pithos and Cyclades Web
929
UI to your company’s visual identity. This is possible using the snf-branding
930
component, which is automatically installed on the nodes running the API
931
servers for Astakos, Pithos and Cyclades. 
932

    
933
Configuration
934
~~~~~~~~~~~~~
935

    
936
This can be done by changing only the settings of the snf-branding component.
937
The settings for the snf-branding application can be found inside the
938
configuration file ``/etc/synnefo/15-snf-branding.conf`` on the nodes that have
939
Astakos, Pithos and Cyclades installed.
940

    
941
By default, the global service name is "Synnefo" and the company name is
942
"GRNET". These names and their respective logos and URLs are used throughout
943
the Astakos, Pithos and Cyclades UI.
944

    
945
**Names and URLs:**
946

    
947
The first group of branding customization refers to the service's and company's
948
information.
949

    
950
You can overwrite the company and the service name and URL respectively by
951
uncommenting and setting the following:
952

    
953
.. code-block:: console
954

    
955
  #BRANDING_SERVICE_NAME = 'Synnefo'
956
  #BRANDING_SERVICE_URL = 'http://www.synnefo.org/'
957
  #BRANDING_COMPANY_NAME = 'GRNET'
958
  #BRANDING_COMPANY_URL = 'https://www.grnet.gr/en/'
959

    
960
| ``BRANDING_SERVICE_NAME`` appears in Astakos Dashboard/Projects pages.
961
| ``BRANDING_COMPANY_NAME`` and ``BRANDING_COMPANY_URL`` appear in Astakos,
962
  Pithos and Cyclades footer only if ``BRANDING_SHOW_COPYRIGHT`` is set to True.
963

    
964
**Copyright options:**
965

    
966
By default, no Copyright message is shown in the UI footer. If you want to make
967
it visible in the footer of Astakos, Pithos and Cyclades UI, you can uncomment
968
and set to ``True`` the setting:
969

    
970
.. code-block:: console
971

    
972
  #BRANDING_SHOW_COPYRIGHT = False
973

    
974
Copyright message defaults to 'Copyright (c) 2011-<current_year> 
975
<BRANDING_COMPANY_NAME>.' but you can overwrite it to a completely custom one by
976
setting the following option:
977

    
978
.. code-block:: console
979

    
980
  #BRANDING_COPYRIGHT_MESSAGE = 'Copyright (c) 2011-<current_year> GRNET'
981

    
982
**Images:**
983

    
984
The Astakos, Pithos and Cyclades Web UI has some logos and images.
985
 
986
The branding-related images are presented in  the following table:
987

    
988
===============  ============================  =========
989
Image            Name/extension  convention    Usage
990
===============  ============================  =========
991
Favicon          favicon.ico                   Favicon for all services
992
Dashboard logo   dashboard_logo.png            Visible in all Astakos UI pages
993
Compute logo     compute_logo.png              Visible in all Cyclades UI pages
994
Console logo     console_logo.png              Visible in the Cyclades Console Window
995
Storage logo     storage_logo.png              Visible in all Pithos UI pages
996
===============  ============================  =========
997

    
998
There are two methods  available for replacing all, or individual, 
999
branding-related images:
1000

    
1001
1. Create a new directory and  place there some or all of your images.
1002

    
1003
   If you want to replace all of your images, keep the name/extension
1004
   conventions as indicated in the above table and set:
1005

    
1006
.. code-block:: console
1007

    
1008
  #BRANDING_IMAGE_MEDIA_URL= MEDIA_URL + 'branding/images/' 
1009

    
1010
to the relative path of your directory. 
1011
You could also use an absolute path to a directory and set for example 
1012
``BRANDING_IMAGE_MEDIA_URL`` = 'https://www.synnefo.org/images/'
1013

    
1014
   If you wish to replace individual images, **do not uncomment**
1015
   ``BRANDING_IMAGE_MEDIA_URL``, but instead provide a relative path, pointing to
1016
   the file inside your directory for each ``BRANDING_<image>_URL`` that you wish
1017
   to replace.
1018

    
1019
2. Upload some or all of your images to a server and replace each 
1020
   ``BRANDING_<image>_URL`` with the absolute url of the image (i.e.
1021
   ``BRANDING_DASHBOARD_URL``= 'https://www.synnefo.com/images/my_dashboard.jpg').
1022

    
1023
   Note that the alternative text  for each image tag inside html documents  is 
1024
   alt=“BRANDING_SERVICE_NAME {Dashboard, Compute. Console, Storage}” respectively.
1025

    
1026
.. note:: Retina optimized images:
1027

    
1028
   Synnefo UI is optimized for Retina displays. As far as images are concerned,  
1029
   `retina.js <http://retinajs.com/>`_ is used.
1030

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

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

    
1041
   For each of the images that you wish the script to  replace, you must have a 
1042
   high-resolution variant in the same folder  named correctly and it will be 
1043
   detected automatically. For example if your image is in <my_directory> and is 
1044
   named "my_image.jpg" the script will look in the same directory for an image 
1045
   named "my_image@2x.jpg".
1046

    
1047
   In case that you don’t want to use a high-resolution image, the 
1048
   normal-resolution image will be visible.
1049

    
1050
More branding
1051
~~~~~~~~~~~~~
1052

    
1053
Although, it is not 100% branding-related, further verbal customization is
1054
feasible. 
1055

    
1056
**EMAILS**
1057

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

    
1062
For more information visit  
1063
https://docs.djangoproject.com/en/1.2/ref/settings/#template-dirs.                           
1064

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

    
1089
Feel free to omit any of the above files you do not wish to overwrite.
1090

    
1091
Below is a list of all emails sent by Synnefo to users along with a short 
1092
description and a link to their content:
1093

    
1094
* ``snf-astakos-app/astakos/im/templates/im/email.txt``
1095
  Base email template. Contains a contact email and a “thank you” message.
1096
  (`Link <https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/im/email.txt>`_)
1097
* ``snf-astakos-app/astakos/im/templates/im/activation_email.txt`` Email sent to
1098
  user that prompts  him/her to click on a link provided to activate the account.
1099
  Extends “email.txt” (`Link <https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/im/activation_email.txt>`_)
1100
* ``snf-astakos-app/astakos/im/templates/im/invitation.txt`` Email sent to an
1101
  invited user. He/she has to click on a link provided to activate the account.
1102
  Extends “email.txt” (`Link <https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/im/invitation.txt>`_)
1103
* ``snf-astakos-app/astakos/im/templates/im/switch_accounts_email.txt`` Email
1104
  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” (`Link <https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/im/switch_accounts_email.txt>`_)
1107
* ``snf-astakos-app/astakos/im/templates/im/welcome_email.txt`` Email sent to
1108
  inform the user that his/ her account has been activated. Extends “email.txt”
1109
  (`Link <https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/im/welcome_email.txt>`_)
1110
* ``snf-astakos-app/astakos/im/templates/registration/email_change_email.txt``
1111
  Email sent to user when he/she has requested new email address assignment. The
1112
  user has to click on a link provided to validate this action. Extends
1113
  “email.txt” (`Link <https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/registration/email_change_email.txt>`_)
1114
* ``snf-astakos-app/astakos/im/templates/registration/password_email.txt`` Email
1115
  sent for resetting password purpose. The user has to click on a link provided
1116
  to validate this action. Extends “email.txt” (`Link <https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/registration/password_email.txt>`_)
1117
* ``snf-astakos-app/astakos/im/templates/im/projects/project_approval_notification.txt``
1118
  Informs  the project owner that his/her project has been approved. Extends
1119
  “email.txt” (`Link <https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/im/projects/project_approval_notification.txt>`_)
1120
* ``snf-astakos-app/astakos/im/templates/im/projects/project_denial_notification.txt``
1121
  Informs the project owner that his/her  project application has been denied
1122
  explaining the reasons. Extends “email.txt” (`Link <https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/im/projects/project_denial_notification.txt>`_)
1123
* ``snf-astakos-app/astakos/im/templates/im/projects/project_membership_change_notification.txt``
1124
  An email is sent to a user containing information about his project membership
1125
  (whether he has been accepted, rejected or removed). Extends “email.txt” (`Link
1126
  <https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/im/projects/project_membership_change_notification.txt>`_)
1127
* ``snf-astakos-app/astakos/im/templates/im/projects/project_membership_enroll_notification.txt``
1128
  Informs a user that he/she  has been enrolled to a project. Extends
1129
  “email.txt” (`Link <https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/im/projects/project_membership_enroll_notification.txt>`_)
1130
* ``snf-astakos-app/astakos/im/templates/im/projects/project_membership_leave_request_notification.txt``
1131
  An email is sent to the project owner to make him aware of a  user having
1132
  requested to leave his project. Extends “email.txt” (`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>`_)
1133
* ``snf-astakos-app/astakos/im/templates/im/projects/project_membership_request_notification.txt``
1134
  An email is sent to the project owner to make him/her aware of a user having
1135
  requested to join  his project. Extends “email.txt” (`Link <https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/im/projects/project_membership_request_notification.txt>`_)
1136
* ``snf-astakos-app/astakos/im/templates/im/projects/project_suspension_notification.txt``
1137
  An email is sent to the project owner to make him/her aware of his/her project
1138
  having been suspended. Extends “email.txt” (`Link <https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/im/projects/project_suspension_notification.txt>`_)
1139
* ``snf-astakos-app/astakos/im/templates/im/projects/project_termination_notification.txt``
1140
  An email is sent to the project owner to make him/her aware of his/her project
1141
  having been terminated. Extends “email.txt” (`Link <https://code.grnet.gr/projects/synnefo/repository/revisions/master/changes/snf-astakos-app/astakos/im/templates/im/projects/project_termination_notification.txt>`_)
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
.. RabbitMQ
1152

    
1153
RabbitMQ Broker
1154
---------------
1155

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

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

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

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

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

    
1183

    
1184
Installation
1185
~~~~~~~~~~~~
1186

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

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

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

    
1199
.. code-block:: console
1200

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

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

    
1207
.. code-block:: console
1208

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

    
1211
and restart the nodes:
1212

    
1213
.. code-block:: console
1214

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

    
1217

    
1218
To setup the RabbitMQ cluster run:
1219

    
1220
.. code-block:: console
1221

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

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

    
1229
.. code-block:: console
1230

    
1231
  root@node2: rabbitmqctl cluster_status
1232

    
1233

    
1234

    
1235

    
1236

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

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

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

    
1248
.. code-block:: console
1249

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

    
1252
Logging
1253
-------
1254

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

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

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

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

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

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

    
1274

    
1275
.. _scale-up:
1276

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

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

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

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

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

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

    
1301
.. _physical-node-roles:
1302

    
1303
Physical Node roles
1304
-------------------
1305

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

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

    
1320
You will probably also have:
1321

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

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

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

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

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

    
1340
Components for each role
1341
------------------------
1342

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

    
1347
Specifically:
1348

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

    
1389
Example scale out installation
1390
------------------------------
1391

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

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

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

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

    
1474

    
1475
Upgrade Notes
1476
=============
1477

    
1478
.. toctree::
1479
   :maxdepth: 1
1480

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

    
1483

    
1484
Changelog, NEWS
1485
===============
1486

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