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

Revert "Migrate images to/from KVM / vCenter DS (#2382)"

This reverts commit 5415a70a1f.
This reverts commit 6dac970f2f.
This commit is contained in:
Ruben S. Montero committed 2018-09-07 11:01:37 +02:00
1 parent 38afa626ef
commit da81bb7701
2 files changed
+1 -47

No files matched your search

+1 -46
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:,convert:,nodecom -- "$@"`
TEMP=`getopt -o m:s:l:c:n -l md5:,sha1:,limit:,max-size:,nodecomp -- "$@"`
if [ $? != 0 ] ; then
echo "Arguments error" >&2
@@ -257,10 +257,6 @@ while true; do
export MAX_SIZE="$2"
shift 2
;;
--convert)
export CONVERT="$2"
shift 2
;;
--)
shift
break
@@ -397,44 +393,3 @@ fi
if [ "$TO" != "-" ]; then
unarchive "$TO"
fi
# Function to know what is the original image type
# Figure out what type of image it is
function get_original_type
{
command_get_type="qemu-img info "$TO""
output_get_type=$(eval "$command_get_type")
split=$(echo $output_get_type | tr ":" "\n")
count=0
format=""
for pal in $split
do
if [ "$count" == 4 ]; then
format=$pal
break
fi
count=$((count+1))
done
echo $format
}
# Convert the image to a given type into a tmp image with qemu-img
if [ ! -z "$CONVERT" ]; then
tmpimage=$TO".tmp"
original_type=$(get_original_type)
convert_type=$CONVERT
# 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
fi
-1
View File
@@ -92,7 +92,6 @@ if VCenterDriver::FileHelper.is_remote_or_needs_unpack?(img_path)
downsh_args << "--sha1 #{sha1} " if sha1 && !sha1.empty?
downsh_args << "--nodecomp " if nodecomp && !nodecomp.empty?
downsh_args << "--limit #{limit_bw} " if limit_bw && !limit_bw.empty?
downsh_args << "--convert vmdk"
downloader = "#{File.dirname(__FILE__)}/../downloader.sh #{downsh_args}"