From f1a2dbffe8ba369b0a8a125e975864a5d88f3e87 Mon Sep 17 00:00:00 2001 From: Bob Ball Date: Wed, 19 Mar 2014 11:08:54 +0000 Subject: [PATCH] XenAPI: Cirros images must always boot as PV. The default for VHD disk-types is PV, which is why booting from a server works. However, creating a volume from the image needs to pass this parameter on to the volume. Note that Id673158442fde27e8d468ca412c9bd557a886e6b is also required to fix bug 1294069 Change-Id: I7ea1d85d6082787ac4551f78300a04bf59074261 Partial-Bug: 1294069 --- functions | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/functions b/functions index 17c6e77e3d..80f98adfb2 100644 --- a/functions +++ b/functions @@ -199,7 +199,21 @@ function upload_image { # and should not be decompressed prior to loading if [[ "$image_url" =~ '.vhd.tgz' ]]; then IMAGE_NAME="${IMAGE_FNAME%.vhd.tgz}" - 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}" + FORCE_VM_MODE="" + if [[ "$IMAGE_NAME" =~ 'cirros' ]]; then + # Cirros VHD image currently only boots in PV mode. + # Nova defaults to PV for all VHD images, but + # the glance setting is needed for booting + # directly from volume. + FORCE_VM_MODE="--property vm_mode=xen" + fi + 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 \ + $FORCE_VM_MODE < "${IMAGE}" return fi