Revision dd6062f2 docs/quick-install-admin-guide.rst

b/docs/quick-install-admin-guide.rst
37 37
are "node1.example.com" and "node2.example.com" and their public IPs are "203.0.113.1" and
38 38
"203.0.113.2" respectively. It is important that the two machines are under the same domain name.
39 39
In case you choose to follow a private installation you will need to
40
set up a private dns server, using dnsmasq for example. See node1 below for 
40
set up a private dns server, using dnsmasq for example. See node1 below for
41 41
more information on how to do so.
42 42

  
43 43
General Prerequisites
......
167 167
Certificate Creation
168 168
~~~~~~~~~~~~~~~~~~~~~
169 169

  
170
Node1 will host Cyclades. Cyclades should communicate with the other Synnefo 
171
Services and users over a secure channel. In order for the connection to be 
170
Node1 will host Cyclades. Cyclades should communicate with the other Synnefo
171
Services and users over a secure channel. In order for the connection to be
172 172
trusted, the keys provided to Apache below should be signed with a certificate.
173 173
This certificate should be added to all nodes. In case you don't have signed keys you can create a self-signed certificate
174 174
and sign your keys with this. To do so on node1 run:
......
209 209

  
210 210
		# ./build-key-server node1.example.com
211 211

  
212
This will create a ``01.pem`` and a ``node1.example.com.key`` files in the 
212
This will create a ``01.pem`` and a ``node1.example.com.key`` files in the
213 213
``/etc/openvpn/easy-rsa/2.0/keys`` directory. Copy these in ``/etc/ssl/certs/``
214 214
and ``/etc/ssl/private/`` respectively and use them in the apache2
215 215
configuration file below instead of the defaults.
......
316 316
Pithos data directory setup
317 317
~~~~~~~~~~~~~~~~~~~~~~~~~~~
318 318

  
319
As mentioned in the General Prerequisites section, there should be a directory 
319
As mentioned in the General Prerequisites section, there should be a directory
320 320
called ``/srv/pithos`` visible by both nodes. We create and setup the ``data``
321 321
directory inside it:
322 322

  
......
338 338
Now edit ``/etc/exports`` and add the following line:
339 339

  
340 340
.. code-block:: console
341
   
341

  
342 342
   /srv/pithos/ 203.0.113.2(rw,no_root_squash,sync,subtree_check)
343 343

  
344 344
Once done, run:
......
370 370
There is a `"bug" in libevent 2.0.5 <http://sourceforge.net/p/levent/bugs/193/>`_
371 371
, where if you have multiple nameservers in your ``/etc/resolv.conf``, libevent
372 372
will round-robin against them. To avoid this, you must use a single nameserver
373
for all your needs. Edit your ``/etc/resolv.conf`` to include your dns server: 
373
for all your needs. Edit your ``/etc/resolv.conf`` to include your dns server:
374 374

  
375 375
.. code-block:: console
376 376

  
377 377
   nameserver 203.0.113.1
378 378

  
379 379
Because of the aforementioned bug, you can't specify more than one DNS servers
380
in your ``/etc/resolv.conf``. In order for dnsmasq to serve domains not in 
381
``/etc/hosts``, edit ``/etc/dnsmasq.conf`` and change the line starting with 
380
in your ``/etc/resolv.conf``. In order for dnsmasq to serve domains not in
381
``/etc/hosts``, edit ``/etc/dnsmasq.conf`` and change the line starting with
382 382
``#resolv-file=`` to:
383 383

  
384 384
.. code-block:: console
......
392 392

  
393 393
   nameserver 8.8.8.8
