Revision 04c1254b

b/docs/quick-install-admin-guide.rst
451 451
django project. This corner case concerns only very advanced users that know
452 452
what they are doing and want to experiment with synnefo.
453 453

  
454

  
455
.. _conf-astakos:
456

  
454 457
Configuration of Astakos
455 458
========================
456 459

  
......
646 649
interface's cloudbar, at the top of the Astakos homepage.
647 650

  
648 651

  
652
.. _conf-pithos:
653

  
649 654
Configuration of Pithos+
650 655
========================
651 656

  
......
1217 1222
Make sure everything works as expected, before proceeding with the Private
1218 1223
Networks setup.
1219 1224

  
1225
.. _private-networks-setup:
1226

  
1220 1227
Private Networks setup
1221 1228
----------------------
1222 1229

  
......
1356 1363
Configure ``snf-cyclades-gtools``
1357 1364
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1358 1365

  
1359
The package will install the ``/etc/synnefo/20-snf-cyclades-gtools.conf``
1366
The package will install the ``/etc/synnefo/10-snf-cyclades-gtools-backend.conf``
1360 1367
configuration file. At least we need to set the RabbitMQ endpoint for all tools
1361 1368
that need it:
1362 1369

  
......
1417 1424
automatically along with Cyclades, because it is contained in the same Synnefo
1418 1425
component right now.
1419 1426

  
1427
We will install Cyclades (and Plankton) on node1. To do so, we install the
1428
corresponding package by running on node1:
1429

  
1430
.. code-block:: console
1431

  
1432
   # apt-get install snf-cyclades-app
1433

  
1434
If the package installs successfully, then Cyclades and Plankton are installed
1435
and we proceed with their configuration.
1436

  
1420 1437

  
1421 1438
Configuration of Cyclades (and Plankton)
1422 1439
========================================
1423 1440

  
1424
This section targets the configuration of the prerequisites for cyclades,
1425
and the configuration of the associated synnefo software components.
1441
Conf files
1442
----------
1426 1443

  
1427
synnefo components
1428
------------------
1444
After installing Cyclades, a number of new configuration files will appear under
1445
``/etc/synnefo/`` prefixed with ``20-snf-cyclades-app-``. We will descibe here
1446
only the minimal needed changes to result with a working system. In general, sane
1447
defaults have been chosen for the most of the options, to cover most of the
1448
common scenarios. However, if you want to tweak Cyclades feel free to do so,
1449
once you get familiar with the different options.
1429 1450

  
1430
cyclades uses :ref:`snf-common <snf-common>` for settings.
1431
Please refer to the configuration sections of
1432
:ref:`snf-webproject <snf-webproject>`,
1433
:ref:`snf-cyclades-app <snf-cyclades-app>`,
1434
:ref:`snf-cyclades-gtools <snf-cyclades-gtools>` for more
1435
information on their configuration.
1451
Edit ``/etc/synnefo/20-snf-cyclades-app-api.conf``:
1436 1452

  
1437
Ganeti
1438
~~~~~~
1453
.. code-block:: console
1454

  
1455
   GANETI_MAX_LINK_NUMBER = 20
1456
   ASTAKOS_URL = 'https://accounts.node1.example.com/im/authenticate'
