Merge "xenapi: devstack support for raw tgz image upload"

This commit is contained in:
Jenkins
2013-08-29 02:17:23 +00:00
committed by Gerrit Code Review
2 changed files with 21 additions and 1 deletions

@ -1260,7 +1260,7 @@ function upload_image() {
return
fi
# XenServer-ovf-format images are provided as .vhd.tgz as well
# XenServer-vhd-ovf-format images are provided as .vhd.tgz
# and should not be decompressed prior to loading
if [[ "$image_url" =~ '.vhd.tgz' ]]; then
IMAGE="$FILES/${IMAGE_FNAME}"
@ -1269,6 +1269,22 @@ function upload_image() {
return
fi
# .xen-raw.tgz suggests a Xen capable raw image inside a tgz.
# and should not be decompressed prior to loading.
# Setting metadata, so PV mode is used.
if [[ "$image_url" =~ '.xen-raw.tgz' ]]; then
IMAGE="$FILES/${IMAGE_FNAME}"
IMAGE_NAME="${IMAGE_FNAME%.xen-raw.tgz}"
glance \
--os-auth-token $token \
--os-image-url http://$GLANCE_HOSTPORT \
image-create \
--name "$IMAGE_NAME" --is-public=True \
--container-format=tgz --disk-format=raw \
--property vm_mode=xen < "${IMAGE}"
return
fi
KERNEL=""
RAMDISK=""
DISK_FORMAT=""