Version 5 (modified by pruth, 7 years ago)

--

Installing OpenStack? on Centos 6

Installation

1. Install Centos 6.1

2. Disable SELinux: Replace "enforcing" with "disabled" in /etc/sysconfig/selinux. Reboot

3. Get install repo:

sudo rpm -ivh http://yum.griddynamics.net/yum/diablo-3/openstack/openstack-repo-2011.3-0.3.noarch.rpm

4. We want to use the "diablo" directory not "diablo-3". Edit /etc/yum.repos.d/openstack.repo to look like the following:

[openstack]
name=OpenStack
baseurl=http://yum.griddynamics.net/yum/diablo
enabled=1
gpgcheck=1
metadata_expire=90
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OPENSTACK

[openstack-deps]
name=OpenStack Dependencies
baseurl=http://yum.griddynamics.net/yum/master/deps
enabled=1
gpgcheck=1
metadata_expire=90
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-OPENSTACK

5. Install OpenStack? rpm

Cloud Controller:

sudo yum install euca2ools openstack-nova-node-full

Compute Nodes:

sudo yum install openstack-nova-node-compute

6. Setup suport services:

sudo chkconfig libvirtd on
sudo service libvirtd start
sudo service mysqld start
sudo chkconfig mysqld on
sudo service rabbitmq-server start
sudo chkconfig rabbitmq-server on

6. Create MySQL database on Cloud Controller

Set password for mysql

mysqladmin -uroot password nova

Script to setup database for OpenStack?

#!/bin/bash

DB_NAME=nova
DB_USER=nova
DB_PASS=nova
PWD=nova

CC_HOST="A.B.C.D" # IPv4 address
HOSTS='node1 node2 node3' # compute nodes list

mysqladmin -uroot -p$PWD -f drop nova
mysqladmin -uroot -p$PWD create nova

for h in $HOSTS localhost; do
        echo "GRANT ALL PRIVILEGES ON $DB_NAME.* TO '$DB_USER'@'$h' IDENTIFIED BY '$DB_PASS';" | mysql -uroot -p$DB_PASS mysql
done
echo "GRANT ALL PRIVILEGES ON $DB_NAME.* TO $DB_USER IDENTIFIED BY '$DB_PASS';" | mysql -uroot -p$DB_PASS mysql
echo "GRANT ALL PRIVILEGES ON $DB_NAME.* TO root IDENTIFIED BY '$DB_PASS';" | mysql -uroot -p$DB_PASS mysql

nova-manage db sync

7. Configure firewall

Cloud Controller

sudo iptables -I INPUT 1 -p tcp --dport 5672 -j ACCEPT
sudo iptables -I INPUT 1 -p tcp --dport 3306 -j ACCEPT
sudo iptables -I INPUT 1 -p tcp --dport 9292 -j ACCEPT
sudo iptables -I INPUT 1 -p tcp --dport 6080 -j ACCEPT
sudo iptables -I INPUT 1 -p tcp --dport 8773 -j ACCEPT
sudo iptables -I INPUT 1 -p tcp --dport 8774 -j ACCEPT
sudo iptables -I INPUT 1 -p udp --dport 67 -j ACCEPT

All Compute Nodes

sudo iptables -I INPUT 1 -p tcp -s <CLOUD_CONTROLLER_IP_ADDRESS> --dport 5900:6400 -j ACCEPT

8. Configure /etc/nova/nova.conf. One example using a single NIC. Requires a vlan (by default vlan tag 100). Replace CLOUD_CONTROLLER_IP with your cloud contorller's IP.

--verbose=true
--ec2_url=http://CLOUD_CONTROLLER_IP:8773/services/Cloud
--s3_host=CLOUD_CONTROLLER_IP
--cc_host=CLOUD_CONTROLLER_IP
--rabbit_host=CLOUD_CONTROLLER_IP
--sql_connection=mysql://nova:nova@CLOUD_CONTROLLER_IP/nova
--glance_api_servers=CLOUD_CONTROLLER_IP:9292
--use_s3=true
--libvirt_type=kvm
--use_syslog=false
--node_availability_zone=nova
--logdir=/var/log/nova
--logging_context_format_string=%(asctime)s %(name)s: %(levelname)s [%(request_id)s %(user)s %(project)s] %(message)s
--logging_default_format_string=%(asctime)s %(name)s: %(message)s
--logging_debug_format_suffix=
--use_cow_images=true
--auth_driver=nova.auth.dbdriver.DbDriver
--scheduler_driver=nova.scheduler.zone.ZoneScheduler
--image_service=nova.image.glance.GlanceImageService
--use_ipv6=false
--ca_path=/var/lib/nova/CA
--keys_path=/var/lib/nova/keys
--images_path=/var/lib/nova/images
--buckets_path=/var/lib/nova/buckets
--instances_path=/var/lib/nova/instances
--networks_path=/var/lib/nova/networks
--injected_network_template=/usr/share/nova/interfaces/
--libvirt_xml_template=/usr/share/nova/libvirt.xml.template
--vpn_client_template=/usr/share/nova/client.ovpn.template
--credentials_template=/usr/share/nova/novarc.template
--state_path=/var/lib/nova
--lock_path=/var/lib/nova/tmp
--vnc_enabled=true
--vncproxy_url=http://CLOUD_CONTROLLER_IP:6080
--vncserver_host=0.0.0.0
--vnc_token_ttl=300
#
## Networking
--network_manager=nova.network.manager.VlanManager
--dhcpbridge_flagfile=/etc/nova/nova.conf
--dhcpbridge=/usr/bin/nova-dhcpbridge
--flat_network_bridge=br100
--flat_interface=eth0
--public_interface=eth0
--vlan_interface=eth0
--my_ip=CLOUD_CONTROLLER_IP
--lock_path=/tmp
--bridge_interface=eth0

