How to Install OpenStack Essex on Ubuntu 12.04
August 23, 2013 Leave a comment
To perform some experiments related to our research at IU, we wanted to have our own cloud running. So we thought OpenStack is the best option and I started installing it on a single machine. Initially I thought it will be easy to get it up and running but that wasn’t the case. It took me few days to get it up and running properly with all expected features. So I thought of writing a post which will be useful for someone who’ll try to do the same.
I installed OpenStack Essex on Ubuntu 12.04. Initially I followed the Essex Documentation to get an idea about what is what in OpenStack. But following that documentation to install Essex on a single node is very difficult because it doesn’t provide enough details about some steps and you have to perform lot of small steps which might go wrong.
However I found this post which provides a very good script which automatically installs most of the components I wanted to have. While following that, there’s one very important point to keep in mind, if you don’t have two NIC cards on your computer. You have to create a virtual network interface (eth0:0) in /etc/network/interfaces file as shown below.
auto lo iface lo inet loopback auto eth0 iface eth0 inet static address 10.100.1.100 network x.x.x.x netmask x.x.x.x broadcast x.x.x.x gateway x.x.x.x dns-nameservers x.x.x.x auto eth0:0 iface eth0:0 inet manual
Make sure you restart the networking module after changing the configuration.
After that, if you want to have floating (public) IPs assigned to your VMs, you have to get a chunk of dedicated public IPs from your network administrator and those IPs must be from the same subnet to which the host machine is connected. After doing that, you can run the script given in the above post as shown below.
sh OSinstall.sh -T all -F 10.100.1.72/29 -f 192.168.12.32/27 -s 30 -P eth0 -p eth0:0 -t demo -v kvm
If you followed everything correctly so far, the script should set up glance, keystone and nova for you and you should be able to access the dashboard through the browser. Now upload an image as directed in the above post and you should be able to create instance through the dashboard. If you have used floating IPs, you can allocate those into your project and associate with your VMs. Then you can access your VMs from anywhere through the public IP.
Configuring Nova Volumes
If you want to use your hard disk space within your VMs, you have to configure Nova volumes to do that. You have to have some unused space in your hard drive and you can use ‘fdisk’ to create a partition on that and format it as needed. To configure Nova volumes, follow this section on the original documentation.
After following the given steps, you may get an error while attaching a volume to a VM similar to the one given below in the nova-compute.log.
2013-08-22 15:58:26 TRACE nova.rpc.amqp cmd=' '.join(cmd)) 2013-08-22 15:58:26 TRACE nova.rpc.amqp ProcessExecutionError: Unexpected error while running command. 2013-08-22 15:58:26 TRACE nova.rpc.amqp Command: sudo nova-rootwrap iscsiadm -m node -T iqn.2010-10.org.openstack:<wbr />volume-00000003 -p <a href="http://18.104.22.168:3260/" target="_blank">22.214.171.124:3260</a> --rescan 2013-08-22 15:58:26 TRACE nova.rpc.amqp Exit code: 255 2013-08-22 15:58:26 TRACE nova.rpc.amqp Stdout: '' 2013-08-22 15:58:26 TRACE nova.rpc.amqp Stderr: 'iscsiadm: No portal found.\n' 2013-08-22 15:58:26 TRACE nova.rpc.amqp 2013-08-22 15:58:26 DEBUG nova.compute.manager [-] Updated the info_cache for instance 6e792ef9-e64b-4012-9daa-<wbr />923a5377517d from (pid=1410) _heal_instance_info_cache /usr/lib/python2.7/dist-<wbr />packages/nova/compute/manager.<wbr />py:2260 2013-08-22 15:58:26 DEBUG nova.manager [-] Skipping ComputeManager._run_image_<wbr />cache_manager_pass, 30 ticks left until next run from (pid=1410) periodic_tasks /usr/lib/python2.7/dist-<wbr />packages/nova/manager.py:149
Solution to this issue is given in this post.
If you successfully got through all above steps, now you should be able to create volumes and attach those to your VMs. After attaching, you can log into the VM and create a partition using the attached volume and mount it onto the file system of the VM.
Where to find nova logs
You can find all nova logs (nova-compute.log, nova-console.log, nova-volume.log etc.) in ‘/var/log/nova’ directory.
You can find instance logs for each VM you create under ‘/var/log/libvirt/qemu’ directory.
You can find some more important configurations under ‘/etc/libvirt/qemu/’ directory as well.