394 394

  
395
In the ``/etc/dnsmasq.conf`` file, you can also specify the ``listen-address`` 
395
In the ``/etc/dnsmasq.conf`` file, you can also specify the ``listen-address``
396 396
and the ``interface`` you would like dnsmasq to listen to.
397 397

  
398 398
Finally, restart dnsmasq:
......
545 545

  
546 546
to inform the node about the new DNS server.
547 547

  
548
As mentioned before, this should be the only ``nameserver`` entry in 
548
As mentioned before, this should be the only ``nameserver`` entry in
549 549
``/etc/resolv.conf``.
550 550

  
551 551
We are now ready with all general prerequisites for node2. Now that we have
......
556 556
================================
557 557

  
558 558
To install Astakos, grab the package from our repository (make sure  you made
559
the additions needed in your ``/etc/apt/sources.list`` file and updated, as 
559
the additions needed in your ``/etc/apt/sources.list`` file and updated, as
560 560
described previously), by running:
561 561

  
562 562
.. code-block:: console
......
683 683
Email delivery configuration
684 684
----------------------------
685 685

  
686
Many of the ``Astakos`` operations require the server to notify service users 
687
and administrators via email. e.g. right after the signup process, the service 
688
sents an email to the registered email address containing an verification url. 
689
After the user verifies the email address, Astakos once again needs to 
686
Many of the ``Astakos`` operations require the server to notify service users
687
and administrators via email. e.g. right after the signup process, the service
688
sents an email to the registered email address containing an verification url.
689
After the user verifies the email address, Astakos once again needs to
690 690
notify administrators with a notice that a new account has just been verified.
691 691

  
692 692
More specifically Astakos sends emails in the following cases
......
1247 1247
Kamaki
1248 1248
======
1249 1249

  
1250
`Kamaki <http://www.synnefo.org/docs/kamaki/latest/index.html>`_ is an 
1251
Openstack API client library and command line interface with custom extentions 
1250
`Kamaki <http://www.synnefo.org/docs/kamaki/latest/index.html>`_ is an
1251
Openstack API client library and command line interface with custom extentions
1252 1252
specific to Synnefo.
1253 1253

  
1254 1254
Kamaki Installation and Configuration
......
1260 1260

  
1261 1261
   # apt-get install kamaki
1262 1262

  
1263
Now, visit 
1263
Now, visit
1264 1264

  
1265 1265
 `https://node1.example.com/astakos/ui/`
1266 1266

  
1267
log in and click on ``API access``. Scroll all the way to the bottom of the 
1267
log in and click on ``API access``. Scroll all the way to the bottom of the
1268 1268
page, click on the orange ``Download your .kamakirc`` button and save the file
1269 1269
as ``.kamakirc`` in your home directory.
1270 1270

  
......
1287 1287

  
1288 1288
`Ganeti <http://code.google.com/p/ganeti/>`_ handles the low level VM management
1289 1289
for Cyclades, so Cyclades requires a working Ganeti installation at the backend.
1290
Please refer to the `ganeti documentation <http://docs.ganeti.org/ganeti/2.8/html>`_ for all 
1290
Please refer to the `ganeti documentation <http://docs.ganeti.org/ganeti/2.8/html>`_ for all
1291 1291
the gory details. A successful Ganeti installation concludes with a working
1292 1292
:ref:`GANETI-MASTER <GANETI_NODES>` and a number of :ref:`GANETI-NODEs
1293 1293
<GANETI_NODES>`.
......
1313 1313
Ganeti requires FQDN. To properly configure your nodes please
1314 1314
see `this <http://docs.ganeti.org/ganeti/2.6/html/install.html#hostname-issues>`_.
1315 1315

  
1316
Ganeti requires an extra available IP and its FQDN e.g., ``203.0.113.100`` and 
1317
``ganeti.node1.example.com``. Add this IP to your DNS server configuration, as 
1316
Ganeti requires an extra available IP and its FQDN e.g., ``203.0.113.100`` and
1317
``ganeti.node1.example.com``. Add this IP to your DNS server configuration, as
1318 1318
explained above.
1319 1319

  
1320
Also, Ganeti will need a volume group with the same name e.g., ``ganeti`` 
1321
across all nodes, of at least 20GiB. To create the volume group, 
1320
Also, Ganeti will need a volume group with the same name e.g., ``ganeti``
1321
across all nodes, of at least 20GiB. To create the volume group,
1322 1322
see `this <http://www.tldp.org/HOWTO/LVM-HOWTO/createvgs.html>`_.
1323 1323

  
1324 1324
Moreover, node1 and node2 must have the same dsa, rsa keys and authorised_keys
1325
under ``/root/.ssh/`` for password-less root ssh between each other. To 
1325
under ``/root/.ssh/`` for password-less root ssh between each other. To
1326 1326
generate said keys, see `this <https://wiki.debian.org/SSH#Using_shared_keys>`_.
1327 1327

  
1328 1328
In the following sections, we assume that the public interface of all nodes is
1329
``eth0`` and there are two extra interfaces ``eth1`` and ``eth2``, which can 
1330
also be vlans on your primary interface e.g., ``eth0.1`` and ``eth0.2``  in 
1331
case you don't have multiple physical interfaces. For information on how to 
1329
``eth0`` and there are two extra interfaces ``eth1`` and ``eth2``, which can
1330
also be vlans on your primary interface e.g., ``eth0.1`` and ``eth0.2``  in
1331
case you don't have multiple physical interfaces. For information on how to
1332 1332
create vlans, please see
1333 1333
`this <https://wiki.debian.org/NetworkConfiguration#Howto_use_vlan_.28dot1q.2C_802.1q.2C_trunk.29_.28Etch.2C_Lenny.29>`_.
1334 1334

  
1335
Finally, setup two bridges on the host machines (e.g: br1/br2 on eth1/eth2 
1335
Finally, setup two bridges on the host machines (e.g: br1/br2 on eth1/eth2
1336 1336
respectively), as described `here <https://wiki.debian.org/BridgeNetworkConnections>`_.
1337 1337

  
1338 1338
Ganeti Installation and Initialization
1339 1339
--------------------------------------
1340 1340

  
1341
We assume that Ganeti will use the KVM hypervisor. To install KVM, run on all 
1341
We assume that Ganeti will use the KVM hypervisor. To install KVM, run on all
1342 1342
Ganeti nodes:
1343 1343

  
1344 1344
.. code-block:: console
1345 1345

  
1346 1346
   # apt-get install qemu-kvm
1347 1347

  
1348
It's time to install Ganeti. To be able to use hotplug (which will be part of 
1348
It's time to install Ganeti. To be able to use hotplug (which will be part of
1349 1349
the official Ganeti 2.10), we recommend using our Ganeti package version:
1350 1350

  
1351 1351
``2.8.2+snapshot1+b64v1+kvmopts1+extfix1+hotplug5+lockfix3+ippoolfix+rapifix+netxen-1~wheezy``
......
1353 1353
Let's briefly explain each patch:
1354 1354

  
1355 1355
    * hotplug: hotplug devices (NICs and Disks) (ganeti 2.10).
