diff --git a/doc/source/admin/building_guest_images.rst b/doc/source/admin/building_guest_images.rst index abac6bec38..b76dcd7146 100644 --- a/doc/source/admin/building_guest_images.rst +++ b/doc/source/admin/building_guest_images.rst @@ -141,7 +141,7 @@ The trove guest agent image could be created by running the following command: guest_os_release=xenial dev_mode=true guest_username=ubuntu - imagepath=$HOME/images/trove-${guest_os}-${guest_os_release}-${datastore_type} + imagepath=$HOME/images/trove-${guest_os}-${guest_os_release}-${datastore_type}.qcow2 * ``dev_mode=true`` is mainly for testing purpose for trove developers and it's necessary to build the image on the trove controller host, because the host @@ -165,6 +165,10 @@ The trove guest agent image could be created by running the following command: repository, by default it's master, use other branches as needed such as stable/train. +* The image type can be easily changed by specifying a different image file + extension, e.g. to build a raw image, you can specify + ``$your-image-name.raw`` as the ``imagepath`` parameter. + For example, in order to build a MySQL image for Ubuntu Xenial operating system in development mode: diff --git a/integration/scripts/functions_qemu b/integration/scripts/functions_qemu index f43078d9a1..ccc4e7951e 100644 --- a/integration/scripts/functions_qemu +++ b/integration/scripts/functions_qemu @@ -13,13 +13,14 @@ function build_vm() { local dev_mode=$4 local guest_username=$5 local image_output=$6 + local image_type=${image_output##*.} + local working_dir=$(dirname ${image_output}) local elementes="base vm" local trove_elements_path=${PATH_TROVE}/integration/scripts/files/elements local GUEST_IMAGETYPE=${GUEST_IMAGETYPE:-"qcow2"} local GUEST_IMAGESIZE=${GUEST_IMAGESIZE:-4} local GUEST_CACHEDIR=${GUEST_CACHEDIR:-"$HOME/.cache/image-create"} - local working_dir=$(dirname ${image_output}) export GUEST_USERNAME=${guest_username} @@ -79,6 +80,7 @@ function build_vm() { disk-image-create -x \ -a amd64 \ -o ${image_output} \ + -t ${image_type} \ -t ${GUEST_IMAGETYPE} \ --image-size ${GUEST_IMAGESIZE} \ --image-cache ${GUEST_CACHEDIR} \ diff --git a/integration/scripts/trovestack b/integration/scripts/trovestack index 74f91fef0b..a6435cd15a 100755 --- a/integration/scripts/trovestack +++ b/integration/scripts/trovestack @@ -781,7 +781,7 @@ function cmd_build_image() { if [[ -z "$output" ]]; then image_name="trove-datastore-${IMAGE_GUEST_OS}-${IMAGE_GUEST_RELEASE}-${IMAGE_DATASTORE_TYPE}" image_folder=$HOME/images - output="${image_folder}/${image_name}" + output="${image_folder}/${image_name}.qcow2" fi # Always rebuild the image. sudo rm -f $output