1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

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

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

This reverts commit 8ca5a4b7b422901ec1a84643eaf5bb7e87a73fa5.
This reverts commit 01f784690491576748a5dfa5ecf7cec8dea634ea.
This commit is contained in:
Ruben S. Montero 2018-09-07 10:59:30 +02:00
parent c45d290c97
commit a3ac445f7e
2 changed files with 1 additions and 47 deletions

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

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}"