Revision caa6c07d

b/docs/quick-install-admin-guide.rst
572 572
Let's create our first user. At the homepage click the "CREATE ACCOUNT" button
573 573
and fill all your data at the sign up form. Then click "SUBMIT". You should now
574 574
see a green box on the top, which informs you that you made a successful request
575
and the request has been sent to the administrators. So far so good.
575
and the request has been sent to the administrators. So far so good, let's assume
576
that you created the user with username ``user@example.com``.
576 577

  
577 578
Now we need to activate that user. Return to a command prompt at node1 and run:
578 579

  
......
628 629
web UI for pithos+ and will be accessible by clicking "pithos+" on the Astakos
629 630
interface's cloudbar, at the top of the Astakos homepage.
630 631

  
632

  
631 633
Configuration of Pithos+
632 634
========================
633 635

  
......
752 754

  
753 755
please continue with the rest of the guide.
754 756

  
757

  
755 758
Installation of Cyclades (and Plankton) on node1
756 759
================================================
757 760

  
758
Installation of cyclades is a two step process:
761
This section describes the installation of Cyclades. Cyclades is Synnefo's
762
Compute service. Plankton (the Image Registry service) will get installed
763
automatically along with Cyclades, because it is contained in the same Synnefo
764
component right now.
759 765

  
760
1. install the external services (prerequisites) on which cyclades depends
761
2. install the synnefo software components associated with cyclades
766
Before proceeding with the Cyclades (and Plankton) installation, make sure you
767
have successfully set up Astakos and Pithos+ first, because Cyclades depends
768
on them. If you don't have a working Astakos and Pithos+ installation yet,
769
please return to the :ref:`top <quick-install-admin-guide>` of this guide.
762 770

  
763
Prerequisites
764
-------------
765
.. _cyclades-install-ganeti:
771
Besides Astakos and Pithos+, you will also need a number of additional working
772
prerequisites, before you start the Cyclades installation.
766 773

  
767
Ganeti installation
768
~~~~~~~~~~~~~~~~~~~
774
Cyclades Prerequisites
775
----------------------
776

  
777
Ganeti
778
~~~~~~
769 779

  
770
Synnefo requires a working Ganeti installation at the backend. Installation
771
of Ganeti is not covered by this document, please refer to
772
`ganeti documentation <http://docs.ganeti.org/ganeti/current/html>`_ for all the
780
`Ganeti <http://code.google.com/p/ganeti/>`_ handles the low level VM management
781
for Cyclades, so Cyclades requires a working Ganeti installation at the backend.
782
Please refer to the
783
`ganeti documentation <http://docs.ganeti.org/ganeti/2.5/html>`_ for all the
773 784
gory details. A successful Ganeti installation concludes with a working
774
:ref:`GANETI-MASTER <GANETI_NODES>` and a number of :ref:`GANETI-NODEs <GANETI_NODES>`.
785
:ref:`GANETI-MASTER <GANETI_NODES>` and a number of :ref:`GANETI-NODEs
786
<GANETI_NODES>`.
787

  
788
The above Ganeti cluster can run on different physical machines than node1 and
789
node2 and can scale independently, according to your needs.
790

  
791
For the purpose of this guide, we will assume that the :ref:`GANETI-MASTER
792
<GANETI_NODES>` runs on node1 and is VM-capable. Also, node2 is a
793
:ref:`GANETI-NODE <GANETI_NODES>` and is Master-capable and VM-capable too.
794

  
795
We highly recommend that you read the official Ganeti documentation, if you are
796
not familiar with Ganeti. If you are extremely impatient, you can result with
797
the above assumed setup by running:
798

  
799
.. code-block:: console
800

  
801
   root@node1:~ # apt-get install ganeti2
802
   root@node1:~ # apt-get install ganeti-htools
803
   root@node2:~ # apt-get install ganeti2
804
   root@node2:~ # apt-get install ganeti-htools