9. Start your OpenStack? services

for n in api compute network objectstore scheduler vncproxy; do sudo service openstack-nova-$n start; done
sudo service openstack-glance-api start
sudo service openstack-glance-registry start
for n in node1 node2 node3; do ssh $n sudo service openstack-nova-compute start; done

10. Create public/private networks for vms. You must have a vlan tag enabled on your switch for this to work. Public network is bridged to vlan100 by default.

nova-manage --flagfile=/etc/nova/nova.conf network create private 10.0.1.0/24 1 256
nova-manage --flagfile=/etc/nova/nova.conf floating create 10.0.2.0/24 

11. Create user and project (both user and project called "admin")

nova-manage --flagfile=/etc/nova/nova.conf user admin admin
nova-manage --flagfile=/etc/nova/nova.conf project create admin admin

12. Get the credential files and source the novarc file

nova-manage --flagfile=/etc/nova/nova.conf project zipfile admin admin
unzip nova.zip
source novarc

You should now be able to use the ec2 commands. Try:

euca-describe-instances

13. Allow ping/ssh access

euca-authorize -P icmp -t -1:-1 default
euca-authorize -P tcp -p 22 default

14. Something is broken about the dhcp server that OpenStack? deploys. Kill all dnsmasq servers and restart the nova-network service. If you don't do this you will not be able to access your vms.

sudo killall dnsmasq
sudo service openstack-nova-network restart

Starting a VM

1. Get a working image with kernal and initrd.

Simple example image:

wget http://smoser.brickies.net/ubuntu/ttylinux-uec/ttylinux-uec-amd64-12.1_2.6.35-22_1.tar.gz
tar -xvf ttylinux-uec-amd64-12.1_2.6.35-22_1.tar.gz

2. Bundle, upload, and register the kernel, initrd, and image

euca-bundle-image -i ttylinux-uec-amd64-12.1_2.6.35-22_1-vmlinuz --kernel true
euca-upload-bundle -b kernel-bucket -m /tmp/ttylinux-uec-amd64-12.1_2.6.35-22_1-vmlinuz.manifest.xml
euca-register kernel-bucket/ttylinux-uec-amd64-12.1_2.6.35-22_1-vmlinuz.manifest.xml

euca-bundle-image -i ttylinux-uec-amd64-12.1_2.6.35-22_1-initrd --ramdisk true
euca-upload-bundle -b ramdisk-bucket -m /tmp/ttylinux-uec-amd64-12.1_2.6.35-22_1-initrd.manifest.xml
euca-register ramdisk-bucket/ttylinux-uec-amd64-12.1_2.6.35-22_1-initrd.manifest.xml

euca-bundle-image -i ttylinux-uec-amd64-12.1_2.6.35-22_1.img --kernel <aki name> --ramdisk <ari name>
euca-upload-bundle -b image-bucket -m /tmp/ttylinux-uec-amd64-12.1_2.6.35-22_1.img.manifest.xml
euca-register image-bucket/ttylinux-uec-amd64-12.1_2.6.35-22_1.img.manifest.xml

Try:

euca-describe-images

3. Add a key

euca-add-keypair mykey > mykey.pem

4. Run the vm

Replace IMAGE_ID with your image id (probably i-00000003)

euca-run-instances -k mykey IMAGE_ID

5. You should have a running instance

Try (replace VMs_IP with your vm's IP)

euca-describe-instances
ping VMs_IP
ssh -i mykey.pem root@VMs_IP

References

http://yum.griddynamics.net/yum

http://wiki.openstack.org/NovaInstall/RHEL6Notes-Diablo-3 (a lot of instructions borrowed from here)

Attachments