Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 27 lines (19 sloc) 869 Bytes
#!/bin/bash
# Import Settings
. settings
echo "Use glance-upload-loader.sh followed by glance-upload-lucid-loader.sh instead"
exit 1
if [ ! -f "lucid-server-cloudimg-amd64.tar.gz" ] ; then
echo "Downloading image"
wget http://cloud-images.ubuntu.com/lucid/current/lucid-server-cloudimg-amd64.tar.gz
fi
if [ ! -f "lucid-server-cloudimg-amd64.img" ] ; then
echo "Extracting image"
tar xfzv lucid-server-cloudimg-amd64.tar.gz
fi
TOKEN=`./obtain-token.sh`
echo "Uploading kernel"
RVAL=`glance -A $TOKEN 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 -A $TOKEN add name="ubuntu-lucid" is_public=true container_format=ami kernel_id=$KERNEL_ID disk_format=ami < lucid-server-cloudimg-amd64.img