805

  
806
We assume that Ganeti will use the KVM hypervisor. After installing Ganeti on
807
both nodes, choose a domain name that resolves to a valid floating IP (let's say
808
it's ``ganeti.node1.example.com``). Make sure node1 and node2 have root access
809
between each other using ssh keys and not passwords. Also, make sure there is an
810
lvm volume group named ``ganeti`` that will host your VMs' disks. Finally, setup
811
a bridge interface on the host machines (e.g:: br0). Then run on node1:
812

  
813
.. code-block:: console
814

  
815
   root@node1:~ # gnt-cluster init --enabled-hypervisors=kvm --no-ssh-init
816
                                   --no-etc-hosts --vg-name=ganeti
817
                                   --nic-parameters link=br0 --master-netdev eth0
818
                                   ganeti.node1.example.com
819
   root@node1:~ # gnt-cluster modify --default-iallocator hail
820
   root@node1:~ # gnt-cluster modify --hypervisor-parameters kvm:kernel_path=
821
   root@node1:~ # gnt-cluster modify --hypervisor-parameters kvm:vnc_bind_address=0.0.0.0
822

  
823
   root@node1:~ # gnt-node add --no-node-setup --master-capable=yes
824
                               --vm-capable=yes node2.example.com
825

  
826
For any problems you may stumble upon installing Ganeti, please refer to the
827
`official documentation <http://docs.ganeti.org/ganeti/2.5/html>`_. Installation
828
of Ganeti is out of the scope of this guide.
829

  
830
.. _cyclades-install-snfimage:
831

  
832
snf-image
833
~~~~~~~~~
834

  
835
Installation
836
````````````
837
For :ref:`Cyclades <cyclades>` to be able to launch VMs from specified Images,
838
you need the :ref:`snf-image <snf-image>` OS Definition installed on *all*
839
VM-capable Ganeti nodes. This means we need :ref:`snf-image <snf-image>` on
840
node1 and node2. You can do this by running on *both* nodes:
841

  
842
.. code-block:: console
843

  
844
   # apt-get install snf-image-host
845

  
846
Now, you need to download and save the corresponding helper package. Please see
847
`here <https://code.grnet.gr/projects/snf-image/files>`_ for the latest package. Let's
848
assume that you installed snf-image-host version 0.3.5-1. Then, you need
849
snf-image-helper v0.3.5-1 on *both* nodes:
850

  
851
.. code-block:: console
852

  
853
   # cd /var/lib/snf-image/helper/
854
   # wget https://code.grnet.gr/attachments/download/1058/snf-image-helper_0.3.5-1_all.deb
855

  
856
.. warning:: Be careful: Do NOT install the snf-image-helper debian package.
857
             Just put it under /var/lib/snf-image/helper/
858

  
859
Once, you have downloaded the snf-image-helper package, create the helper VM by
860
running on *both* nodes:
861

  
862
.. code-block:: console
863

  
864
   # ln -s snf-image-helper_0.3.5-1_all.deb snf-image-helper.deb
865
   # snf-image-update-helper
866

  
867
This will create all the needed files under ``/var/lib/snf-image/helper/`` for
868
snf-image-host to run successfully.
869

  
870
Configuration
871
`````````````
872
snf-image supports native access to Images stored on Pithos+. This means that
873
snf-image can talk directly to the Pithos+ backend, without the need of providing
874
a public URL. More details, are described in the next section. For now, the only
875
thing we need to do, is configure snf-image to access our Pithos+ backend.
876

  
877
To do this, we need to set the corresponding variables in
878
``/etc/default/snf-image``, to reflect our Pithos+ setup:
879

  
880
.. code-block:: console
881

  
882
   PITHOS_DB="postgresql://synnefo:example_passw0rd@node1.example.com:5432/snf_pithos"
883

  
884
   PITHOS_DATA="/srv/pithos/data"
885

  
886
If you have installed your Ganeti cluster on different nodes than node1 and node2 make
887
sure that ``/srv/pithos/data`` is visible by all of them.
888

  
889
If you would like to use Images that are also/only stored locally, you need to
890
save them under ``IMAGE_DIR``, however this guide targets Images stored only on
891
Pithos+.
892

  
893
Testing
894
```````
895

  
896
You can test that snf-image is successfully installed by running on the
897
:ref:`GANETI-MASTER <GANETI_NODES>` (in our case node1):
898

  
899
.. code-block:: console
900

  
901
   # gnt-os diagnose
902

  
903
This should return ``valid`` for snf-image.
904

  
905
If you are interested to learn more about snf-image's internals (and even use
906
it alongside Ganeti without Synnefo), please see
907
`here <https://code.grnet.gr/projects/snf-image/wiki>`_ for information concerning
908
installation instructions, documentation on the design and implementation, and
909
supported Image formats.
910

  
911
snf-image's actual Images
912
~~~~~~~~~~~~~~~~~~~~~~~~~
913

  
914
Now that snf-image is installed successfully we need to provide it with some
915
Images. :ref:`snf-image <snf-image>` supports Images stored in ``extdump``,
916
``ntfsdump`` or ``diskdump`` format. We recommend the use of the ``diskdump``
917
format. For more information about snf-image's Image formats see `here
918
<https://code.grnet.gr/projects/snf-image/wiki/Image_Format>`_.
919

  
920
:ref:`snf-image <snf-image>` also supports three (3) different locations for the
921
above Images to be stored:
922

  
923
 * Under a local folder (usually an NFS mount, configurable as ``IMAGE_DIR`` in
924
   :file:`/etc/default/snf-image`)
