Browse code

Upload XenServer style ovf directly to glance

Don't decompress images ending with .vhd.tgz, just send them
to glance

Fixes LP# 1117256

Change-Id: I201debc2e34808703c717276d192169b1ed24c05

Davanum Srinivas authored on 2013/02/07 05:29:49
Showing 1 changed files
... ...
@@ -923,6 +923,15 @@ function upload_image() {
923 923
         return
924 924
     fi
925 925
 
926
+    # XenServer-ovf-format images are provided as .vhd.tgz as well
927
+    # and should not be decompressed prior to loading
928
+    if [[ "$image_url" =~ '.vhd.tgz' ]]; then
929
+        IMAGE="$FILES/${IMAGE_FNAME}"
930
+        IMAGE_NAME="${IMAGE_FNAME%.vhd.tgz}"
931
+        glance --os-auth-token $token --os-image-url http://$GLANCE_HOSTPORT image-create --name "$IMAGE_NAME" --is-public=True --container-format=ovf --disk-format=vhd < "${IMAGE}"
932
+        return
933
+    fi
934
+
926 935
     KERNEL=""
927 936
     RAMDISK=""
928 937
     DISK_FORMAT=""