Browse code

Merge "XenAPI: Cirros images must always boot as PV."

Jenkins authored on 2014/03/25 02:17:35
Showing 1 changed files
... ...
@@ -199,7 +199,21 @@ function upload_image {
199 199
     # and should not be decompressed prior to loading
200 200
     if [[ "$image_url" =~ '.vhd.tgz' ]]; then
201 201
         IMAGE_NAME="${IMAGE_FNAME%.vhd.tgz}"
202
-        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}"
202
+        FORCE_VM_MODE=""
203
+        if [[ "$IMAGE_NAME" =~ 'cirros' ]]; then
204
+            # Cirros VHD image currently only boots in PV mode.
205
+            # Nova defaults to PV for all VHD images, but
206
+            # the glance setting is needed for booting
207
+            # directly from volume.
208
+            FORCE_VM_MODE="--property vm_mode=xen"
209
+        fi
210
+        glance \
211
+            --os-auth-token $token \
212
+            --os-image-url http://$GLANCE_HOSTPORT \
213
+            image-create \
214
+            --name "$IMAGE_NAME" --is-public=True \
215
+            --container-format=ovf --disk-format=vhd \
216
+            $FORCE_VM_MODE < "${IMAGE}"
203 217
         return
204 218
     fi
205 219