925
 * On a remote host (accessible via a public URL e.g: http://... or ftp://...)
926
 * On Pithos+ (accessible natively, not only by its public URL)
927

  
928
For the purpose of this guide, we will use the `Debian Squeeze Base Image
929
<https://pithos.okeanos.grnet.gr/public/9epgb>`_ found on the official
930
`snf-image page
931
<https://code.grnet.gr/projects/snf-image/wiki#Sample-Images>`_. The image is
932
of type ``diskdump``. We will store it in our new Pithos+ installation.
933

  
934
To do so, do the following:
935

  
936
a) Download the Image from the official snf-image page (`image link
937
   <https://pithos.okeanos.grnet.gr/public/9epgb>`_).
938

  
939
b) Upload the Image to your Pithos+ installation, either using the Pithos+ Web UI
940
   or the command line client `kamaki
941
   <http://docs.dev.grnet.gr/kamaki/latest/index.html>`_.
942

  
943
Once the Image is uploaded successfully, download the Image's metadata file
944
from the official snf-image page (`image_metadata link
945
<https://pithos.okeanos.grnet.gr/public/gwqcv>`_). You will need it, for
946
spawning a VM from Ganeti, in the next section.
947

  
948
Of course, you can repeat the procedure to upload more Images, available from the
949
`official snf-image page
950
<https://code.grnet.gr/projects/snf-image/wiki#Sample-Images>`_.
951

  
952
Spawning a VM from a Pithos+ Image, using Ganeti
953
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
954

  
955
Now, it is time to test our installation so far. So, we have Astakos and
956
Pithos+ installed, we have a working Ganeti installation, the snf-image
957
definition installed on all VM-capable nodes and a Debian Squeeze Image on
958
Pithos+. Make sure you also have the `metadata file
959
<https://pithos.okeanos.grnet.gr/public/gwqcv>`_ for this image.
960

  
961
Run on the :ref:`GANETI-MASTER's <GANETI_NODES>` (node1) command line:
962

  
963
.. code-block:: console
964

  
965
   # gnt-instance add -o snf-image+default --os-parameters
966
                      img_passwd=my_vm_example_passw0rd,
967
                      img_format=diskdump,
968
                      img_id="pithos://user@example.com/pithos/debian_base-6.0-7-x86_64.diskdump",
969
                      img_properties='{"OSFAMILY":"linux"\,"ROOT_PARTITION":"1"}'
970
                      -t plain --disk 0:size=2G --no-name-check --no-ip-check
971
                      testvm1
972

  
973
In the above command:
974

  
975
 * ``img_passwd``: the arbitrary root password of your new instance
976
 * ``img_format``: set to ``diskdump`` to reflect the type of the uploaded Image
977
 * ``img_id``: If you want to deploy an Image stored on Pithos+ (our case), this
978
               should have the format
979
               ``pithos://<username>/<container>/<filename>``:
980
                * ``username``: ``user@example.com`` (defined during Astakos sign up)
