Difference between revisions of "Ediv-install"

From VNX
Jump to: navigation, search
Line 1: Line 1:
 
{{Title|EDIV Installation Guide}}
 
{{Title|EDIV Installation Guide}}
  
<big>
+
== EDIV Installation ==
Authors:
 
'''Francisco José Martín Moreno (fjmartin at dit.upm.es)'''
 
'''Miguel Ferrer Cámara (mferrer at dit.upm.es)'''
 
'''Fermín Galán Márquez (galan at dit.upm.es)
 
'''version 1.1, Jan 10th, 2011'''
 
</big>
 
  
__TOC__
+
=== Requirements ===
  
 +
To be able to deploy VNX scenarios using EDIV distributed capabilities you need a  cluster made of:
 +
<ul>
 +
<li> '''Cluster hosts'''. Two or more systems with a modern Linux distribution (Ubuntu 10.04 or newer recommended) and a processor with virtualization support (VT-x for Intel or AMD-V for AMD). Two Ethernet network interfaces are recommended, to be able to separate the cluster management traffic from the virtual machines interconnection traffic. Cluster hosts do not need to be homogeneous: cluster configuration and segmentation algorithms will take into account the characteristics of each host.</li>
 +
Most present systems are susceptible to be used in a cluster; the complexity of the scenarios a cluster is able to manage will of course depend on the resources (CPU and memory) of the hosts.
 +
<li>'''Cluster controller''': a system with a modern Linux distribution (Ubuntu 10.04 or newer recommended). This system will run the software to control the distributed deployment of scenarios. It does not have any relevant requirements and the controller function can be integrated in one of the hosts.</li>
 +
</ul>
  
== Introduction ==
+
=== Hardware installation ===
  
To get EDIV working, some configuration must be done in the EDIV controller and also in the hosts that form the cluster.
+
The only specific hardware requirement is the connection of the second network interface card (eth1 in the figure) of each host to the switch that will carry inter-virtual-machine traffic. The host ports in the switch have to be configured in "tagged" mode and a range of VLANs has to be assigned in the switch for VNX traffic (this range will be later configured in the cluster config file).
There are two different types of installation: semi-automatic, through a deb package, or manual using a tzg compressed file.
 
  
==Installation==
+
Once the switch configuration is ready, it is recommended to validate it by manually configuring one or more VLAN subinterfaces in each host and test connectivity among them.
  
=== Installing from .deb package ===
+
For example, to test VLAN 100:
 +
host1# vconfig add eth1 100
 +
host1# ifconfig eth1.100 10.1.1.1/24
  
(not yet available)           
+
host2# vconfig add eth1 100
 +
host2# ifconfig eth1.100 10.1.1.2/24
 +
host2# ping 10.1.1.1
  
 +
=== Software installation ===
  
<p>An APT repository has been set up for EDIV related packages (which is the same than the used for VNUML). The installation procedure is as follows:</p>
+
<ul>
 +
<li>'''VNX Installation'''. Install VNX on the cluster controller and on every cluster host following the standard [[Vnx-install|VNX installation procedure]]</li>
 +
<ul>
 +
<li>Check that VNX is working correctly on every host by starting some of the VNX examples distributed.</li>
 +
<li>Download the root filesystems needed to every hosts</li>
 +
</ul>
 +
<li>'''SSH Access to hosts'''. Cluster controller executes commands on hosts using SSH. Therefore, SSH access without password request is needed from the cluster controller to every hosts. You can configure it manually following available recipes (just google "SSH without password") or with the help of handy "ssh-copy-id" command:</li>
 +
<ul>
 +
<li>From the controller, just execute:</li>
 +
for host in host1 host2 host3; do ssh-copy-id root@$host; done
 +
substituting ''"host1 host2 host3"'' by the list of hostnames or IP addresses of your host cluster.
 +
direct access from the controller to the hosts
 +
</ul>
 +
<li>'''Database Installation'''. The cluster controller uses a database to store persistent information. As the requirements are very low, any database that can be used through perl DBI module can be used. '''SQlite''' is the recommended one; '''mysql''' has been also tested succesfully.
 +
<ul>
 +
<li>Install database package and on the controller:</li>
 +
apt-get install sqlite
 +
or:
 +
apt-get install mysql-server
 +
<li>Optionally, install an application to manage the database:</li>
 +
apt-get install sqliteman
 +
or:
 +
apt-get install mysql-query-browser
 +
apt-get install phpmyadmin
 +
</ul>
 +
<li>'''Cluster configuration'''. In the controller, edit VNX configuration file (/etc/vnx.conf) and ADD the cluster configuration sections. You can find an example configuration in /usr/share/vnx/etc/vnx.cluster.conf.sample:</li>
 +
<ul>
 +
<li>Add example cluster configuration sections to your config file:</li>
 +
cat /usr/share/vnx/etc/vnx.cluster.conf.sample >> /etc/vnx.conf
 +
<li>Change them according to your data:</li>
 +
<ul>
 +
<li>Database configuration: configure the parameters for database access</li>
 +
<ul>
 +
<li>If you use SQlite (recommended) configure:</li>
 +
type = sqlite
 +
file = /var/run/vnx/cluster.db  # File where the database will be stored
 +
<li>If you use mysql configure:</li>
 +
type = mysql
 +
name = ediv          # Name of the database
 +
host = localhost    # Host where the database ser is
 +
port = 3306          # Port of the database server
 +
user = mydbuser      # User with permissions to create and access the db
 +
pass = mydbpasswd    # User password
 +
</ul>
 +
<li>VLAN configuration: configure the range of VLANs used to interconnect virtual machines deployed to different hosts:</li>
 +
[vlan]
 +
first = 1000      # First VLAN id to use
 +
last = 1039      # Last VLAN id to use
 +
<li>Cluster configuration: configure the names of the cluster hosts, the default segmentation algorithm and the management interfaces addresses. The host names defined here can be freely choosen by the user. They are the names used internally by VNX to identify each host. The host names or IP addresses of each host are defined in a specific section for each host. </li>
 +
<pre>
 +
#
 +
# Cluster hosts list
 +
#
 +
host = host1
 +
host = host2
 +
#
 +
# segmentation algorithms available (see /usr/share/vnx/lib/seg-alg/):
 +
#    RoundRobin, WeightedRoundRobin, DynamicWeightedRoundRobin
 +
#
 +
default_segmentation = RoundRobin
 +
#
 +
# management network interfaces addresses
 +
#
 +
mgmt_network = 10.250.0.0
 +
mgmt_network_mask = 16
 +
</pre>
 +
<li>Hosts configuration: configure the characteristics of each cluster host</li>
 +
<pre>
 +
#
 +
# Host properties
 +
#
 +
#    Definition of each hosts parameters:
 +
#        - host_name (string): host IP name or IP address
 +
#        - mem (integer):      host RAM memory in Megabytes
 +
#    - cpu (integer):          percentage speed relative to the
 +
#                              fastest host of the cluster
 +
#    - max_vms (integer):      maximum virtual machines allowed to be
 +
#                              virtualized in a host (0 = unlimited).
 +
#    - if_name (string):      name of the network interface used to
 +
#                              interconnect virtual machines deployed
 +
#                              in different hosts
 +
#    Syntax example:
 +
#    [h1]
 +
#    host_name = host1.domain.org
 +
#    mem = 2048
 +
#    cpu = 100
 +
#    max_vms = 0
 +
#    if_name = eth0
 +
#    [h2]
 +
#    host_name = host2.domain.org
 +
#    mem = 1024
 +
#    cpu = 85
 +
#    max_vms = 8
 +
#    if_name = eth0
 +
#
 +
[host1]
 +
host_name = host1.domain.org
 +
mem = 8192
 +
cpu = 200
 +
max_vms = 0
 +
if_name = eth1
  
<ol>
+
[host2]
<li>Add the following line to the /etc/apt/sources.list file:</li>
+
host_name = host2.domain.org
 
+
mem = 4096
<pre class="box">
+
cpu = 100
deb http://jungla.dit.upm.es/~vnuml/debian binary/
+
max_vms = 0
 +
if_name = eth1
 
</pre>
 
</pre>
  
<li>(Optional) If you want to consider testing version of EDIV, add also to/etc/apt/sources.list file:</li>
+
</ul>
 +
</ul>
  
<pre class="box">
+
<li>'''Database creation'''. Create the database with:</li>
deb http://jungla.dit.upm.es/~vnuml/debian-testing binary/
+
ediv --create-db
</pre>
+
</ul>
 
 
<li>Update package list:</li>
 
  
<pre class="box">
+
After installation is finished, you can check the cluster status with ''"--check-cluster"'' option. For example:
apt-get update
+
<pre>
</pre>
+
# ediv --check-cluster
  
<li>Install EDIV along the packages it depends on</li>
+
---------------------------------------------------------------------------------------------
 +
Distributed Virtual Networks over LinuX (EDIV) -- http://www.dit.upm.es/vnx - vnx@dit.upm.es
 +
Version: 2.0b.2189 (built on 29/05/2012_15:24)
 +
---------------------------------------------------------------------------------------------
 +
  TMP dir=/tmp
 +
  VNX dir=/root/.vnx
 +
---------------------------------------------------------------------------------------------
 +
Using configuration file:    /etc/vnx.conf
 +
-- Checking pasito availability...pasito is active
 +
-- Checking chopito availability...chopito is active
 +
Hosts in cluster:
 +
    pasito                  (active) vnx_ver=2.0b.2179,29/05/2012_02:39
 +
    chopito                  (active) vnx_ver=2.0b.2179,29/05/2012_02:39
  
<pre class="box">
+
Using segmentation algorithm: RoundRobin
apt-get install ediv
+
---------------------------------------------------------------------------------------------
 +
---- mode: check-cluster
 +
---- Cluster status checked
 +
---- Succesfully finished ----
 
</pre>
 
</pre>
 
</ol>
 
 
            <p>That's all! :)</p>
 
 
=== Installing from source .tgz ===
 
 
'''This installation procedure has been developed and tested only under Ubuntu distributions. However, for other GNU/Linux distribution the procedure should be very close.'''
 
 
This type of installation involves the following steps:
 
 
==== Download the source file from the web ====
 
 
Is necessary to download the source file from [http://sourceforge.net/project/showfiles.php?group_id=113582&package_id=293383 here]. Then it must be decompressed in the computer that is going to act as the EDIV controller in some folder (e.g., /usr/local/src).
 
 
==== Perl installation ====
 
 
* Perl installation if it wasn't previously installed:
 
 
apt-get install perl
 
 
* Perl Math Round library installation:
 
 
apt-get install libmath-round-perl
 
 
* AppConfig and DBI perl modules installation:
 
 
apt-get install libappconfig-perl libdbi-perl
 
 
<span style="color:red"><strong>NOTE: </strong></span> The AppConfig and DBI modules can be installed in a manual way (although it is not recommended). To do so, download and install the [http://search.cpan.org/dist/AppConfig/ AppConfig] and [http://search.cpan.org/dist/DBI DBI] from their corresponding [http://www.cpan.org CPAN] web. The files contain README files with instructions on how to install those modules. Most of the AppConfig and DBI installation failures are caused due to the lack of an installed compiler. Try reinstalling them after issuing the following command:
 
 
apt-get install build-essential
 
 
==== EDIV package installation ====
 
 
The installation process consists on placing some files from the .tar.gz package to the /usr/local hierarchy:
 
 
* The perl modules 'perl-modules/EDIV/static.pm' and 'perl-modules/EDIV/cluster_host.pm' files must be moved to the directory for local Perl modules (e.g., /usr/local/share/perl/5.8.8/EDIV/).
 
* The segmentation algorithms perl modules ('perl-modules/algorithms/round_robin.pm' and 'perl-modules/algorithms/weighted_round_robin.pm' are provided by default) files must be moved to '/usr/local/share/ediv/algorithms' directory.
 
* The src/*.pl files must be placed in the /usr/local/bin/ directory.
 
* The etc/cluster.conf file must be placed in the /usr/local/etc/ediv directory.
 
* The doc/* files must be placed in /usr/local/share/doc/ediv
 
 
In order to automate this procedure, the package comes with a Makefile that automates all the operation. First, you have to find out what is your directory for Perl local modules (just execute 'perl -V' and check the value of the @INC variable, usually at the end of the output). Then, edit Makefile and configure the MODULES_INSTALL_DEST in the first line with that value (e.g. 'MODULES_INSTALL_DEST=/usr/local/share/perl/5.8.8').
 
 
After that, execute the install objectives:
 
 
make install
 
make modules-install
 
 
The Makefile include also targets to uninstall (just in the case you want to remove EDIV from your computer).
 
 
make uninstall
 
make modules-uninstall
 
 
<span style="color:red"><strong>NOTE: </strong></span> If ''make'' commands fail, it is possible that ''make'' package is not installed. Install it with the following command:
 
 
apt-get install make
 
 
== Configuration ==
 
 
=== SSH client ===
 
 
apt-get install openssh-client
 
 
NOTE: check that id_rsa.pub and id_dsa.pub files in the /root/.ssh/ folder have been generated after ssh client installation. These files contain the ssh keys necessary for ssh operation. If these files don't exist, issue the following command to generate them:
 
 
ssh-keygen -t rsa
 
ssh-keygen -t dsa
 
 
=== Database ===
 
 
* Install MySQL database:
 
 
apt-get install mysql-server
 
 
* Install some program to easily check the database contents (this step is optional). Some suggestions: phpmyadmin or mysql-query-browser.<br><br>To install both of them use the following commands:<br>
 
apt-get install phpmyadmin
 
apt-get install mysql-query-browser
 
NOTE: under ubuntu distributions some problems have been reported after phpmyadmin installation. They are solved issuing the following command:
 
 
ln -s /usr/share/phpmyadmin/ /var/www
 
 
* Run the database structure creation script (provided by the EDIV source compressed file or deb package):
 
 
ediv_db_manage.pl create
 
 
<span style="color:red"><strong>NOTE: </strong></span>This script will fail if you don't edit your /etc/ediv/cluster.conf file to include your database password before running it.
 
 
=== Cluster hosts configuration ===
 
 
The following tasks must be done before using some computer as a cluster member:
 
 
==== VNUML installation ====
 
 
A working installation of VNUML 1.8.4rc1 or newer is required. Following the [http://dit.upm.es/vnumlwiki/index.php/Installation VNUML installation manual] is recommended.
 
 
==== SSH server installation ====
 
 
* Install the ssh server:
 
 
apt-get install openssh-server
 
 
* SSH server restart:<br><br>Issue the following command to ensure proper ssh operation:
 
 
/etc/init.d/ssh restart
 
 
==== EDIV controller SSH key importation ====
 
 
Importing the EDIV controller ssh key is required in the members of the cluster. This way the controller can execute commands as root in the hosts that are members of the cluster without requiring a password.
 
 
To import the key, edit the host /root/.ssh/authorized_keys file, adding the contents of the controller /root/.ssh/id_dsa.pub file.
 
 
NOTE: to check if the ssh keys exist and how to create them, read [http://www.dit.upm.es/vnumlwiki/index.php/Reference#.3Cssh_key.3E VNUML wiki]
 
 
NOTE: if the controller computer is going to be a member of the cluster (controller and host at the same time) it's necessary to import its own key to the /root/.ssh/authorized_keys file and ssh server installation.
 
 
'''IMPORTANT REMINDER''': EDIV is now installed, but before trying to use it, a cluster configuration file must be created as described in the [[UsermanualEDIV|user manual]].
 

Revision as of 23:55, 30 May 2012

EDIV Installation Guide

EDIV Installation

Requirements

To be able to deploy VNX scenarios using EDIV distributed capabilities you need a cluster made of:

  • Cluster hosts. Two or more systems with a modern Linux distribution (Ubuntu 10.04 or newer recommended) and a processor with virtualization support (VT-x for Intel or AMD-V for AMD). Two Ethernet network interfaces are recommended, to be able to separate the cluster management traffic from the virtual machines interconnection traffic. Cluster hosts do not need to be homogeneous: cluster configuration and segmentation algorithms will take into account the characteristics of each host.
  • Most present systems are susceptible to be used in a cluster; the complexity of the scenarios a cluster is able to manage will of course depend on the resources (CPU and memory) of the hosts.

  • Cluster controller: a system with a modern Linux distribution (Ubuntu 10.04 or newer recommended). This system will run the software to control the distributed deployment of scenarios. It does not have any relevant requirements and the controller function can be integrated in one of the hosts.

Hardware installation

The only specific hardware requirement is the connection of the second network interface card (eth1 in the figure) of each host to the switch that will carry inter-virtual-machine traffic. The host ports in the switch have to be configured in "tagged" mode and a range of VLANs has to be assigned in the switch for VNX traffic (this range will be later configured in the cluster config file).

Once the switch configuration is ready, it is recommended to validate it by manually configuring one or more VLAN subinterfaces in each host and test connectivity among them.

For example, to test VLAN 100:

host1# vconfig add eth1 100
host1# ifconfig eth1.100 10.1.1.1/24
host2# vconfig add eth1 100
host2# ifconfig eth1.100 10.1.1.2/24
host2# ping 10.1.1.1

Software installation

  • VNX Installation. Install VNX on the cluster controller and on every cluster host following the standard VNX installation procedure
    • Check that VNX is working correctly on every host by starting some of the VNX examples distributed.
    • Download the root filesystems needed to every hosts
  • SSH Access to hosts. Cluster controller executes commands on hosts using SSH. Therefore, SSH access without password request is needed from the cluster controller to every hosts. You can configure it manually following available recipes (just google "SSH without password") or with the help of handy "ssh-copy-id" command:
    • From the controller, just execute:
    • for host in host1 host2 host3; do ssh-copy-id root@$host; done
      

      substituting "host1 host2 host3" by the list of hostnames or IP addresses of your host cluster. direct access from the controller to the hosts

  • Database Installation. The cluster controller uses a database to store persistent information. As the requirements are very low, any database that can be used through perl DBI module can be used. SQlite is the recommended one; mysql has been also tested succesfully.
    • Install database package and on the controller:
    • apt-get install sqlite 
      

      or:

      apt-get install mysql-server
      
    • Optionally, install an application to manage the database:
    • apt-get install sqliteman
      

      or:

      apt-get install mysql-query-browser
      apt-get install phpmyadmin
      
  • Cluster configuration. In the controller, edit VNX configuration file (/etc/vnx.conf) and ADD the cluster configuration sections. You can find an example configuration in /usr/share/vnx/etc/vnx.cluster.conf.sample:
    • Add example cluster configuration sections to your config file:
    • cat /usr/share/vnx/etc/vnx.cluster.conf.sample >> /etc/vnx.conf
      
    • Change them according to your data:
      • Database configuration: configure the parameters for database access
        • If you use SQlite (recommended) configure:
        • type = sqlite
          file = /var/run/vnx/cluster.db  # File where the database will be stored
          
        • If you use mysql configure:
        • type = mysql
          name = ediv          # Name of the database
          host = localhost     # Host where the database ser is
          port = 3306          # Port of the database server
          user = mydbuser      # User with permissions to create and access the db
          pass = mydbpasswd    # User password
          
      • VLAN configuration: configure the range of VLANs used to interconnect virtual machines deployed to different hosts:
      • [vlan]
        first = 1000      # First VLAN id to use
        last = 1039       # Last VLAN id to use
        
      • Cluster configuration: configure the names of the cluster hosts, the default segmentation algorithm and the management interfaces addresses. The host names defined here can be freely choosen by the user. They are the names used internally by VNX to identify each host. The host names or IP addresses of each host are defined in a specific section for each host.
      • #
        # Cluster hosts list
        #
        host = host1 
        host = host2
        #
        # segmentation algorithms available (see /usr/share/vnx/lib/seg-alg/): 
        #    RoundRobin, WeightedRoundRobin, DynamicWeightedRoundRobin 
        # 
        default_segmentation = RoundRobin
        #
        # management network interfaces addresses
        #
        mgmt_network = 10.250.0.0
        mgmt_network_mask = 16
        
      • Hosts configuration: configure the characteristics of each cluster host
      • #
        # Host properties
        #
        #    Definition of each hosts parameters:
        #        - host_name (string): host IP name or IP address
        #        - mem (integer):      host RAM memory in Megabytes 
        #    - cpu (integer):          percentage speed relative to the 
        #                              fastest host of the cluster
        #    - max_vms (integer):      maximum virtual machines allowed to be
        #                              virtualized in a host (0 = unlimited).
        #    - if_name (string):       name of the network interface used to
        #                              interconnect virtual machines deployed
        #                              in different hosts
        #    Syntax example:
        #    [h1]
        #    host_name = host1.domain.org
        #    mem = 2048
        #    cpu = 100
        #    max_vms = 0
        #    if_name = eth0
        #    [h2]
        #    host_name = host2.domain.org
        #    mem = 1024
        #    cpu = 85
        #    max_vms = 8
        #    if_name = eth0
        #
        [host1]
        host_name = host1.domain.org
        mem = 8192
        cpu = 200
        max_vms = 0
        if_name = eth1
        
        [host2]
        host_name = host2.domain.org
        mem = 4096
        cpu = 100
        max_vms = 0
        if_name = eth1
        
  • Database creation. Create the database with:
  • ediv --create-db
    

After installation is finished, you can check the cluster status with "--check-cluster" option. For example:

# ediv --check-cluster

---------------------------------------------------------------------------------------------
Distributed Virtual Networks over LinuX (EDIV) -- http://www.dit.upm.es/vnx - vnx@dit.upm.es
Version: 2.0b.2189 (built on 29/05/2012_15:24)
---------------------------------------------------------------------------------------------
  TMP dir=/tmp
  VNX dir=/root/.vnx
---------------------------------------------------------------------------------------------
Using configuration file:     /etc/vnx.conf
-- Checking pasito availability...pasito is active
-- Checking chopito availability...chopito is active
Hosts in cluster:
    pasito                   (active) vnx_ver=2.0b.2179,29/05/2012_02:39
    chopito                  (active) vnx_ver=2.0b.2179,29/05/2012_02:39

Using segmentation algorithm: RoundRobin
---------------------------------------------------------------------------------------------
---- mode: check-cluster
---- Cluster status checked
---- Succesfully finished ----