To simplify the custom image creation process, Rackspace released boot.rackspace.com, a collection of iPXE scripts that allows you to rapidly network boot Operating Systems, Utilities and other tools very easily. It’s especially useful for remote access environments when you don’t want to utilize remote attached CD’s in a Dell DRAC, HP iLO or some other type of remote tool. It’s especially awesome for bootstrapping your own custom installation on a Cloud Server!
In this post, I walk you through each of the steps required to get you up & running a custom version of Ubuntu 12.04 via boot.rackspace.com.
Versions of the Ubuntu operating system newer than 12.04 have not been thoroughly tested with this tutorial. Therefore, I recommend that you too use Ubuntu 12.04.
This command boots a Cloud Server with a small 1 MB iPXE based ISO. In turn, it sets up the server’s assigned networking within the virtual BIOS and netboots into a menu of operating system options hosted over HTTP on boot.rackspace.com. (Note: Example image ID updated on 9/14/2018.)
nova boot --image=7c526505-bc72-4e3c-8d9a-e700c0acf299 --flavor=performance1-2 my_ubuntu_1204
In addition to custom modifications, make sure to do the following:
Once the installation is complete, the VM reboots and the console disconnects. Reconnect to the console, but this time, select to boot from the Local HDD because we’ve already installed the OS and because iPXE by default does a netboot.
To configure the instance, you must first get to the prompt. You can do this via the console from the browser or by SSH’ing into the VM (SSH may be easier to work with).
Run the following command to install curl:
sudo apt-get update && sudo apt-get install curl -y
Now proceed to install XenServer Tools and the Nova Agent.
curl -skS -L http://git.io/nUeUrA | sudo bash
curl -skS -L http://git.io/_tdvZw | sudo bash
(cat | sudo tee /etc/network/interfaces) << EOF auto lo iface lo inet loopback EOF
This is the opportunity to install, configure, and set up any custom system level modifications that you want to persist for future instances of the image.
Typically, you should remove the following before taking the snapshot to have a clean, pristine image:
In the Server Details, select Create Image to snapshot the image as-is and
give it a name, such as
Set vm_mode to:
xenfor a Paravirtualized (PV) Instance. For most Linux VMs, PV is typically the best option.
hvmfor HVM Mode, typically used for FreeBSD, Linux PVHVM and Windows. When using with Linux, make sure you’re using one of the newer 3.x kernels for the best experience.
If using Nova Agent:
If using Cloud-Init exclusively, the Agent isn’t needed, so make sure to disable it so that the build isn’t actively polling for responses from the Nova Agent:
nova image-meta my_ubuntu_1204 set vm_mode=xen nova image-meta my_ubuntu_1204 set xenapi_use_agent=true
nova boot --image="my_ubuntu_1204" --flavor=performance1-2 my_ubuntu_1204_test
Mike Metral is a Solution Architect at Rackspace in the Private Cloud Product organization. Mike joined Rackspace in 2012 with the intent of helping OpenStack become the open standard for cloud management. At Rackspace, Mike has led the integration effort with strategic partner RightScale; aided in the assessment, development, and evolution of Rackspace Private Cloud; as well as served as the Chief Architect of the Service Provider Program. Prior to joining Rackspace, Mike held senior technical roles at Sandia National Laboratories performing research and development in Cyber Security with regards to distributed systems, cloud and mobile computing. You can follow Mike on Twitter @mikemetral and Github as metral