Showing posts with label ubuntu. Show all posts
Showing posts with label ubuntu. Show all posts

Wednesday, April 4, 2012

First OpenStack Experience


I’ve been monitoring the OpenStack project quite casually since it first started and finally the other day I found enough time and motivation to start playing around with it.  I thought I would document my initial experience with the platform and I hope that others find this information valuable if they run into some of the same issues I did.  One caveat to this article this is I'm a software engineer, not a Linux system administrator.

Fortunately I have the luxury of having a fairly high powered computer on hand on which I loaded Ubuntu 11.10 on the spare disk.   In my first attempt at installing OpenStack, I managed to install the 32bit version so once I got up and running and I was momentarily confused about why I could only spin up “m1.tiny” instances.  This error gave some great experience in understanding how to setup OpenStack so I re-installed the laptop with 64bit Ubuntu and I made sure that I re-partitioned the drive so I had enough free disk space for the “nova-volumes” LVM group required by swift.  (As a note, in the first installation attempt, I created the LVM volume “nova-volumes” in an image connected to /dev/loop1 since I didn’t have a free partition at that time.  This strategy was effective for my purposes)

The guide I followed to install OpenStack can be found here: http://docs.openstack.org/trunk/openstack-compute/starter/content/.  This guide is quite detailed and provided a lot of really great tips.  Excellent job OpenStack team!

The main place I ran into trouble was with running the custom AMI image that is created when walking though the guide, described http://docs.openstack.org/trunk/openstack-compute/starter/content/OS_Installation-d1e1298.html .  The process of creating the AMI worked well enough and the image does run but there seems to be several problems. (others may not experience this)

  • cloud-init does not seem to run properly even though I have access to http://169.255.169.255/ I don’t know if this was my setup or if I am missing something with the installation and setup of cloud-init but it does not properly set my ssh keys or my host name of the guest os.  I can ssh to the guest and login with the user-name and password created in the installation process.  Running an Ubuntu cloud AMI from http://cloud-images.ubuntu.com/releases/oneiric/release/ works great, cloud-init performs its functions, sets up ssh keys, sets the host name, runs scripts etc… so clearly I’m doing something wrong when I create my custom ami but I’m happy running the Ubuntu images for now.
  • When I tried to attach a volume to my custom AMI, the euca-attach-volume command would return successfully but the OS did not recognize it.  After a lot of frustration I realized that I could attach the volume and then reboot the instance before it would show up.  I still don’t know why this is the case however, the Ubuntu cloud AMI’s work well here too.  They immediately detect when a volume has been attached / detached.
I don’t know where the tutorial for creating a good Ubuntu AMI is, I did look, but I didn’t look that hard so maybe if I am motivated I will solve this problem as well.

The other problem I had was also related to attaching volumes.  The tutorial states that open-iscsi is always used when attaching the volume which is almost true, there is a flag that allows for a local drive to be used when swift and compute are both installed on the same server (which is my case).  So as part of the debugging process when I was trying to figure out why everything looked good but no volume was attached to my image, I saw no ISCSI connections when running ‘sudo iscsiadm –m session’.  Eventually I found the flag and disabled local connections and ISCSI was discovered properly which is where I ran into my second problem which was that ‘lun-0’ was hard-coded into the OpenStack ISCSI volume driver code for attaching the ISCSI drive to the instance and, of-course my swift-created volume was on ‘lun-1’.  I fixed the code (hacked the code hardcoding ‘lun-1’… bad I know) and then everything was working well. After reviewing the code on GitHub I realized that the OpenStack guys are already on top of the issue and have since addressed it and in fact, it seems that they have addressed a large number of issues in the current code base that would still be in the packages installed by Ubuntu 11.10.  That said, I have not upgraded since everything is currently working just fine.  I could have simply relied on the local drive instead of using ISCSI but I didn't realize that was working until after I made the changes to my local installation.

I briefly tried installing keystone and dashboard but the documentation was not easy enough for me to follow in a couple of minutes so I aborted configuring those projects.  I will probably re-engage those projects when they become part of the OpenStack core but I don’t really need them for my current experimentation.

In conclusion, OpenStack is a great project, my adventures with OpenStack are far from over and I have learned a ton about it and in general the cloud platform with respect to Amazon AWS and Rackspace.  I still have a lot to learn about the platform but I can get by with the basics now.  This is a pretty powerful technology and having access to a private cloud is an important thing for me.