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 will walk you through each of the steps required to get you up & running a custom version of Ubuntu 12.04 via boot.rackspace.com.
1. Boot the boot.rackspace.com ISO
This command will boot a Cloud Server with a small 1 MB iPXE based ISO. In turn, it will set up the server’s assigned networking within the virtual BIOS and netboot into a menu of operating system options hosted over HTTP on boot.rackspace.com.
nova boot --image=9aa0d346-c06f-4652-bbb1-4342a7d2d017 --flavor=performance1-2 my_ubuntu_1204
2. Connect to the boot.rackspace.com VM via the Console
2. Select Linux Operating Systems from the Boot Menu
3. Select Ubuntu from the list of Distros
4. Select 12.04 from the list of Versions
5. Select ubuntu install from the the Boot Paramaters
6. Proceed through the install & setup accordingly
7. Reboot from local hdd
Once the installation is complete, the VM will reboot and the console will disconnect. Reconnect to the console, but this time, select to boot from the Local HDD as we've already installed the OS and because iPXE by default does a netboot.
8. Instance configuration required by Rackspace
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)
sudo apt-get update && sudo apt-get install curl -y
Now proceed to install XenServer Tools & 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
9. Make custom OS modifications
This is the opportunity to install, configure and set up any custom system level modifications you want to persist for future instances of the image
10. Once modifications are complete, cleanup your image
11. After modifications and cleanup is done, snapshot your image
In the Server Details, select 'Create Image' to snapshot the image as-is and give it a name, i.e. 'myubuntu1204'
12. Set metadata for the image
Set vm_mode to:
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
13. After snapshotting, its time to boot your custom image
nova boot --image="my_ubuntu_1204" --flavor=performance1-2 my_ubuntu_1204_test
14. Log in to the VM via console and/or SSH & enjoy your new custom image :)
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