| ... | ... |
@@ -1260,7 +1260,7 @@ function upload_image() {
|
| 1260 | 1260 |
return |
| 1261 | 1261 |
fi |
| 1262 | 1262 |
|
| 1263 |
- # XenServer-ovf-format images are provided as .vhd.tgz as well |
|
| 1263 |
+ # XenServer-vhd-ovf-format images are provided as .vhd.tgz |
|
| 1264 | 1264 |
# and should not be decompressed prior to loading |
| 1265 | 1265 |
if [[ "$image_url" =~ '.vhd.tgz' ]]; then |
| 1266 | 1266 |
IMAGE="$FILES/${IMAGE_FNAME}"
|
| ... | ... |
@@ -1269,6 +1269,22 @@ function upload_image() {
|
| 1269 | 1269 |
return |
| 1270 | 1270 |
fi |
| 1271 | 1271 |
|
| 1272 |
+ # .xen-raw.tgz suggests a Xen capable raw image inside a tgz. |
|
| 1273 |
+ # and should not be decompressed prior to loading. |
|
| 1274 |
+ # Setting metadata, so PV mode is used. |
|
| 1275 |
+ if [[ "$image_url" =~ '.xen-raw.tgz' ]]; then |
|
| 1276 |
+ IMAGE="$FILES/${IMAGE_FNAME}"
|
|
| 1277 |
+ IMAGE_NAME="${IMAGE_FNAME%.xen-raw.tgz}"
|
|
| 1278 |
+ glance \ |
|
| 1279 |
+ --os-auth-token $token \ |
|
| 1280 |
+ --os-image-url http://$GLANCE_HOSTPORT \ |
|
| 1281 |
+ image-create \ |
|
| 1282 |
+ --name "$IMAGE_NAME" --is-public=True \ |
|
| 1283 |
+ --container-format=tgz --disk-format=raw \ |
|
| 1284 |
+ --property vm_mode=xen < "${IMAGE}"
|
|
| 1285 |
+ return |
|
| 1286 |
+ fi |
|
| 1287 |
+ |
|
| 1272 | 1288 |
KERNEL="" |
| 1273 | 1289 |
RAMDISK="" |
| 1274 | 1290 |
DISK_FORMAT="" |
| ... | ... |
@@ -108,6 +108,10 @@ function configure_glance() {
|
| 108 | 108 |
fi |
| 109 | 109 |
iniset_rpc_backend glance $GLANCE_API_CONF DEFAULT |
| 110 | 110 |
iniset $GLANCE_API_CONF keystone_authtoken signing_dir $GLANCE_AUTH_CACHE_DIR/api |
| 111 |
+ if [ "$VIRT_DRIVER" = 'xenserver' ]; then |
|
| 112 |
+ iniset $GLANCE_API_CONF DEFAULT container_formats "ami,ari,aki,bare,ovf,tgz" |
|
| 113 |
+ iniset $GLANCE_API_CONF DEFAULT disk_formats "ami,ari,aki,vhd,raw,iso" |
|
| 114 |
+ fi |
|
| 111 | 115 |
|
| 112 | 116 |
# Store the images in swift if enabled. |
| 113 | 117 |
if is_service_enabled s-proxy; then |