Returning Customers — Login
Call 1.866.720.0208 or contact us
Boot a non-RightScale-enabled Ubuntu AMI, perform some additional configuration, install the RightLink package, and re-bundle the instance into a new, RightScale-enabled AMI. Optionally, create an MCI (MultiCloud Image) for your new image.
Important!
Do not forget to tag the MultiCloud Image! Any MCI that points to custom images that have RightLink installed must be tagged appropriately to successfully operate with the RightScale management platform; see the last step in this article for more information.
Table of Contents
The following tutorial assumes that you are not using a RightImage to launch an Ubuntu instance. (You do not need to install RightLink if you are using v5 RightImages or later.)
In order to create a new RightLink-enabled image, you first need to launch a bare EC2 instance in the AWS region where you want the new image to be created. In the RightScale Dashboard, navigate to the appropriate cloud in the menu (e.g. Clouds -> AWS Region -> EC2 Images). Find the machine image that you want RightLink-enable.
Amazon does not publish any Ubuntu images themselves.
If you are looking to launch an official Ubuntu AMI, published by Canonical, please see EC2StartersGuide and the available UEC images. Since any user can publish an image with 'ubuntu' in the name, you'll want to use the filter tool and search for official Ubuntu images that were published by Canonical. Under the EC2 Images -> Others tab, you can filter for Canonical's images by using their AWS Account Number (Cloud Owner = 0997-2010-9477). Be sure to select an image with the correct system architecture. (i386 = 32bit; x86_64 = 64bit)
Note: You will need to launch the instance using a Security Group where TCP port 22 is open (Create a Security Group). This port is required for SSH access. (see screenshot)
Launch a new instance from the selected base AMI.
Once the instance becomes operational, click on its 'SSH Console' button in the RightScale Dashboard.
Note: If you are running an Ubuntu 10.04 (lucid) or later release (which by default has root disabled for SSH), you must first enable root manually if you intend to use the dashboard to bundle the instance.
Save the SSH key used by the instance from the Dashboard into a text file locally on your desktop.
Next, issue the following command replacing <PATH TO YOUR SSH KEY> with the location of where you saved the SSH key (chmod 700 recommended) and <EC2_PUBLIC_IP> with the public IP address of the instance as shown on the Info tab:
ssh -i <PATH TO YOUR SSH KEY> ubuntu@<EC_PUBLIC_IP> \ 'sudo cp /home/ubuntu/.ssh/authorized_keys /root/.ssh/'
The above command needs to be run from a terminal emulator or shell.
For more information on Ubuntu and root, see "Using sudo, ssh, rsync on the Official Ubuntu Images for EC2".
If the AMI you launched does not include Amazon EC2 AMI Tools, install them now either via Apt (recommended), RPM or ZIP.
Ensure you have the multiverse repository enabled when installing with Apt from the Ubuntu repositories.
mkdir -p /etc/apt/sources.list.d cat <<EOF>>/etc/apt/sources.list.d/ubuntu-multiverse.list deb http://us.archive.ubuntu.com/ubuntu/ lucid multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ lucid multiverse deb http://us.archive.ubuntu.com/ubuntu/ lucid-updates multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ lucid-updates multiverse EOF apt-get update && apt-get -y install ec2-ami-tools
mkdir -p /etc/apt/sources.list.d cat <<EOF>>/etc/apt/sources.list/ubuntu-multiverse.list deb http://us.archive.ubuntu.com/ubuntu/ maverick multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ maverick multiverse deb http://us.archive.ubuntu.com/ubuntu/ maverick-updates multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ maverick-updates multiverse EOF apt-get update && apt-get -y install ec2-ami-tools
Browse RightScale's mirror (http://mirror.rightscale.com/rightlink/) for available RightLink packages. (See Download RightLink Packages) Although we recommend using the latest available RightLink package, it may not be available for your particular release. The most recently published packages can be found in the "latest" RightLink packages directory. If you do not find a suitable package in the "latest" directory, you can also browse for a different version from one of the archived directories. You must choose the distribution package that's most appropriate for your purposes, based upon your instance's operating system and CPU architecture (32- or 64-bit).
There are a few dependencies to the RightLink package. As the package does not yet reside in an Apt repository, manually install the following packages (some of these will likely already be installed).
# apt-get -y install libc6 debconf curl git-core
Note, this is only required for unattended installs (e.g. scripts) and/or RightLink <5.5 packages.
Run the following command to set the cloud type to Amazon EC2:
# mkdir -p /etc/rightscale.d; echo -n ec2 > /etc/rightscale.d/cloud
This file is used by the RightLink agent to recognize which cloud type the instance is running on.
Install the desired RightLink package. This example downloads and installs the latest RightLink package for Ubuntu 8.04 (hardy) on an x86 instance. It also removes the downloaded package upon a successful install.
cd /tmp && \ wget http://mirror.rightscale.com/rightlink/latest_linux/ubuntu/rightscale_5.6.8-ubuntu_10.04-i386.deb && \ dpkg -irightscale_5.5.9-ubuntu_8.04-i386.deb&& \ rm -vrightscale_5.5.9-ubuntu_8.04-i386.deb
This package has been known to work on later Ubuntu releases.
Enter cloud type when prompted
What type of cloud am I running on (ec2, eucalyptus, rackspace, vmops)? ec2
When prompted, enter the type of cloud for which the image is intended. (e.g. for Amazon EC2, use 'ec2')
$ cat /var/log/messages
Note: As the RightLink service currently starts on install of the package, you will observe this message in the system log:
RightScale: Initializing ec2 instance data. RightScale: curl: (22) The requested URL returned error: 404 RightScale: !!!!! User data empty RightScale: No EIP, current IP=<public_ip> done...
Subsequently because the instance is not currently attached to a RightScale server:
RightScale: RS_rn_id not found in user data. Not attached to RightScale.
This should be ignored. After you have re-bundled the running instance into a new AMI and launched with a server, you will observe successful attachment to RightScale.
To create a new AMI from the running instance, click the Bundle button in the dashboard.
Once the bundle worker has completed the task, view the audit entry and take note of the AWS ID that was used to register the new AMI.
To perform a compatibility test on the new private RightLink-enabled image that you just created, see Testing your Private RightLink-enabled Image.
In order to properly use the new RightScale-enabled image with ServerTemplates, you should create a MultiCloud Image (MCI) that references the new image. See Create a New MultiCloud Image. The MCI can then be added to any local (HEAD) ServerTemplates in your account. If you need to make that image available in a different AWS region, follow the Replicate an Image to different AWS regions.
Once you've created the MCI, you will need to add the following tag to the MCI so that RightScale will be able to identify the created image as a RightLink-enabled image:
provides:rs_agent_type=right_link
Congratulations! You now have an MCI that points to a RightLink-enabled image for launching SUSE instances. Just like any other instance that's launched using one of our v5 RightImages (which are RightLink-enabled), you will be able to see monitoring graphs and execute scripts inside the Dashboard.