1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-16 22:50:10 +03:00

F #2320 Migrate images to/from KVM / vCenter DS (#2396)

* F #2320 Migrate images to/from KVM / vCenter DS

* Update downloader.sh

* Update downloader.sh

(cherry picked from commit 8ca5a4b7b422901ec1a84643eaf5bb7e87a73fa5)
This commit is contained in:
Jose Angel Garrido Montoya 2018-09-06 12:04:36 +02:00 committed by Tino Vazquez
parent e50033d173
commit 5415a70a1f

View File

@ -224,7 +224,7 @@ function get_rbd_cmd
echo "ssh '$(esc_sq "$DST_HOST")' \"$RBD export '$(esc_sq "$SOURCE")' -\""
}
TEMP=`getopt -o m:s:l:c:n -l md5:,sha1:,limit:,max-size:,nodecomp -- "$@"`
TEMP=`getopt -o m:s:l:c:n -l md5:,sha1:,limit:,max-size:,convert:,nodecom -- "$@"`
if [ $? != 0 ] ; then
echo "Arguments error" >&2
@ -428,9 +428,13 @@ if [ ! -z "$CONVERT" ]; then
original_type=$(get_original_type)
convert_type=$CONVERT
convert="qemu-img convert -f "$original_type" -O "$convert_type" "$TO" "$tmpimage""
# if the type of the image differs from the target type we need to convert the image
if [ "$original_type" != "$convert_type" ]; then
convert="qemu-img convert -f "$original_type" -O "$convert_type" "$TO" "$tmpimage""
eval "$convert"
# Move tmp image to get the final image
mvcommand="mv "$tmpimage" "$TO""
eval "$mvcommand"
fi
# Move tmp image to get the final image
mvcommand="mv "$tmpimage" "$TO""
eval "$mvcommand"
fi
fi