-
Notifications
You must be signed in to change notification settings - Fork 0
Metaleuca Installation Guide
sudo apt-get -y update
sudo apt-get -y install git vim
sudo apt-get -y install python python-paramiko python-mysqldb
See the section below for setting up mysql.
sudo useradd -d /home/qa-group -m qa-group -p mypassword
As User qa-group:
sudo su qa-group
cd ~
mkdir machine_provision_module
cd ./machine_provision_module
git clone git://github.com/kyolee310/metaleuca.git
git clone git://github.com/kyolee310/machine_pool_manager.git
git clone git://github.com/kyolee310/ip_space_manager.git
As root:
sudo apt-get -y install mysql-server
- Set the password to be XXXXXXXX
To see if mysql running:
sudo netstat -tap | grep mysql
Output:
tcp 0 0 localhost:mysql *:* LISTEN 3515/mysqld
...
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
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)
As User qa-group,
sudo su qa-group
cd ~
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
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
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
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.
Create the file metaleuca.ini:
cd /home/qa-group/machine_provision_module/metaleuca/var
vim ./metaleuca.ini
File metaleuca.ini:
[CobblerInfo]
COBBLER_SERVER: cobbler.eucalyptus-systems.com
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
To list available systems:
cd ..
./metaleuca-describe-systems
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
The command below should display the same list above:
./metaleuca-describe-system-groups
cat ./var/machine_map_for_new_datacenter.lst | grep test | awk '{print $1}'
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 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
Run instances:
./metaleuca-run-instances -n 2 -g test02 -p qa-centos6u3-x86_64-striped-drives -u user00
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
$ ./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