Metaleuca Installation Guide

kyolee310 edited this page Jun 7, 2013 · 4 revisions

Installation of Metaleuca on Ubuntu

1. Initial Setup

Basic Dependencies

sudo apt-get -y update
sudo apt-get -y install git vim

Metaleuca Dependencies

sudo apt-get -y install python python-paramiko python-mysqldb

See the section below for setting up mysql.

Create a New User

sudo useradd -d /home/qa-group -m qa-group -p mypassword

Create a new directory

As User qa-group:

sudo su qa-group
cd ~
mkdir machine_provision_module
cd ./machine_provision_module

Download Metaleuca, Machine Pool Manager, and IP Space Manager

git clone git://github.com/eucalyptus/metaleuca.git
git clone git://github.com/eucalyptus/machine_pool_manager.git
git clone git://github.com/eucalyptus/ip_space_manager.git

2. Mysql Database Setup

Install mysql Server

As root:

sudo apt-get -y install mysql-server
  • Set the password to be XXXXXXXX
Quick Check

To see if mysql running:

sudo netstat -tap | grep mysql

Output:

tcp        0      0 localhost:mysql         *:*                     LISTEN      3515/mysqld     
...

Import DB Tables

As root,

Create New Database eucaqa:

sudo mysql -u root -p
Enter password: XXXXXXXX

mysql> create database eucaqa;
Query OK, 1 row affected (0.00 sec)

Import Database Tables:

cd /home/qa-group/machine_provision_module/machine_pool_manager/var
mysql -u root -p -h localhost eucaqa < db_table_schem.sql  
Enter password: XXXXXXXX 
Quick Check

To see if the table has been created successfully:

sudo mysql -u root -p
Enter password: XXXXXXXX

mysql> use eucaqa;
mysql> show tables;

Output:

+------------------------------+
| Tables_in_eucaqa             |
+------------------------------+
| reserve_machine_pool_records |
| reserve_managed_ip_records   |
| reserve_subnet_ip_records    |
+------------------------------+
3 rows in set (0.00 sec)

3. Configuration of Machine Pool Manager

As User qa-group,

sudo su qa-group
cd ~

Set Up Machine Pool Manager's Ini File

Create manager_pool_manager.ini File:

cd /home/qa-group/machine_provision_module/machine_pool_manager/var
vim ./machine_pool_manager.ini

machine_pool_manager.ini

[DBINFO]
DATABASE: DBI:mysql:eucaqa;host=localhost
USERNAME: root
PASSWORD: XXXXXXXX

[DIRECTORY]
HOME_DIR: /home/qa-group/machine_provision_module/machine_pool_manager

4. Configuration of IP Space Manager

Set Up IP Space Manager's Ini File

Create ip_space_manager.ini File:

cd /home/qa-group/machine_provision_module/ip_space_manager/var
vim ./ip_space_manager.ini

Fill out the information as below:

[DBINFO]
DATABASE: DBI:mysql:eucaqa;host=localhost
USERNAME: root
PASSWORD: XXXXXXXX

[DIRECTORY]
HOME_DIR: /home/qa-group/machine_provision_module/ip_space_manager

Create IP Range Files

cd /home/qa-group/machine_provision_module/ip_space_manager/etc

Adjust those two range files:

$ ls
range_managed_ip.lst  range_subnet_ip.lst
$ cat ./range_managed_ip.lst 
#MANAGED IP RANGE
default	10.111.100.0	10.111.100.255
reserved	10.111.100.0	10.111.100.255
develop	10.111.101.0	10.111.101.255
testing	10.111.102.0	10.111.102.255
manual	10.111.103.0	10.111.103.255
$ cat range_subnet_ip.lst 
#SUBNET IP RANGE
default	172.27.0.0	172.28.0.0
reserved	172.27.0.0	172.28.0.0
manual	172.29.0.0	172.30.0.0
Check IP Space Manager

Iterate through each operation:

