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.
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.
NOTE: Although the steps provided below for bundling an instance may still be valid in some scenarios, we encourage you to explore using the Instance Provisioner to bundle an existing instance. See Create New Instance with the Instance Provisioner for additional information.
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).
Launch a new instance from the selected base AMI.
Once the instance becomes operational, click on the SSH Console button in the RightScale Dashboard.
Note: If you are running an Ubuntu 10.04 (lucid) or later, root is disabled for SSH by default, 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@<EC2_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 sudo test -e /etc/apt/sources.list.d/ubuntu-multiverse.list || touch /etc/apt/sources.list.d/ubuntu-multiverse.list sudo 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 sudo test -e /etc/apt/sources.list.d/ubuntu-multiverse.list || touch /etc/apt/sources.list.d/ubuntu-multiverse.list sudo cat <<EOF>>/etc/apt/sources.list.d/ubuntu-multiverse.list deb http://us.archive.ubuntu.com/ubuntu/ precise multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ precise multiverse deb http://us.archive.ubuntu.com/ubuntu/ precise-updates multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates multiverse EOF apt-get update && apt-get -y install ec2-ami-tools
There are a few dependencies to the RightLink package. Manually install the following packages (some of these will likely already be installed):
apt-get -y install libc6 debconf curl git-core
We also need to install the 'rightimage-extras' package, which is a meta package that lists other packages essential to ServerTemplate functionality. To install, configure a repository:
# Import RightScale public key curl http://s3.amazonaws.com/rightscale_key_pub/rightscale_key.pub | apt-key add cat > /etc/apt/sources.list.d/rightscale_extra.sources.list <<-EOF deb http://cf-mirror.rightscale.com/rightscale_software_ubuntu/latest precise main EOF
Then, update APT and install the package:
apt-get update apt-get install rightimage-extras -y
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.
Other values for the cloud type in this file are as follows:
Browse RightScale's mirror (http://mirror.rightscale.com/rightscale_rightlink/) for available 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-bit or 64-bit).
Install the desired RightLink package. This example downloads and installs the latest RightLink package for Ubuntu 12.04 on an x86_64 instance. It also removes the downloaded package upon a successful install. If you are using 10.04, locate the correct package from RightScale's mirrors.
cd /tmp && \ wget http://mirror.rightscale.com/rightlink/latest/ubuntu/rightscale_5.8.13-ubuntu_12.04-amd64.deb && \ dpkg -i rightscale_5.8.13-ubuntu_12.04-amd64.deb && \ rm -v rightscale_5.8.13-ubuntu_12.04-amd64.deb
This package has been known to work on other Ubuntu releases.
When prompted, enter the type of cloud for which the image is intended.
What type of cloud am I running on (ec2, rackspace, vmops)? ec2
Other values for the cloud type in this file are as follows:
$ dpkg -l rightscale
This should show you the package successfully installed.
Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Description +++-===========================-===========================-====================================================================== ii rightscale 5.8.13 RightLink instance agent. Allows computers to be managed by the RightS
The /var/log/syslog file will also show various Rightlink tools being successfully installed.
Jul 23 21:53:51 ip-10-197-32-201 RightScale: Installing public-tool wrappers to /usr/bin Jul 23 21:53:51 ip-10-197-32-201 RightScale: - rs_run_right_script Jul 23 21:53:51 ip-10-197-32-201 RightScale: - rs_run_recipe Jul 23 21:53:51 ip-10-197-32-201 RightScale: - rs_log_level Jul 23 21:53:51 ip-10-197-32-201 RightScale: - rs_reenroll Jul 23 21:53:51 ip-10-197-32-201 RightScale: - rs_tag Jul 23 21:53:51 ip-10-197-32-201 RightScale: - rs_thunk Jul 23 21:53:51 ip-10-197-32-201 RightScale: - rs_shutdown Jul 23 21:53:51 ip-10-197-32-201 RightScale: - rs_connect Jul 23 21:53:51 ip-10-197-32-201 RightScale: - rs_ohai Jul 23 21:53:51 ip-10-197-32-201 RightScale: Done.
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 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 guide.
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:
Congratulations! You now have an MCI that points to a RightLink-enabled image for launching Ubuntu based instances. Just like any other instance that is launched using one of our v5.x RightImages (which are RightLink-enabled by default), you will be able to see monitoring graphs and execute scripts for any server launched from this image inside the Dashboard.
© 2006-2014 RightScale, Inc. All rights reserved.
RightScale is a registered trademark of RightScale, Inc. All other products and services may be trademarks or servicemarks of their respective owners.