Support decompressing bz2 image
CoreOS cloud image is compressed with bz2 extension [1]. In such case, we need to decompress the image before uploading it to glance. [1] https://coreos.com/os/docs/latest/booting-on-openstack.html Change-Id: I705d0813d180aefaa2507c00d1ae40af07d12fcf
This commit is contained in:
parent
251b870e85
commit
3feceb0e4a
@ -295,6 +295,12 @@ function upload_image {
|
||||
container_format=bare
|
||||
unpack=zcat
|
||||
;;
|
||||
*.img.bz2)
|
||||
image_name=$(basename "$image" ".img.bz2")
|
||||
disk_format=qcow2
|
||||
container_format=bare
|
||||
unpack=bunzip2
|
||||
;;
|
||||
*.qcow2)
|
||||
image_name=$(basename "$image" ".qcow2")
|
||||
disk_format=qcow2
|
||||
@ -328,6 +334,8 @@ function upload_image {
|
||||
if [ "$container_format" = "bare" ]; then
|
||||
if [ "$unpack" = "zcat" ]; then
|
||||
openstack --os-cloud=devstack-admin --os-region-name="$REGION_NAME" image create "$image_name" $img_property --public --container-format=$container_format --disk-format $disk_format < <(zcat --force "${image}")
|
||||
elif [ "$unpack" = "bunzip2" ]; then
|
||||
openstack --os-cloud=devstack-admin --os-region-name="$REGION_NAME" image create "$image_name" $img_property --public --container-format=$container_format --disk-format $disk_format < <(bunzip2 -cdk "${image}")
|
||||
else
|
||||
openstack --os-cloud=devstack-admin --os-region-name="$REGION_NAME" image create "$image_name" $img_property --public --container-format=$container_format --disk-format $disk_format < "${image}"
|
||||
fi
|
||||
|
Loading…
Reference in New Issue
Block a user