$ ./request_open_managed_ips.pl kyo 2
[GET_ALL_OPEN_MANAGED_IPS]	OWNER: kyo
[GET_ALL_OPEN_MANAGED_IPS]	REQUEST COUNT: 2
[GET_ALL_OPEN_MANAGED_IPS]	REQUEST GROUP: default
[GET_ALL_OPEN_MANAGED_IPS]	IP RANGE: [10.111.100.0, 10.111.100.255]
[GET_ALL_OPEN_MANAGED_IPS]	MOST RECENTLY FREED IP: 10.111.100.1
[GET_ALL_OPEN_MANAGED_IPS]	START INDEX: 1
[GET_ALL_OPEN_MANAGED_IPS]	CANDIDATE IPs: 10.111.100.1 10.111.100.2
[GET_ALL_OPEN_MANAGED_IPS]	ATTEMPT TO RESERVE IP: 10.111.100.1
[GET_ALL_OPEN_MANAGED_IPS]	SUCCESSFULLY RESERVED IP: 10.111.100.1
[GET_ALL_OPEN_MANAGED_IPS]	ATTEMPT TO RESERVE IP: 10.111.100.2
[GET_ALL_OPEN_MANAGED_IPS]	SUCCESSFULLY RESERVED IP: 10.111.100.2
[GET_ALL_OPEN_MANAGED_IPS]	RESERVED 2 IPs: 10.111.100.1 10.111.100.2
$ ./get_all_managed_ips_by_owner.pl kyo
[GET_ALL_MANAGED_IPS_BY_OWNER]	OWNER: kyo
[IPs]	10.111.100.1 10.111.100.2
$ ./free_all_managed_ips_by_owner.pl kyo
[2012-11-29 02:43:47] [FREE_ALL_MANAGED_IPS_BY_OWNER] [LOG]	OWNER: kyo
[2012-11-29 02:43:47] [FREE_ALL_MANAGED_IPS_BY_OWNER] [LOG]	MANAGED IPS OWNED BY kyo : { 10.111.100.1 10.111.100.2 }
[2012-11-29 02:43:48] [FREE_MANAGED_IP] [LOG]	FREEING MANAGED IPs: { 10.111.100.1 10.111.100.2 }
[2012-11-29 02:43:48] [FREE_MANAGED_IP] [LOG]	FREED MANAGED IPs: { 10.111.100.1 10.111.100.2 }
[2012-11-29 02:43:48] [FREE_ALL_MANAGED_IPS_BY_OWNER] [LOG]	FREED ALL MANAGED IPS OWNED BY kyo

Repeat it for subnet as well.

5. Configuration of Metaleuca

Create metaleuca.ini

Create the file metaleuca.ini:

cd /home/qa-group/machine_provision_module/metaleuca/var
vim ./metaleuca.ini

File metaleuca.ini:

[CobblerInfo]
COBBLER_SERVER: <enter_your_cobbler_server_ip>
USER: qa-group
PASSWORD: XXXXXXXXXXXX
OWNER: qa

[DBInfo]
HOST: localhost
USER: root
PASSWORD: XXXXXXXX
NAME: eucaqa 

[MetaleucaInfo]
METALEUCA_DIR: /home/qa-group/machine_provision_module/metaleuca

[MachinePoolManagerInfo]
MACHINE_POOL_MANAGER_DIR: /home/qa-group/machine_provision_module/machine_pool_manager
Quick Check

To list available systems:

cd ..
./metaleuca-describe-systems

Create machine_map_for_new_datacenter.lst

In the metaleuca Directory:

cd /home/qa-group/machine_provision_module/metaleuca

To get the list of available machines:

./metaleuca-describe-systems | grep IP | awk '{print $6 "\tmy_group";}' | sort

Save the list above as ./var/machine_map_for_new_datacenter.lst and modify the list to assign groups:

10.111.1.120	test01
10.111.1.121	test01
10.111.1.122	test01
10.111.1.123	test01
10.111.1.124	QA-SERVER
10.111.1.132	VCENTER_5.0
10.111.1.133	test02
10.111.1.134	test02
10.111.1.135	test02
10.111.1.136	test02
Quick Check

The command below should display the same list above:

./metaleuca-describe-system-groups

6. Add Machines to Metaleuca

List New Machines to be Registered

cat ./var/machine_map_for_new_datacenter.lst | grep test | awk '{print $1}'
Warning

Ensure that you are not registering forbidden machines in Metaleuca.

In such case, be sure to adjust the group file to remove critical machines from 'test' group:

vim ./var/machine_map_for_new_datacenter.lst

Register New Machines

Register New IPs for the first time:

cat ./var/machine_map_for_new_datacenter.lst | grep test | awk '{print $1}' | xargs -I '{}' ./metaleuca-reserve-systems -i {} -u new_machines

Check that the new machines are registered:

./metaleuca-describe-instances -u new_machines

Release the systems:

./metaleuca-release-systems -u new_machines

Ensure that all the systems have been freed:

./metaleuca-describe-instances -u new_machines

7. Run Instances

Run instances:

./metaleuca-run-instances -n 2 -g test02 -p qa-centos6u3-x86_64-striped-drives -u user00

, where 'qa-centos6u3-x86_64-striped-drives' is one of the image profiles available in your Cobbler server

Describe Instances

Bare-metal Provision in Progress:

./metaleuca-describe-instances -u user00
METALEUCA DESCRIBE INSTANCE
INSTANCE g-19-09 g-19-09.qa1.eucalyptus-systems.com 10.111.1.133 pending
INSTANCE g-19-10 g-19-10.qa1.eucalyptus-systems.com 10.111.1.134 pending

Bare-metal Provision Complete:

./metaleuca-describe-instances -u user00
METALEUCA DESCRIBE INSTANCE
INSTANCE g-19-09 g-19-09.qa1.eucalyptus-systems.com 10.111.1.133 running
INSTANCE g-19-10 g-19-10.qa1.eucalyptus-systems.com 10.111.1.134 running

Describe System-Users

$ ./metaleuca-describe-system-users 
METALEUCA DESCRIBE SYSTEM USERS
10.111.1.120	FREED
10.111.1.121	FREED
10.111.1.122	FREED
10.111.1.123	FREED
10.111.1.133	user00
10.111.1.134	user00
10.111.1.135	FREED
10.111.1.136	FREED
Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.