The Griddynamics RPMS provide a great way to install OpenStack on RHEL platforms.
RHEL 6 is most conducive to the install. The documentation lacks some steps to the install process which are captured here.
Instal the OpenStack yum repo
# yum --nogpgcheck localinstall openstack-repo-2011.2-1.el6.noarch.rpm
# yum --nogpgcheck install python-paste
# yum --nogpgcheck install python-paste-deploy
# yum --nogpgcheck install python-paste-script
# yum install libvirt
# yum install openstack-nova-node-compute
# service libvirtd start
# chkconfig libvirtd on
Verify that libvirt can connect to the hypervisor
# virsh version
Compiled against library: libvir 0.8.7
Using library: libvir 0.8.7
Using API: QEMU 0.8.7
Running hypervisor: QEMU 0.12.1
Edit /etc/nova/nova.conf to point to the right glance and cluster controller nodes.
Ensure that the node can connect to the nova mysql database on the cluster controller.
# service openstack-nova-compute start
# Verify that node was registered in the mysql nova database.
mysql> select * from services;
+---------------------+---------------------+------------+---------+----+------+----------------+-----------+--------------+----------+-------------------+
| created_at | updated_at | deleted_at | deleted | id | host | binary | topic | report_count | disabled | availability_zone |
+---------------------+---------------------+------------+---------+----+------+----------------+-----------+--------------+----------+-------------------+
| 2011-04-26 15:30:04 | 2011-05-03 15:48:37 | NULL | 0 | 1 | net | nova-network | network | 60449 | 0 | nova |
| 2011-04-26 15:30:04 | 2011-05-03 15:48:34 | NULL | 0 | 2 | sched| nova-scheduler | scheduler | 60452 | 0 | nova |
| 2011-04-26 15:30:05 | 2011-05-03 15:48:42 | NULL | 0 | 3 | vnc | nova-vncproxy | vncproxy | 60452 | 0 | nova |
| 2011-04-26 19:04:07 | 2011-05-05 03:33:31 | NULL | 0 | 4 | cm1 | nova-compute | compute | 18568 | 0 | nova |
| 2011-05-05 03:08:38 | 2011-05-05 03:33:27 | NULL | 0 | 5 | cm2 | nova-compute | compute | 135 | 0 | nova |
| 2011-05-05 03:31:57 | 2011-05-05 03:33:29 | NULL | 0 | 6 | cm3 | nova-compute | compute | 9 | 0 | nova |
+---------------------+---------------------+------------+---------+----+------+----------------+-----------+--------------+----------+-------------------+
6 rows in set (0.00 sec)
Thursday, May 5, 2011
Sunday, January 23, 2011
Setting up a Private Cloud using OpenStack
This article describes the setting up of a private cloud using OpenStack. The OpenStack wiki provides good documentation on the install and configuration and this article aims at documenting some of the issues I found during the install and their solutions.
Some details on the platform...
# uname -srvm
Linux 2.6.35-24-generic #42-Ubuntu SMP Thu Dec 2 02:41:37 UTC 2010 x86_64
# lsb_release -d
Description: Ubuntu 10.10
Install the prereqs and the nova packages:
# sudo su -
# apt-get install python-software-properties
# add-apt-repository ppa:nova-core/trunk
# apt-get update
# apt-get install python-greenlet
# apt-get install nova-common nova-doc python-nova nova-api nova-network nova-objectstore nova-scheduler nova-compute
Add the nova group:
# addgroup nova
Fix ownership and permissions on /etc/nova
# chown -R root:nova /etc/nova
# chmod 0644 /etc/nova/nova.conf
Preseed the mysql server installation so as to skip the prompt for the mysql root user password
# MYSQL_PASS=nova
# echo $MYSQL_PASS
# cat << div="">
# mysql-server-5.1 mysql-server/root_password password $MYSQL_PASS
# mysql-server-5.1 mysql-server/root_password_again password $MYSQL_PASS
# mysql-server-5.1 mysql-server/start_on_boot boolean true
# MYSQL_PRESEED
Install the mysql-server and make it listen on all interfaces
# apt-get install -y mysql-server
# sed -i 's/127.0.0.1/0.0.0.0/g' /etc/mysql/my.cnf
# service mysql restart
# mysql -uroot -p$MYSQL_PASS -e 'CREATE DATABASE nova;'
# mysql -uroot -p$MYSQL_PASS -e "GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' WITH GRANT OPTION;"
# mysql -uroot -p$MYSQL_PASS -e "SET PASSWORD FOR 'root'@'%' = PASSWORD('$MYSQL_PASS');"
Edit /etc/nova/nova.conf to look like the following:
--dhcpbridge_flagfile=/etc/nova/nova.conf
--dhcpbridge=/usr/bin/nova-dhcpbridge
--logdir=/var/log/nova
--state_path=/var/lib/nova
--verbose
--sql_connection=mysql://root:mysql@127.0.0.1/nova
--s3_host=127.0.0.1
--rabbit_host=127.0.0.1
--cc_host=127.0.0.1
--ec2_url=http://127.0.0.1:8773/services/Cloud
--network_manager=nova.network.manager.VlanManager
--fixed_range=192.168.0.0/12
--network_size=5000
--use_ipv6=False
The last line disables ipv6 which was the key to successful installation on our ipv4 network.
Make sure module nbd is loaded.
# lsmod|grep nbd
nbd 9959 0
If no output is generated load nbd using
# modprobe nbd
and add nbd to /etc/modules for loading on startup
# echo nbd >> /etc/modules
Add the sudoers entry to allow password less access to commands for user nova.
nova ALL=(ALL) NOPASSWD:ALL
* Please note that you would want to provide access to specific commands for more security. Some of the ones that nova uses are ifconfig, brctl, iptables-save, ip6tables, vgcreate, etc. This is not a complete list. The best way to find out is to start services. The log files will have errors for every command that needed sudo. Some commands are used when images are uploaded and VMs created, so grep sudo in logs if VMs dont start.
Start libvirt-bin if its not started.
service libvirt-bin start
Start nova-* services
# /etc/init.d/nova-api start
# /etc/init.d/nova-objectstore start
# /etc/init.d/nova-network start
# /etc/init.d/nova-compute start
# /etc/init.d/nova-scheduler start
The service logs can be found at /var/log/nova/nova-*.log
Create admin user and network
# nova-manage user admin theadmin
# nova-manage project create theadmin theadmin
# nova-manage network create 192.168.0.0/24 1 255
Download admin credentials in zip file:
# mkdir novacreds
# nova-manage project zipfile theadmin theadmin /root/novacreds/theadmin.zip
# cd novacreds/
# unzip fgadmin.zip
# source novarc
Time to upload images...
# mkdir images; cd images
# wget http://smoser.brickies.net/ubuntu/ttylinux-uec/ttylinux-uec-amd64-12.1_2.6.35-22_1.tar.gz
# tar zxvf ttylinux*.tar.gz
# euca-bundle-image -i ttylinux-uec-amd64-12.1_2.6.35-22_1-vmlinuz -p kernel --kernel true
Checking image
Tarring image
Encrypting image
Splitting image...
Part: kernel.part.0
Generating manifest /tmp/kernel.manifest.xml
# euca-bundle-image -i ttylinux-uec-amd64-12.1_2.6.35-22_1-initrd -p ramdisk --ramdisk true
Checking image
Tarring image
Encrypting image
Splitting image...
Part: ramdisk.part.0
Generating manifest /tmp/ramdisk.manifest.xml
# euca-upload-bundle -m /tmp/kernel.manifest.xml -b mybucket
Checking bucket: mybucket
Uploading manifest file
Uploading part: kernel.part.0
Uploaded image as mybucket/kernel.manifest.xml
# euca-upload-bundle -m /tmp/ramdisk.manifest.xml -b mybucket
Checking bucket: mybucket
Uploading manifest file
Uploading part: ramdisk.part.0
Uploaded image as mybucket/ramdisk.manifest.xml
# euca-register mybucket/kernel.manifest.xml
IMAGE ami-ni11y60o
# euca-register mybucket/ramdisk.manifest.xml
IMAGE ami-aqtrzsdb
Next upload the root image. Remember to replace the kernel and ramdisk ids with the ones you got for the previous 2 commands.
# euca-bundle-image -i ttylinux-uec-amd64-12.1_2.6.35-22_1.img -p machine --kernel ami-ni11y60o --ramdisk ami-aqtrzsdb
Checking image
Tarring image
Encrypting image
Splitting image...
Part: machine.part.0
Part: machine.part.1
Generating manifest /tmp/machine.manifest.xml
# euca-upload-bundle -m /tmp/machine.manifest.xml -b mybucket
Checking bucket: mybucket
Uploading manifest file
Uploading part: machine.part.0
Uploading part: machine.part.1
Uploaded image as mybucket/machine.manifest.xml
# euca-register mybucket/machine.manifest.xml
IMAGE ami-e185b2nh
You can verify that your images have been uploaded using:
# euca-describe-images
Create a key pair
# euca-add-keypair adminkey > adminkey.priv
# chmod 600 adminkey.priv
RESERVATION r-y8zrc2i4 fgadmin
INSTANCE i-00000008 ami-e185b2nh scheduling adminkey (theadmin, None) 0 m1.tiny 2011-01-24 20:35:28 unknown zone
Start an instance
# euca-run-instances ami-e185b2nh -k adminkey -t m1.tiny
1# euca-describe-instances
RESERVATION r-y8zrc2i4 fgadmin
INSTANCE i-00000008 ami-e185b2nh 192.168.0.3 192.168.0.3 running adminkey (theadmin, xxxx) 0 m1.tiny 2011-01-24 20:35:28 nova
Connect to the VM using your key... Replace 192.168.0.3 with the IP you get above
# ssh -i fgadminkey.priv root@192.168.0.3
The authenticity of host '192.168.0.3 (192.168.0.3)' can't be established.
RSA key fingerprint is 9e:e6:ce:c3:df:c6:30:c1:37:88:5d:22:df:27:8b:9a.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '192.168.0.3' (RSA) to the list of known hosts.
Chop wood, carry water.
#
You can also use the euca-get-console-output for looking at the VM output as it booted..
# euca-get-console-output i-00000008
i-00000008
2011-01-24 20:41:07.661615
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Linux version 2.6.35-22-virtual (buildd@yellow) (gcc version 4.4.5 (Ubuntu\/Linaro 4.4.4-14ubuntu5) ) #35-Ubuntu SMP Sat Oct 16 23:19:29 UTC 2010 (Ubuntu 2.6.35-22.35-virtual 2.6.35.4)
....
Subscribe to:
Comments (Atom)