1356
    * b64v1: Save bitarray of network IP pools in config file, encoded in 
1356
    * b64v1: Save bitarray of network IP pools in config file, encoded in
1357 1357
      base64, instead of 0/1.
1358 1358
    * ippoolfix: Ability to give an externally reserved IP to an instance (e.g.
1359 1359
      gateway IP)  (ganeti 2.10).
1360
    * kvmopts: Export disk geometry to kvm command and add migration 
1360
    * kvmopts: Export disk geometry to kvm command and add migration
1361 1361
      capabilities.
1362 1362
    * extfix: Includes:
1363 1363

  
......
1365 1365
      * adds better arbitrary params support (modification, deletion).
1366 1366
      * cache, heads, cyls arbitrary params reach kvm command.
1367 1367

  
1368
    * rapifix: Extend RAPI το support 'depends' and 'shutdown_timeout' body 
1368
    * rapifix: Extend RAPI το support 'depends' and 'shutdown_timeout' body
1369 1369
      arguments. (ganeti 2.9).
1370
    * netxen: Network configuration for xen instances, exactly like in kvm 
1370
    * netxen: Network configuration for xen instances, exactly like in kvm
1371 1371
      instances. (ganeti 2.9).
1372 1372
    * lockfix2: Fixes for 2 locking issues:
1373 1373

  
1374
      * Issue 622: Fix for opportunistic locking that caused an assertion 
1374
      * Issue 622: Fix for opportunistic locking that caused an assertion
1375 1375
        error (Patch waiting in ganeti-devel list).
