Browse code

Add support for vmdk files as glance images

* Adds support for vmdk files as glance images in upload_image function
* Set default image url to use for vsphere driver in stackrc
* Now using a more stable url

Change-Id: If6d45bc8dfd3c812ded5e1bcf69ad7ebd9b64f34

Sreeram Yerrapragada authored on 2013/07/25 11:49:23
Showing 2 changed files
... ...
@@ -1219,6 +1219,14 @@ function upload_image() {
1219 1219
         return
1220 1220
     fi
1221 1221
 
1222
+    # vmdk format images
1223
+    if [[ "$image_url" =~ '.vmdk' ]]; then
1224
+        IMAGE="$FILES/${IMAGE_FNAME}"
1225
+        IMAGE_NAME="${IMAGE_FNAME%.vmdk}"
1226
+        glance --os-auth-token $token --os-image-url http://$GLANCE_HOSTPORT image-create --name "$IMAGE_NAME" --is-public=True --container-format bare --disk-format vmdk --property vmware-disktype="preallocated" < "${IMAGE}"
1227
+        return
1228
+    fi
1229
+
1222 1230
     # XenServer-ovf-format images are provided as .vhd.tgz as well
1223 1231
     # and should not be decompressed prior to loading
1224 1232
     if [[ "$image_url" =~ '.vhd.tgz' ]]; then
... ...
@@ -240,7 +240,8 @@ case "$VIRT_DRIVER" in
240 240
         esac
241 241
         ;;
242 242
     vsphere)
243
-        IMAGE_URLS="";;
243
+        DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-debian-2.6.32-i686}
244
+        IMAGE_URLS=${IMAGE_URLS:-"http://partnerweb.vmware.com/programs/vmdkimage/debian-2.6.32-i686.vmdk"};;
244 245
     *) # Default to Cirros with kernel, ramdisk and disk image
245 246
         DEFAULT_IMAGE_NAME=${DEFAULT_IMAGE_NAME:-cirros-0.3.1-x86_64-uec}
246 247
         IMAGE_URLS=${IMAGE_URLS:-"http://download.cirros-cloud.net/0.3.1/cirros-0.3.1-x86_64-uec.tar.gz"};;