981
                * ``container``: ``pithos`` (default, if the Web UI was used)
982
                * ``filename``: the name of file (visible also from the Web UI)
983
 * ``img_properties``: taken from the metadata file. Used only the two mandatory
984
                       properties ``OSFAMILY`` and ``ROOT_PARTITION``. `Learn more
985
                       <https://code.grnet.gr/projects/snf-image/wiki/Image_Format#Image-Properties>`_
986

  
987
If the ``gnt-instance add`` command returns successfully, then run:
988

  
989
.. code-block:: console
990

  
991
   # gnt-instance info testvm1 | grep "console connection"
992

  
993
to find out where to connect using VNC. If you can connect successfully and can
994
login to your new instance using the root password ``my_vm_example_passw0rd``,
995
then everything works as expected and you have your new Debian Base VM up and
996
running.
997

  
998
If ``gnt-instance add`` fails, make sure that snf-image is correctly configured
999
to access the Pithos+ database and the Pithos+ backend data. Also, make sure
1000
you gave the correct ``img_id`` and ``img_properties``. If ``gnt-instance add``
1001
succeeds but you cannot connect, again find out what went wrong. Do *NOT*
1002
proceed to the next steps unless you are sure everything works till this point.
1003

  
1004
If everything works, you have successfully connected Ganeti with Pithos+.
1005
Let's move on to networking now.
1006

  
1007
Network setup
1008
~~~~~~~~~~~~~
1009

  
1010
Synnefo RAPI user
1011
~~~~~~~~~~~~~~~~~
1012

  
1013
Once you have a working Ganeti installation create a new RAPI user that will
1014
have ``write`` access. Cyclades will use this user to issue commands to Ganeti,
1015
so we will call the user ``cyclades``. You can do this, by editting the file
1016
``/var/lib/ganeti/rapi/users`` and adding the line:
1017

  
1018
.. code-block:: console
1019

  
1020
   cyclades {HA1}a62c-example_hash_here-6f0436ddb write
1021

  
1022
More about Ganeti's RAPI users `here.
1023
<http://docs.ganeti.org/ganeti/2.5/html/rapi.html#introduction>`_
775 1024

  
776
.. _cyclades-install-db:
777 1025

  
778
Database
779
~~~~~~~~
780 1026

  
781
Database installation is done as part of the
782
:ref:`snf-webproject <snf-webproject>` component.
783 1027

  
784 1028
.. _cyclades-install-rabbitmq:
785 1029

  
......
792 1036

  
793 1037
    http://www.rabbitmq.com/pacemaker.html
794 1038

  
795
After installation, create a user and set its permissions:
796

  
797
.. code-block:: console
798

  
799
    $ rabbitmqctl add_user <username> <password>
800
    $ rabbitmqctl set_permissions -p / <username>  "^.*" ".*" ".*"
801

  
802 1039
The values set for the user and password must be mirrored in the
803 1040
``RABBIT_*`` variables in your settings, as managed by
804 1041
:ref:`snf-common <snf-common>`.
......
877 1114

  
878 1115
.. todo:: soc: document NFDHCPD installation, settle on KVM ifup script
879 1116

  
880
.. _cyclades-install-snfimage:
881

  
882
snf-image
883
~~~~~~~~~
884

  
885
Install the :ref:`snf-image <snf-image>` Ganeti OS provider for image
886
deployment.
887

  
888
For :ref:`cyclades <cyclades>` to be able to launch VMs from specified
889
Images, you need the snf-image OS Provider installed on *all* Ganeti nodes.
890

  
891
Please see `https://code.grnet.gr/projects/snf-image/wiki`_
892
for installation instructions and documentation on the design
893
and implementation of snf-image.
894

  
895
Please see `https://code.grnet.gr/projects/snf-image/files`
896
for the latest packages.
897

  
898
Images should be stored in ``extdump``, or ``diskdump`` format in a directory
899
of your choice, configurable as ``IMAGE_DIR`` in
900
:file:`/etc/default/snf-image`.
901

  
902 1117
synnefo components
903 1118
------------------
904 1119

  

Also available in: Unified diff