Wednesday, June 27, 2012

Openstack Glance 导入ubuntu 10.04 Image


if [ ! -f "lucid-server-cloudimg-amd64.tar.gz" ] ; then
echo "Downloading image"

if [ ! -f "lucid-server-cloudimg-amd64.img" ] ; then
echo "Extracting image"
tar xfzv lucid-server-cloudimg-amd64.tar.gz

echo "Uploading kernel"
RVAL=`glance add name="ubuntu-lucid-kernel" is_public=true container_format=aki disk_format=aki < lucid-server-cloudimg-amd64-vmlinuz-virtual`
KERNEL_ID=`echo $RVAL | cut -d":" -f2 | tr -d " "`

echo "Uploading image"
glance add name="ubuntu-lucid" is_public=true container_format=ami kernel_id=$KERNEL_ID disk_format=ami < lucid-server-cloudimg-amd64.img

1 comment:

  1. Thanks for your own effort on this blog. My niece loves conducting investigations and it's really obvious why. A lot of people notice all concerning the compelling method you provide rewarding guidance via the web site and as well as recommend participation from website visitors on that article so our princess has always been understanding a lot. Enjoy the remaining portion of the year. You are always performing a tremendous job.