Attaching a Rackspace Cloud Server Ubuntu Instance to RightScale
- At August 31, 2011
- By jrs
- In Cloud Computing
2

RightScale is pretty cool. It isn’t cheap mind you, but once you get up to the levels of needing a cloud manager, it’s pretty darn good. Couple RightScale with the ease of use of Rackspace (as opposed to Amazon’s AWS) and you have a pretty hot little setup. Or not so little. You can setup a free developer’s account in minutes. The developer account will let you try out just about everything RightScale can do except auto-scaling, using tech support, and access to most server templates.
I have been slowly RightScale-enabling a series of servers for a high-availability, load-balanced, nginx cluster. It’s remarkably easy to do, with a few exceptions. The results of this exercise and full step-by-step instructions for manually building a variety of HA/LB instances will be published on this site very soon.
Since RightScale has, up until lately, been pretty much Amazon-centric, one of the weaknesses is the lack of complete support for Rackspace. They are working on full automation (and hopefully documentation), but in the meantime, there are a few hiccups.
Launching new images from RightScale is not much of a problem, but bringing an existing instance under RightScale’s management is a little less obvious. There is no automated way to do it. The online documentation is not bad but uses Amazon for all it’s examples. If you understand the differences, you can probably work your way through it.
One point of confusion is the idea of “instances” versus “servers” and “deployments”. Within RightScale’s dashboard, you can manage all your instances, whether they be on Rackspace or elsewhere. Of course you can do that natively in Rackspace or Amazon’s control panels. What you cannot do is monitor them, scale them, add them to server templates, run RightScripts and so on. Those abilities are only available for instances deployed from within RightScale using a server template and an image (specific machine image, muti-cloud image or what-have-you).
In order to attach a running Rackspace Ubuntu instance to RightScale (and to provide a launch-able image for later use in a server template), there are a few manual steps to follow. Don’t worry, this is all easily reversible, so you can afford to experiment with RightScale without doing serious harm to your server. Do I need to mention that you should NOT do this with a production server? I didn’t think so
- Install RightLink.
- Create Rackspace Cloud image.
- (Optional) Launch Rackspace Cloud image to RightScale.
- Deploy Rackspace Cloud image to RightScale.
- Delete old Rackspace instance.
1. Install RightLink
RightLink is RightScale’s management and monitoring interface into your server. It includes some nice things, like collectd for monitoring, but that’s going to be covered in a later article.
The following is cribbed from RightScale’s Ubuntu Installation instructions with a couple of necessary additions. Save this as and executable script if you like, or just follow the steps manually.
The default installation does not create the /var/spool/rackspace directory nor the files in it. Both are needed for proper start up of the daemons. The script takes care of that now.
#!/bin/bash
#
# Install RightLink from RightScale
#
# Author: Julian R. Smith
# Contact: http://theseospecialist.net
# Date: 2011.08.31
# Version: 0.1
# Change this to the latest version and/or architecture
# http://mirror.rightscale.com/rightlink/latest_linux/ubuntu/
DEBURL="http://mirror.rightscale.com/rightlink/latest_linux/ubuntu"
DEB="rightscale_5.6.28-ubuntu_10.04-amd64.deb"
#DEB="rightscale_5.6.28-ubuntu_10.04-i386.deb"
# Omit this and you will be prompted for the cloud type
mkdir -p /etc/rightscale.d; echo -n rackspace > /etc/rightscale.d/cloud
cd /tmp
# Make sure sources are up to date and install dependencies
apt-get update
apt-get -y install libc6 debconf curl git-core
# RightLink doesn't exist in any repository (yet).
wget ${DEBURL}/${DEB}
dpkg -i ${DEB}
rm -v ${DEB}
# missing in rightscale installation but needed for startup
mkdir /var/spool/rackspace
touch /var/spool/rackspace/user-data.sh
touch /var/spool/rackspace/user-data.txt
echo "RightLink installation finished"
2. Create Rackspace Cloud image
If this was an Amazon instance, you would be able to bundle it from the RightScale dashboard. Since it is with Rackspace, we have to do it manually, but it’s easy.
- Login to your Rackspace account
- From the “Hosting” menu, pick “Cloud Servers” and then choose the “Server Images” tab
- Create a new image of the server. Use something descriptive for the name, such as “ububtu.11.04.amd64.512.nginx.php-fpm.rightlink”
3. Launch Rackspace Cloud image within RightScale (optional)
At this point, you can launch instances from within RightScale. The problem is, you can do that from Rackspace’s control panel as well! The real power of RightScale comes when this server is made part of what RightScale calls a “deployment”. If you just want to launch an instance of this server from within the dashboard to prove that it actually works, follow these steps. If you trust that it does work and want to really see what RightScale can do, jump to the next section.
- Login to your RightScale account
- From the “Cloud” menu, choose “Rackspace” and then “Images”.
- Find the image you created above and click on it’s name to launch a new instance of that image.
- In your Rackspace control panel, check that the image has been created properly.
You will see that RightScale has added a prefix to your server name. Feel free to change it. Having RS-123456789 as a prefix really messes up what is normally my logical naming scheme. Funnily enough, RightScale’s dashboard will show the server name without the prefix! There is another annoyance actually — RightScale will always show the instance name as the one it was created with, even if you change it in Rackspace.
4. Deploy Rackspace Cloud image within RightScale
Now comes the fun part. The next steps are not obvious, or at least they weren’t to me the first time I tried it.
At this stage, we need to add our server to a deployment, using a server template which we customize with our machine image. It sounds worse than it is.
- First, you need a server template from the MultiCloud Marketplace. I chose the Base ServerTemplate for Linux – Beta since it is not cluttered up with packages I don’t need (the server is already configured the way I want it). Click on the “import” button to bring the template into your account.
- In the RightScale dashboard, pick a deployment from the “manage” menu, or create a new deployment (safer!).
- Once in the “servers” tab within the deployment, click the “Add Server” button.
- Choose “Rackspace” as the cloud if you have more than one provider configured.
- Pick the server template you just imported.
Do not click “launch “or “finish” at this point or you will find yourself with a bare CentOS instance! Click “Server Details” instead. - Now in the server details screen, pick the instance type you need (256MB, 2GB etc).
- The MultiCloud Image drop down will not show our newly built image. Click on the Advanced Options and pick the recently built image for Machine Image.
- Click on the Confirm button and review the details then click Finish.
You will be warned that the configuration is unsupported (our machine image) and so on.
Now go into your deployments dashboard and you should see the new server ready to launch. Go ahead and launch it. You will be presented with options for overriding inputs (configurations)… change the timezone if you want and click launch.
In a few minutes, you will be able to play with the rest of the dashboard control — monitoring etc.
5. Delete old Rackspace instance
Once you have confirmed that the new instance is running the same way as the old one was (be that good or bad), you can delete the old Rackspace instance.
Hopefully this article has been useful. Even if it hasn’t been
, I would appreciate a +1. Comments are more than welcome.

Ian Smith
Hi, great article. Very useful – much better than the RightScale docs. It almost works perfectly for me. I’m trying to do exactly the same thing to bring a Rackspace image into my RightScale account. I’ve followed your instructions to the letter but for some reason RightLink doesn’t seem to start properly (when I boot the server in RightScale it just stays PENDING and no /etc/log/message log is created). It’s only when I launch the server from RightScale, then SSH onto the server and manually start the RightScale, RightBoot and RightLink services do things kick in. Any ideas?
jrs
Thanks for the kudo.
To be honest, it has been a while since I wrote this, and while I ran up a few servers this way, I have decided to wait for RightScale’s support for RackSpace to mature a little more before I commit to it.
That said, if you find out I missed something in the above, please let me know!