Boot a non-RightScale enabled OEL instance, perform some manual configuration, install the RightLink package, and re-bundle the instance into a new, RightScale-enabled AMI. Optionally, test compatibility before bundling, and create an MCI (MultiCloud Image) for your new image.
Important!
NOTE: Although the steps provided below for bundling an instance may still be valid in some scenarios, we encourage you to explore using the the Instance Provisioner for bundling and RightLink-enabling an existing instance. See Create New Instance with the Instance Provisioner for additional information.
Currently, RightScale does not officially support OEL. However, you can install RightLink on an OEL instance by hand-editing some configuration files, then installing the CentOS package.
OEL images are available publicly in the Amazon EC2 cloud. You may also have an OEL image in another public or private cloud that needs to be RightScale-enabled.
In the RightScale Dashboard, navigate to the appropriate cloud in the menu (e.g., Clouds > cloud name > Instances > New) and launch a new instance with the image you would like to RightLink-enable.
Once the instance or server becomes operational, click on the SSH Console button in the RightScale Dashboard.
Note: All commands issued in an SSH console from this point forward assume you are using the 'root' user.
The following is only required for non-interactive installs. If /etc/rightscale.d/cloud is not set, the user is prompted to select the cloud interactively upon install of the rightscale package.
Run the following command to set the cloud type (example uses Amazon EC2):
# supported clouds: ec2,rackspace,vmops cloud=ec2 mkdir -p /etc/rightscale.d && echo -n "$cloud" > /etc/rightscale.d/cloud
This file is used by the RightLink agent to recognize which cloud type the instance is running in.
For CloudStack use vmops.
The Extra Packages for Enterprise Linux (EPEL) project provides thousands of prebuilt RPMs for supplemental packages that are built and maintained by the Fedora open-source community. The RightLink RPM depends on some of these packages as prerequisites and cannot be installed unless EPEL is available to satisfy the dependencies.
You can EPEL-enable your system by installing the EPEL repository package. The repository package configures your system's YUM or up2date system to use EPEL's repositories. You can then install packages with your usual method, and the EPEL repository will be included and used to satisfy any dependencies.
rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Install the RPM package dependencies manually as needed:
yum -y install git curl bash
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:
sudo cat >/etc/yum.repos.d/RightScale-epel.repo<<-EOF [rightscale-epel] name=RightScale Software baseurl=http://cf-mirror.rightscale.com/rightscale_software/epel/6/x86_64/archive/latest/ gpgcheck=1 enabled=1 gpgkey=http://s3.amazonaws.com/rightscale_key_pub/rightscale_key.pub EOF
Then, install the package:
yum install rightimage-extras -y
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 one of the "latest" directories, 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 appropriate RPM package. You can copy and paste the link from your browser if desired.
The following script downloads and installs the latest x86_64 CentOS RPM package from the mirror:
#!/bin/bash arch=x86_64 rpms=$(curl -s http://mirror.rightscale.com/rightscale_rightlink/latest/centos/ | perl -0ne 'print "$1\n" while (/<a\s*href\s*=\s*\"(.*?)\">.*?<\/a>/igs)' | grep .rpm | grep "$arch") && rpm=$(grep "$arch" <<<"$rpms") && \ echo Installing "$rpm". && rpm -iv http://mirror.rightscale.com/rightscale_rightlink/latest/centos/"$rpm" || echo 'RightLink installation failed!'
Alternatively, install a specific version from the mirror (only recommended if a specific reason to not use the latest exists).
The following installs RightLink 5.8.8.
64-bit instance:
rpm -iv http://mirror.rightscale.com/rightscale_rightlink/latest/centos/rightscale_5.8.8-centos_5.8-x86_64.rpm
Your instance must have a working install of EC2 AMI Tools in the path of the root user for this procedure to succeed. The installation of the EC2 AMI tools requires ruby. To install ruby, run this command:
yum install ruby
After ruby has been installed, you can download the EC2 AMI tools from here:
http://aws.amazon.com/developertools/368
Download the rpm to the instance. Once the rpm is on the instance, run this command in the directory in which the rpm resides:
rpm -Uvh ec2-ami-tools.noarch.rpm
Note: The RightScale BundleWorker requires the SFTP subsystem to be enabled on your instance. This is disabled in many of the OEL images.
You can usually re-enable with:
sed -i s/#Subsystem/Subsystem/g /etc/ssh/sshd_config && service sshd restart
Also, ensure that the your instance has Rsync installed which is a requirement of the bundler worker:
yum -y install rsync
You may also need to mount an ephemeral disk to the instance if this is not included in the fstab of the OEL image being used (commonly the case).
To ensure the first ephemeral device is mounted to /mnt
, use the following:
#!/bin/bash ephemeral0=/dev/"$(curl -s http://169.254.169.254/2009-04-04/meta-data/block-device-mapping/ephemeral0)" mkdir -pv /mnt; mount | grep "$ephemeral0" || mount "$ephemeral0" /mnt
Please note, t1.micro instances do not include ephemeral storage. You can still bundle on this instance type by using an attached EBS volume instead.
Before bundling, check that /mnt
has enough free space for the bundle (at least 10GB):
df -h | grep /mnt
Now that these prerequisite steps have been performed, you are ready to create the AMI. 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 OEL 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.
© 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.