1376
      * Issue 621: Fix for network locking issue that resulted in: [Lock 
1376
      * Issue 621: Fix for network locking issue that resulted in: [Lock
1377 1377
        'XXXXXX' not found in set 'instance' (it may have been removed)].
1378 1378

  
1379 1379
    * snapshot: Add trivial 'snapshot' functionality that is unused by Synnefo
......
1385 1385

  
1386 1386
   # apt-get install snf-ganeti ganeti-htools ganeti-haskell
1387 1387

  
1388
Ganeti will make use of drbd. To enable this and make the configuration 
1388
Ganeti will make use of drbd. To enable this and make the configuration
1389 1389
permanent you have to do the following :
1390 1390

  
1391 1391
.. code-block:: console
......
1402 1402
                    --default-iallocator hail \
1403 1403
                    --hypervisor-parameters kvm:kernel_path=,vnc_bind_address=0.0.0.0 \
1404 1404
                    --master-netdev eth0 ganeti.node1.example.com
1405
    
1405

  
1406 1406
    root@node1:~ # gnt-node add --no-ssh-key-check --master-capable=yes \
1407 1407
                    --vm-capable=yes node2.example.com
1408 1408
    root@node1:~ # gnt-cluster modify --disk-parameters=drbd:metavg=ganeti
......
1521 1521
To upload the file using kamaki, run:
1522 1522

  
1523 1523
.. code-block:: console
1524
   
1524

  
1525 1525
   # kamaki file upload debian_base-6.0-x86_64.diskdump pithos
1526 1526

  
1527 1527
Once the Image is uploaded successfully, download the Image's metadata file
......
1540 1540
Now, it is time to test our installation so far. So, we have Astakos and
1541 1541
Pithos installed, we have a working Ganeti installation, the snf-image
1542 1542
definition installed on all VM-capable nodes, a Debian Squeeze Image on
1543
Pithos and kamaki installed and configured. Make sure you also have the 
1544
`metadata file <http://cdn.synnefo.org/debian_base-6.0-x86_64.diskdump.meta>`_ 
1543
Pithos and kamaki installed and configured. Make sure you also have the
1544
`metadata file <http://cdn.synnefo.org/debian_base-6.0-x86_64.diskdump.meta>`_
1545 1545
for this image.
1546 1546

  
1547 1547
To spawn a VM from a Pithos file, we need to know:
......
1550 1550
    2) The size of the file
1551 1551

  
1552 1552
If you uploaded the file with kamaki as described above, run:
1553
    
1553

  
1554 1554
.. code-block:: console
1555 1555

  
1556
   # kamaki file info pithos:debian_base-6.0-x86_64.diskdump 
1556
   # kamaki file info pithos:debian_base-6.0-x86_64.diskdump
1557 1557

  
1558
else, replace ``pithos`` and ``debian_base-6.0-x86_64.diskdump`` with the 
1558
else, replace ``pithos`` and ``debian_base-6.0-x86_64.diskdump`` with the
1559 1559
container and filename you used, when uploading the file.
1560 1560

  
1561 1561
The hashmap is the field ``x-object-hash``, while the size of the file is the
......
1578 1578
   should have the format ``pithosmap://<HashMap>/<size>``:
1579 1579

  
1580 1580
               * ``HashMap``: the map of the file
1581
               * ``size``: the size of the file, same size as reported in 
1581
               * ``size``: the size of the file, same size as reported in
1582 1582
                 ``ls -l filename``
1583 1583

  
1584 1584
 * ``img_properties``: taken from the metadata file. Used only the two mandatory
......
1622 1622
needs of the system administrator.
1623 1623

  
1624 1624
In this section, we'll describe the simplest scenario, which will provide
1625
access to the public Internet along with private networking capabilities for 
1625
access to the public Internet along with private networking capabilities for
1626 1626
the VMs.
1627 1627

  
1628 1628
.. _snf-network:
......
1650 1650
nfdhcpd
1651 1651
~~~~~~~
1652 1652

  
1653
nfdhcpd is an NFQUEUE based daemon, answering DHCP requests and running locally 
1654
on every Ganeti node. Its leases file, gets automatically updated by 
1653
nfdhcpd is an NFQUEUE based daemon, answering DHCP requests and running locally
1654
on every Ganeti node. Its leases file, gets automatically updated by
1655 1655
snf-network and information provided by Ganeti.
1656 1656

  
1657 1657
.. code-block:: console
......
1668 1668

  
1669 1669
   # /etc/init.d/nfdhcpd restart
1670 1670

  
1671
In order for nfdhcpd to receive the VMs requests, we have to mangle all DHCP 
1671
In order for nfdhcpd to receive the VMs requests, we have to mangle all DHCP
1672 1672
traffic coming from the corresponding interfaces. To accomplish that run:
1673 1673

  
1674 1674
.. code-block:: console
......
1690 1690

  
1691 1691
In the following section, we'll guide you through a very basic network setup.
1692 1692
This assumes the following:
1693
    
1693

  
1694 1694
    * Node1 has access to the public network via eth0.
1695 1695
    * Node1 will become a NAT server for the VMs.
1696 1696
    * All nodes have ``br1/br2`` dedicated for the VMs' public/private traffic.