1457

  
1458
The ``GANETI_MAX_LINK_NUMBER`` is used to construct the names of the bridges
1459
already pre-provisioned for the Private Networks. Thus we set it to ``20``, to
1460
reflect our :ref:`Private Networks setup in the host machines
1461
<private-networks-setup>`. These numbers will suffix the
1462
``GANETI_LINK_PREFIX``, which is already set to ``prv`` and doesn't need to be
1463
changed. With those two variables Cyclades will construct the names of the
1464
available bridges ``prv1`` to ``prv20``, which are the real pre-provisioned
1465
bridges in the backend.
1466

  
1467
The ``ASTAKOS_URL`` denotes the authentication endpoint for Cyclades and is set
1468
to point to Astakos (this should have the same value with Pithos+'s
1469
``PITHOS_AUTHENTICATION_URL``, setup :ref:`previously <conf-pithos>`).
1470

  
1471
Edit ``/etc/synnefo/20-snf-cyclades-app-backend.conf``:
1472

  
1473
.. code-block:: console
1439 1474

  
1440
Set ``GANETI_NODES``, ``GANETI_MASTER_IP``, ``GANETI_CLUSTER_INFO`` based on
1441
your :ref:`Ganeti installation <cyclades-install-ganeti>` and change the
1442
`BACKEND_PREFIX_ID`` setting, using an custom ``PREFIX_ID``.
1475
   GANETI_MASTER_IP = "ganeti.node1.example.com"
1476
   GANETI_CLUSTER_INFO = (GANETI_MASTER_IP, 5080, "cyclades", "example_rapi_passw0rd")
1443 1477

  
1444
Database
1445
~~~~~~~~
1478
``GANETI_MASTER_IP`` denotes the Ganeti-master's floating IP. We provide the
1479
corresponding domain that resolves to that IP, than the IP itself, to ensure
1480
Cyclades can talk to Ganeti even after a Ganeti master-failover.
1446 1481

  
1447
Once all components are installed and configured,
1448
initialize the Django DB:
1482
``GANETI_CLUSTER_INFO`` is a tuple containing the ``GANETI_MASTER_IP``, the RAPI
1483
port, the RAPI user's username and the RAPI user's password. We set the above to
1484
reflect our :ref:`RAPI User setup <rapi-user>`.
1485

  
1486
Edit ``/etc/synnefo/20-snf-cyclades-app-cloudbar.conf``:
1487

  
1488
.. code-block:: console
1489

  
1490
   CLOUDBAR_LOCATION = 'https://accounts.node1.example.com/static/im/cloudbar/'
1491
   CLOUDBAR_ACTIVE_SERVICE = 'cyclades'
1492
   CLOUDBAR_SERVICES_URL = 'https://accounts.node1.example.com/im/get_services'
1493
   CLOUDBAR_MENU_URL = 'https://account.node1.example.com/im/get_menu'
1494

  
1495
``CLOUDBAR_LOCATION`` tells the client where to find the Astakos common
1496
cloudbar. The ``CLOUDBAR_SERVICES_URL`` and ``CLOUDBAR_MENU_URL`` options are
1497
used by the Cyclades Web UI to get from Astakos all the information needed to
1498
fill its own cloudbar. So, we put our Astakos deployment urls there. All the
1499
above should have the same values we put in the corresponding variables in
1500
``/etc/synnefo/20-snf-pithos-webclient-cloudbar.conf`` on the previous
1501
:ref:`Pithos configuration <conf-pithos>` section.
1502

  
1503
The ``CLOUDBAR_ACTIVE_SERVICE`` registers Cyclades as a new service served by
1504
Astakos. It’s name should be identical with the id name given at the Astakos’
1505
``ASTAKOS_CLOUD_SERVICES`` variable. Note that at the Astakos :ref:`Conf Files
1506
<conf-astakos>` section, we actually set the second item of the
1507
``ASTAKOS_CLOUD_SERVICES`` list, to the dictionary: { 'url':'https://nod...',
1508
'name':'cyclades', 'id':'cyclades' }. This item represents the Cyclades service.
1509
The ``id`` we set there, is the ``id`` we want here.
1510

  
1511
Edit ``/etc/synnefo/20-snf-cyclades-app-plankton.conf``:
1512

  
1513
.. code-block:: console
1514

  
1515
   BACKEND_DB_CONNECTION = 'postgresql://synnefo:example_passw0rd@node1.example.com:5432/snf_pithos'
1516
   BACKEND_BLOCK_PATH = '/srv/pithos/data/'
1517

  
1518
In this file we configure the Plankton Service. ``BACKEND_DB_CONNECTION``
1519
denotes the Pithos+ database (where the Image files are stored). So we set that
1520
to point to our Pithos+ database. ``BACKEND_BLOCK_PATH`` denotes the actual
1521
Pithos+ data location.
1522

  
1523
Edit ``/etc/synnefo/20-snf-cyclades-app-queues.conf``:
1524

  
1525
.. code-block:: console
1526

  
1527
   RABBIT_HOST = "node1.example.com:5672"
1528
   RABBIT_USERNAME = "synnefo"
1529
   RABBIT_PASSWORD = "example_rabbitmq_passw0rd"
1530

  
1531
The above settings denote the Message Queue. Those settings should have the same
1532
values as in ``/etc/synnefo/10-snf-cyclades-gtools-backend.conf`` file, and
1533
reflect our :ref:`Message Queue setup <rabbitmq-setup>`.
1534

  
1535
Edit ``/etc/synnefo/20-snf-cyclades-app-ui.conf``:
1536

  
1537
.. code-block:: console
1538

  
1539
   UI_MEDIA_URL = '/static/ui/static/snf/'
1540
   UI_LOGIN_URL = "https://accounts.node1.example.com/im/login"
1541
   UI_LOGOUT_URL = "https://accounts.node1.example.com/im/logout"
1542

  
1543
``UI_MEDIA_URL`` denotes the location of the UI's static files.
1544

  
1545
The ``UI_LOGIN_URL`` option tells the Cyclades Web UI where to redirect users,
1546
if they are not logged in. We point that to Astakos.
1547

  
1548
The ``UI_LOGOUT_URL`` option tells the Cyclades Web UI where to redirect the
1549
user when he/she logs out. We point that to Astakos, too.
1550

  
1551
We have now finished with the basic Cyclades and Plankton configuration.
1552

  
1553
Database Initialization
1554
-----------------------
1555

  
1556
Once Cyclades is configured, we sync the database:
1449 1557

  
1450 1558
.. code-block:: console
1451 1559

  
1452 1560
   $ snf-manage syncdb
1453 1561
   $ snf-manage migrate
1454 1562

  
1455
and load fixtures ``{users, flavors, images}``,
1456
which make the API usable by end users by defining a sample set of users,
1457
hardware configurations (flavors) and OS images:
1563
and load the initial server flavors:
1458 1564

  
1459 1565
.. code-block:: console
1460 1566

  
1461
   $ snf-manage loaddata /path/to/users.json
1462 1567
   $ snf-manage loaddata flavors
1463
   $ snf-manage loaddata images
1464 1568

  
1465
.. warning::
1466
    Be sure to load a custom users.json and select a unique token
1467
    for each of the initial and any other users defined in this file.
1468
    **DO NOT LEAVE THE SAMPLE AUTHENTICATION TOKENS** enabled in deployed
1469
    configurations.
1569
If everything returns successfully, our database is ready.
1570

  
1571
Servers restart
1572
---------------
1573

  
1574
We also need to restart gunicorn on node1:
1575

  
1576
.. code-block:: console
1470 1577

  
1471
sample users.json file:
1578
   # /etc/init.d/gunicorn restart
1472 1579

  
1473
.. literalinclude:: ../../synnefo/db/fixtures/users.json
1580
Now let's do the final connections of Cyclades with Ganeti.
1474 1581

  
1475
`download <../_static/users.json>`_
1582
``snf-dispatcher`` initialization
1583
---------------------------------
1584

  
1585
``snf-dispatcher`` dispatches all messages published to the Message Queue and
1586
manages the Cyclades database accordingly. It also initializes all exchanges. By
1587
default it is not enabled during installation of Cyclades, so let's enable it in
1588
its configuration file ``/etc/default/snf-dispatcher``:
1589

  
1590
.. code-block:: console
1591

  
1592
   SNF_DSPTCH_ENABLE=true
1593

  
1594
and start the daemon:
1595

  
1596
.. code-block:: console
1597

  
1598
   # /etc/init.d/snf-dispatcher start
1599

  
1600
You can see that everything works correctly by tailing its log file
1601
``/var/log/synnefo/dispatcher.log``.
1602

  
1603
``snf-ganeti-eventd`` on GANETI MASTER
1604
--------------------------------------
1605

  
1606
The last step of the Cyclades setup is enabling the ``snf-ganeti-eventd``
1607
daemon (part of the :ref:`Cyclades Ganeti tools <cyclades-gtools>` package).
1608
The daemon is already installed on the GANETI MASTER (node1 in our case).
1609
``snf-ganeti-eventd`` is disabled by default during the ``snf-cyclades-gtools``
1610
installation, so we enable it in its configuration file
1611
``/etc/default/snf-ganeti-eventd``:
1612

  
1613
.. code-block:: console
1614

  
1615
   SNF_EVENTD_ENABLE=true
1616

  
1617
and start the daemon:
1618

  
1619
.. code-block:: console
1476 1620

  
1477
RabbitMQ
1478
~~~~~~~~
1621
   # /etc/init.d/snf-ganeti-eventd start
1479 1622

  
1480
Change ``RABBIT_*`` settings to match your :ref:`RabbitMQ setup
1481
<cyclades-install-rabbitmq>`.
1623
.. warning:: Make sure you start ``snf-ganeti-eventd`` *ONLY* on GANETI MASTER
1482 1624

  
1483
.. include:: ../../Changelog
1625
If all the above return successfully, then you have finished with the Cyclades
1626
and Plankton installation and setup. Let's test our installation now.
1484 1627

  
1485 1628

  
1486 1629
Testing of Cyclades (and Plankton)

Also available in: Unified diff