Make it possible to upload ploop images

Add support of ploop images (*.hds extension) for both exe and hvm types.
In devstack we assume that images have '-exe' and '-hvm' suffixes in
their names correspondently.

Change-Id: I1c074876c530be0535a6e02e764d67a4ebcbbbe5
This commit is contained in:
Maxim Nestratov 2015-07-15 11:47:11 +03:00
parent 32a3e322b4
commit 54ee8a82a8

View File

@ -219,6 +219,23 @@ function upload_image {
return
fi
if [[ "$image_url" =~ '.hds' ]]; then
image_name="${image_fname%.hds}"
vm_mode=${image_name##*-}
if [[ $vm_mode != 'exe' && $vm_mode != 'hvm' ]]; then
die $LINENO "Unknown vm_mode=${vm_mode} for Virtuozzo image"
fi
openstack \
--os-token $token \
--os-url $GLANCE_SERVICE_PROTOCOL://$GLANCE_HOSTPORT \
image create \
"$image_name" --public \
--container-format=bare --disk-format=ploop \
--property vm_mode=$vm_mode < "${image}"
return
fi
local kernel=""
local ramdisk=""
local disk_format=""