......
1702 1702
To setup the NAT server on node1, run:
1703 1703

  
1704 1704
.. code-block:: console
1705
   
1705

  
1706 1706
   # ip addr add 10.0.0.1/24 dev br1
1707 1707
   # iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
1708 1708
   # echo 1 > /proc/sys/net/ipv4/ip_forward
1709 1709

  
1710 1710
and append it to your ``/etc/rc.local``.
1711
    
1711

  
1712 1712

  
1713 1713
Testing the Public Networks
1714 1714
~~~~~~~~~~~~~~~~~~~~~~~~~~~
......
1746 1746
Finally, run on the GANETI-MASTER (node1):
1747 1747

  
1748 1748
.. code-block:: console
1749
    
1749

  
1750 1750
   # gnt-instance add -o snf-image+default --os-parameters \
1751 1751
                      img_passwd=my_vm_example_passw0rd,img_format=diskdump,img_id=debian_base-6.0-x86_64,img_properties='{"OSFAMILY":"linux"\,"ROOT_PARTITION":"1"}' \
1752 1752
                      -t plain --disk 0:size=2G --no-name-check --no-ip-check \
......
1759 1759
    * snf-network bridges the tap interface to ``br1`` and updates nfdhcpd state.
1760 1760
    * nfdhcpd serves 10.0.0.2 IP to the interface of ``testvm2``.
1761 1761

  
1762
Now try to ping the outside world e.g., ``www.synnefo.org`` from inside the VM 
1762
Now try to ping the outside world e.g., ``www.synnefo.org`` from inside the VM
1763 1763
(connect to the VM using VNC as before).
1764 1764

  
1765 1765
Make sure everything works as expected, before proceeding with the Private
......
1770 1770
Private Networks Setup
1771 1771
----------------------
1772 1772

  
1773
In this section, we'll describe a basic network configuration, that will provide 
1774
isolated private networks to the end-users. All private network traffic, will 
1775
pass through ``br1`` and isolation will be guaranteed with a specific set of 
1773
In this section, we'll describe a basic network configuration, that will provide
1774
isolated private networks to the end-users. All private network traffic, will
1775
pass through ``br1`` and isolation will be guaranteed with a specific set of
1776 1776
``ebtables`` rules.
1777 1777

  
1778 1778
Testing the Private Networks
1779 1779
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1780 1780

  
1781
We'll create two instances and connect them to the same Private Network. This 
1781
We'll create two instances and connect them to the same Private Network. This
1782 1782
means that the instances will have a second NIC connected to the ``br1``.
1783 1783

  
1784 1784
.. code-block:: console
......
2085 2085
Cyclades supports different Public Networks on different Ganeti backends.
2086 2086
After connecting Cyclades with our Ganeti cluster, we need to setup a Public
2087 2087
Network for this Ganeti backend (`id = 1`). The basic setup is to bridge every
2088
created NIC on a bridge. 
2088
created NIC on a bridge.
2089 2089

  
2090 2090
.. code-block:: console
2091 2091

  
......
2271 2271
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2272 2272

  
2273 2273
For the purposes of the following example, we assume that the user has uploaded
2274
a file in container ``pithos`` called ``debian_base-6.0-x86_64``. Moreover, 
2274
a file in container ``pithos`` called ``debian_base-6.0-x86_64``. Moreover,
2275 2275
he should have the appropriate `metadata file <http://cdn.synnefo.org/debian_base-6.0-x86_64.diskdump.meta>`_.
2276 2276

  
2277 2277
Once the Image file has been successfully uploaded on Pithos then we register
......
2282 2282
   $ kamaki image register "Debian Base" pithos:debian_base-6.0-x86_64 \
2283 2283
     --metafile debian_base-6.0-x86_64.diskdump.meta --public
2284 2284

  
2285
This command registers a Pithos file as an Image in Cyclades. This Image will 
2286
be public (``--public``), so all users will be able to spawn VMs from it. 
2285
This command registers a Pithos file as an Image in Cyclades. This Image will
2286
be public (``--public``), so all users will be able to spawn VMs from it.
2287 2287

  
2288 2288
Spawn a VM from the Cyclades Web UI
2289 2289
-----------------------------------
......
2310 2310
SSH or RDP (for windows machines).
2311 2311

  
2312 2312
Congratulations. You have successfully installed the whole Synnefo stack and
2313
connected all components. 
2313
connected all components.

Also available in: Unified diff