I can haz (free) cloud?
One of the projects I’ve wanted to try for a while was to build a cloud like Amazon’s. Naturally I don’t have hundreds of computers lying around like they do, but it is possible to set one up on a single computer, if you know how.
Before we look at our options, we need to answer why you would want a cloud. There are many reasons it might be beneficial to run a cloud. One is that you can turn one computer into 2 or more. This allows you to take a computer that might not be constantly in use, and split the work it does between two or more computers. This has advantages in software development, or if you wanted to have one virtual server doing one task and another one doing another. Since you can also “save” instances, you can scale up and down your projects as needed, so if you suddenly need 3 more servers to test with, you can do that with the push of a button, no additional hardware required.
Before embarking on making your own cloud, I recommend playing around with Virtualbox, and see if you find yourself using another operating system or even another “computer” enough to justify the time. I’ve been using Virtualbox for a very long time, and I’m always spinning up various Linux versions with it to play around with new things in the Linux world.
If you wanted to do it the hard way, you might look at Eucalyptus, which is the original free private cloud software. However, having tried it, it’s very difficult to set up, even with their guides. Ubuntu Enterprise Cloud is free and built on top of Eucalyptus to try to make it a little easier. Of course then you are tied to Ubuntu, which isn’t a problem for me so much since I use Ubuntu regularly for all kinds of functions. But it’s still problematic because…
Ubuntu just announced they were moving to support OpenStack, an initiative from dozens of companies to build a comprehensive set of open-source cloud software. With it you can build the major components of Amazon, mainly their EC2 virtual machine farm. That’s what I did and what I’ll be focusing on right now.
OpenStack, I will admit, is still a little raw. It has some confusing documentation, and the community is still small (case in point, they got a forum this week finally…). However, they do have plenty of documentation, and since Ubuntu has contributed their UEC software, you can look at a lot of Ubuntu’s documentation and apply it almost directly to OpenStack.
Now, if the idea of installing Ubuntu and then beating your head against the wall as you install packages and configure it all sounds like a bad job, then one company is going to save you a lot of time and frustration. They are called StackOps, and they are a cloud consulting company. However their biggest achievement which relates to his post is the StackOps Distro. This installs Ubuntu with all the packages needed to run OpenStack Nova (the EC2 clone), configured and ready to go free of charge.
Best of all when you get it all installed it will tell you go to a web address on your server. This will take you to their StackOps Smart Installer, and walk you through configuring your cloud. It explains in perfect detail everything you might need to change, but advises you to keep most of it as it is. After going through their wizard, it sends the configuration commands to your server, and you are ready to go. Then all you need to do is log in, create a user and project, and start registering custom server images to use in your cloud (There could be a whole post on that, look it up if you’re interested since it’s pretty complex).
It’s not entirely sunshine and rainbows with StackOps, but it’s close. For one thing, I had to install it like 4 times since I kept messing up the configuration. So here are some tips to save you some time:
- Don’t install your server with LVM. StackOps/OpenStack doesn’t seem to support it, so don’t bother.
- For the public range of IP addresses it asks you to enter, be sure that’s the IP addresses your router deals with, so for mine it’s 192.168.0.1 for the router, so I would put in 192.168.0.64/28 in. Yours might vary
- If you listened and didn’t install LVM, make sure you set the storage controller to sda5 or an empty hard drive. It has to be an empty partition or non-partitioned disk. The first page it takes you to lists all the partitions. Unused ones will show a -1 for the used size.
- Put the disk back in after the install. Don’t ask me why, but it makes you take it out after installing, then requires it to do the automatic configuration. So you’ll skip an error by putting it back in once the server is up.
If you want to use a web GUI, they have the OpenStack Dashboard project. It is VERY raw(not to mention very odd to install), so I would skip it and do the basics manually in the command line, then use something like HybridFox to spin up instances, assign them public IPs, etc. And be sure to get version 1.6 of HybridFox, since 1.7 doesn’t support OpenStack.
Now that you (hopefully) have the cloud up and running, there are a few things to know. I’ll assume you looked here and downloaded and bundled the Ubuntu image it has. You want to do that. You can also use the Eucalyptus images here, but keep in mind you will have to launch those with a keypair (see here) or else you can’t ssh into it.
Hopefully that’s enough for you too to spin up your own cloud. Let me know in the comments if you run into problems with it. I’ve probably had them myself since it took me a week to figure out how to get it all up and running!