Ubuntu provides versatile cloud images that can be utilized on various cloud deployment infrastructures. Eucalyptus’s euca2ools eustore tool makes it easier for cloud administrator’s to bundle, upload and register images on Eucalyptus clouds. Using eustore-install-image with Ubuntu Cloud images provides the best of both worlds – solid cloud images that can be easily deployed to any Eucalyptus cloud environment.
Set Up Euca2ools Configuration File
Setting up a euca2ools configuration file makes it easier and more efficient to interact with the euca2ools commands. For this blog entry, the euca2ools configuration file ~/.euca/euca2ools.ini was set up with the following information:
[global] default-region = LayinDaSmackDown [user admin] key-id = L4836KVYWMJCXT4T6Q6B9 secret-key = XCJ6sZVFVfFMR4DNVIUL7N7e4cgk8ebvEW0ej5dZ account-id = 441445882805 private-key = /home/hspencer/admin-creds/euca2-admin-c9e4580c-pk.pem certificate = /home/hspencer/admin-creds/euca2-admin-c9e4580c-cert.pem [region LayinDaSmackDown] autoscaling-url = http://10.104.1.216:8773/services/AutoScaling ec2-url = http://10.104.1.216:8773/services/Eucalyptus elasticloadbalancing-url = http://10.104.1.216:8773/services/LoadBalancing iam-url = http://10.104.1.216:8773/services/Euare monitoring-url = http://10.104.1.216:8773/services/CloudWatch s3-url = http://10.104.1.216:8773/services/Walrus eustore-url =http://emis.eucalyptus.com/ certificate = /home/hspencer/admin-creds/cloud-cert.pem
After setting up the euca2ools confirmation file, to utilize this file, run any euca2ools command with the –region option. For example:
$ euca-describe-images --region admin@
Since kernel, ramdisk and root filesystem images will be bundled, uploaded and registered, the cloud administrator’s credentials were used in the euca2ools configuration file. For more information about kernel and ramdisk management in Eucalyptus, check out the KB article entitled “Kernel and Ramdisk Management in Eucalyptus”.
Ubuntu Cloud Images
To obtain Ubuntu Cloud images that will be bundled, uploaded and registered with eustore-install-image, download the supported Ubuntu Cloud image release of your choice from the Ubuntu Cloud Images page. Download the file thats ends with either amd64.tar.gz or i386.tar.gz using either curl, wget or any other network transfer tool.
For example, to download the latest Ubuntu 13.10 Saucy Salamander Cloud image, run the following command:
$ wget http://cloud-images.ubuntu.com/saucy/current/saucy-server-cloudimg-amd64.tar.gz
This will download and save the saucy-server-cloudimg-amd64.tar.gz file. Now its time to use eustore-install-image to bundle, upload and register the image.
Bundle, Upload, Register The Image
As mentioned earlier, eustore-install-image will bundle, upload and register the image. To do this, use the –tarball option of eustore-install-image with the tar-gzipped file downloaded from Ubuntu Cloud Image page. The key flag here is the –hypervisor option. Because Ubuntu Cloud images are crafted to work on multiple hypervisors (e.g. Xen, KVM, VMware, etc.), set the –hypervisor option to “universal”. Here is an example of using these options:
$ eustore-install-image -t saucy-server-cloudimg-amd64.tar.gz -b ubuntu-saucy-server-amd64 --hypervisor universal -s "Ubuntu 13.10 - Saucy Salamander" -p ubuntu-saucy --region admin@ -a x86_64 Preparing to extract image... Extracting kernel 100% |=========================================================================================| 5.34 MB 158.76 MB/s Time: 0:00:00 Bundling kernel 100% |=========================================================================================| 5.34 MB 27.39 MB/s Time: 0:00:00 -- Uploading kernel image -- saucy-server-cloudimg-amd64-vmlinuz-generic.part.0 100% |=========================================================| 5.28 MB 20.91 MB/s Time: 0:00:00 saucy-server-cloudimg-amd64-vmlinuz-generic.manifest.xml 100% |===================================================| 3.45 kB 26.26 kB/s Time: 0:00:00 Registered kernel image eki-2C54378B Extracting ramdisk 100% |=========================================================================================| 89.56 kB 45.29 MB/s Time: 0:00:00 Bundling ramdisk 100% |=========================================================================================| 89.56 kB 8.31 MB/s Time: 0:00:00 -- Uploading ramdisk image -- saucy-server-cloudimg-amd64-loader.part.0 100% |==================================================================| 89.38 kB 689.09 kB/s Time: 0:00:00 saucy-server-cloudimg-amd64-loader.manifest.xml 100% |============================================================| 3.36 kB 26.03 kB/s Time: 0:00:00 Registered ramdisk image eri-015435B7 Extracting image 100% |=========================================================================================| 1.38 GB 183.45 MB/s Time: 0:00:08 Bundling image 100% |=========================================================================================| 1.38 GB 34.33 MB/s Time: 0:00:43 -- Uploading machine image -- saucy-server-cloudimg-amd64.img.part.0 ( 1/22) 100% |============================================================| 10.00 MB 42.72 MB/s Time: 0:00:00 saucy-server-cloudimg-amd64.img.part.1 ( 2/22) 100% |============================================================| 10.00 MB 41.06 MB/s Time: 0:00:00 saucy-server-cloudimg-amd64.img.part.2 ( 3/22) 100% |============================================================| 10.00 MB 42.43 MB/s Time: 0:00:00 saucy-server-cloudimg-amd64.img.part.3 ( 4/22) 100% |============================================================| 10.00 MB 44.56 MB/s Time: 0:00:00 saucy-server-cloudimg-amd64.img.part.4 ( 5/22) 100% |============================================================| 10.00 MB 48.43 MB/s Time: 0:00:00 saucy-server-cloudimg-amd64.img.part.5 ( 6/22) 100% |============================================================| 10.00 MB 57.00 MB/s Time: 0:00:00 saucy-server-cloudimg-amd64.img.part.6 ( 7/22) 100% |============================================================| 10.00 MB 48.69 MB/s Time: 0:00:00 saucy-server-cloudimg-amd64.img.part.7 ( 8/22) 100% |============================================================| 10.00 MB 51.00 MB/s Time: 0:00:00 saucy-server-cloudimg-amd64.img.part.8 ( 9/22) 100% |============================================================| 10.00 MB 43.92 MB/s Time: 0:00:00 saucy-server-cloudimg-amd64.img.part.9 (10/22) 100% |============================================================| 10.00 MB 46.26 MB/s Time: 0:00:00 saucy-server-cloudimg-amd64.img.part.10 (11/22) 100% |============================================================| 10.00 MB 46.27 MB/s Time: 0:00:00 saucy-server-cloudimg-amd64.img.part.11 (12/22) 100% |============================================================| 10.00 MB 48.74 MB/s Time: 0:00:00 saucy-server-cloudimg-amd64.img.part.12 (13/22) 100% |============================================================| 10.00 MB 44.48 MB/s Time: 0:00:00 saucy-server-cloudimg-amd64.img.part.13 (14/22) 100% |============================================================| 10.00 MB 44.20 MB/s Time: 0:00:00 saucy-server-cloudimg-amd64.img.part.14 (15/22) 100% |============================================================| 10.00 MB 48.89 MB/s Time: 0:00:00 saucy-server-cloudimg-amd64.img.part.15 (16/22) 100% |============================================================| 10.00 MB 46.45 MB/s Time: 0:00:00 saucy-server-cloudimg-amd64.img.part.16 (17/22) 100% |============================================================| 10.00 MB 56.84 MB/s Time: 0:00:00 saucy-server-cloudimg-amd64.img.part.17 (18/22) 100% |============================================================| 10.00 MB 53.62 MB/s Time: 0:00:00 saucy-server-cloudimg-amd64.img.part.18 (19/22) 100% |============================================================| 10.00 MB 56.75 MB/s Time: 0:00:00 saucy-server-cloudimg-amd64.img.part.19 (20/22) 100% |============================================================| 10.00 MB 48.67 MB/s Time: 0:00:00 saucy-server-cloudimg-amd64.img.part.20 (21/22) 100% |============================================================| 10.00 MB 44.25 MB/s Time: 0:00:00 saucy-server-cloudimg-amd64.img.part.21 (22/22) 100% |============================================================| 3.19 MB 18.21 MB/s Time: 0:00:00 saucy-server-cloudimg-amd64.img.manifest.xml 100% |===============================================================| 6.63 kB 41.32 kB/s Time: 0:00:00 Registered machine image emi-4EFE3A91 -- Done -- Installed new image emi-4EFE3A91
Now that the kernel, ramdisk and root filesystem are bundled, uploaded and registered, the launch permission of each image needs to be changed so that all the users of the Eucalyptus cloud can launch instances from these images.
$ euca-modify-image-attribute -l -a all emi-4EFE3A91 --region admin@ launchPermission emi-4EFE3A91 ADD Group all $ euca-modify-image-attribute -l -a all eri-015435B7 --region admin@ launchPermission eri-015435B7 ADD Group all $ euca-modify-image-attribute -l -a all eki-2C54378B --region admin@ launchPermission eki-2C54378B ADD Group all
Thats it! Now users can launch instances from the EMI, EKI and ERI as below:
$ euca-run-instances -k account1-user01 -t m1.medium emi-4EFE3A91 --region account1-user01@ --user-data-file cloud-init.config
Enjoy!
If you find yourself always using the same user for a given region, you can add a “user” option like “user = admin” to the region to make that region default to using that user unless you tell it otherwise.
Good point. The euca2ools configuration file makes it a lot easier to do hybrid cloud management. Thanks for the hard work on it.
[…] Ubuntu Cloud Images and Eustore: The Eucalyptus Cloud Administrator’s Image Management Dream […]