Introducing OpenStack Packstack
Installing and deploying OpenStack is a tricky business and its not uncommon for people to get bogged down at the early stages, the task gets even more difficult when you try to do more then an all in one installation.
In order to help people with this task I have been working on a tool that is capable of installing openstack in a distributed environment using some of the most common configurations. Packstack can be used to transform Fedora 17/18, RHEL 6 or CentOS 6 servers into a functional Openstack Folsom deployment. The tool ssh’s onto each server and apply’s puppet manifests to set openstack up. Below I give a brief outline of how todo this on Fedora 17
I’ll be installing openstack on 2 servers
s1 : keystone, glance, nova controller, cinder, swift proxy
s2 : nova compute, swift storage
Before the install each of the servers must have a running ssh server and root must be able to login over ssh
Fedora 17 has openstack Essex packages, so we are going to add a Openstack Folsom repository, these are the packages from Fedora 18(currently in Beta), if doing this on Fedora 18 in future this step wont be needed. The repository is needed on both servers.
s1> curl http://repos.fedorapeople.org/repos/openstack/openstack-folsom/fedora-openstack-folsom.repo > /etc/yum.repos.d/fedora-openstack-folsom.repo
s2> curl http://repos.fedorapeople.org/repos/openstack/openstack-folsom/fedora-openstack-folsom.repo > /etc/yum.repos.d/fedora-openstack-folsom.repo
install packstack on s1
s1> yum install -y openstack-packstack
If you don’t have one you’ll also need to create a ssh keypair, packstack will install the public key on all servers.
Once packstack is installed we need to generate an answer file, this answer file is used to setup the way openstack will be installed.
s1> packstack --gen-answer-file=ans.txt
If your going to install cinder your going to need a cinder-volumes volume group, in this case we’ll be using /dev/vdb as a cinder volume
s1> yum install -y lvm2
s1> vgcreate cinder-volumes /dev/vdb
Next we need to edit the answer file, I’ve attached the answerfile that I am using and will explain some of the values here
CONFIG_SSH_KEY=/root/.ssh/id_rsa.pub – the public key to copy to each server.
CONFIG_SWIFT_INSTALL=y – the default answer file doesn’t install swift
CONFIG_*_HOST=192.168.122.101 – set these to the IP address of s1, this pretty must tells packstack to install everything on s1
CONFIG_NOVA_COMPUTE_HOSTS=192.168.122.102 – tell packstack to install s2 as a nova compute node, this can be a comma separated list for adding more then one compute node
CONFIG_SWIFT_STORAGE=192.168.122.102 – tell packstack to install s2 as a swift storage node, this can be a comma separated list for adding more then one storage node, we haven’t specified a device here so packstack will create a loopback storage device for testing with. If you have a block device to setup for swift storage, the format would be 192.168.122.102/vdb (for /dev/vdb)
CONFIG_NOVA_COMPUTE_PRIVIF=eth0 CONFIG_NOVA_NETWORK_PRIVIF=eth0 – these should be set to the network devices for the nova private network
CONFIG_NOVA_NETWORK_PUBIF=eth0 – this should be set to the public network device on nova network server
Finally we just need to run packstack using this edited answer file
s1> packstack --answer-file=ans.txt
Thats it, packstack will attempt to ssh to each machine, asking for the root password(if ssh keys havn’t been setup). Simply enter the root password then wait. All going well after 10 to 15 minutes you will have a running openstack.
In your home directory you will now have a keystonerc_admin file, this file contains the authentication credentials to use openstack as the admin user, from here you can
s1> source ~/keystonerc_admin
Add an image to glance
s1> glance image-create --name cirros --disk-format qcow2 --container-format bare --is-public 1 --copy-from https://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img
List images in glance
s1> nova image-list
Boot a new vm on nova, get the uuid from the glance command above
s1> nova boot --image <imageuuid> --flavor 1 testvm
Create a cinder volume
s1> nova volume-create 1
Attach the new volume to our vm
s1> nova volume-attach <instanceuuid> <volumeuuid> /dev/vdb
delete the new VM
s1> nova delete <instanceuuid>
upload a file to swift
s1> swift upload c1 filetoupload
list containers in swift
s1> swift list
Load up horizon in your browser http://192.168.122.101/dashboard/ the admin credentials are in the file ~/keystonerc_admin
packstack is a relatively new project so is sure to have some problems, some parts are brittle, things need to be hardened and it mightn’t interface with the user a well as it could, I hope to get any problems fixed as quickly as possible bugs/suggestions can be added here https://github.com/fedora-openstack/packstack , or better yet fork it and send some pull requests.
want to try it out on RHEL 6.3 or CentOS here is a rpm