2020-07-28 07:17:48 +00:00
|
|
|
|
From d6e49b3cd141cdf573e1e4f59d248007f3658435 Mon Sep 17 00:00:00 2001
|
2019-08-01 12:44:12 +00:00
|
|
|
|
From: "Richard W.M. Jones" <rjones@redhat.com>
|
|
|
|
|
Date: Thu, 14 Jan 2016 11:53:42 -0500
|
|
|
|
|
Subject: [PATCH] RHEL 8: v2v: Disable the virt-v2v --in-place option.
|
|
|
|
|
|
|
|
|
|
This disables the virt-v2v --in-place option which we do not
|
|
|
|
|
wish to support in RHEL.
|
|
|
|
|
(See commit d0069559a939e47e5f29973ed9a69a13f0b58301).
|
|
|
|
|
---
|
|
|
|
|
v2v/Makefile.am | 2 -
|
|
|
|
|
v2v/cmdline.ml | 8 +--
|
|
|
|
|
v2v/test-v2v-docs.sh | 1 +
|
|
|
|
|
v2v/test-v2v-in-place.sh | 108 ---------------------------------------
|
2020-07-28 07:17:48 +00:00
|
|
|
|
v2v/virt-v2v.pod | 48 +----------------
|
|
|
|
|
5 files changed, 7 insertions(+), 160 deletions(-)
|
2019-08-01 12:44:12 +00:00
|
|
|
|
delete mode 100755 v2v/test-v2v-in-place.sh
|
|
|
|
|
|
|
|
|
|
diff --git a/v2v/Makefile.am b/v2v/Makefile.am
|
2020-07-28 07:17:48 +00:00
|
|
|
|
index 6568c9a6b..affa6f7e9 100644
|
2019-08-01 12:44:12 +00:00
|
|
|
|
--- a/v2v/Makefile.am
|
|
|
|
|
+++ b/v2v/Makefile.am
|
2020-07-28 07:17:48 +00:00
|
|
|
|
@@ -469,7 +469,6 @@ if HAVE_LIBVIRT
|
2019-08-01 12:44:12 +00:00
|
|
|
|
TESTS += \
|
|
|
|
|
test-v2v-cdrom.sh \
|
|
|
|
|
test-v2v-floppy.sh \
|
|
|
|
|
- test-v2v-in-place.sh \
|
2020-07-28 07:17:48 +00:00
|
|
|
|
test-v2v-mac.sh \
|
2019-08-01 12:44:12 +00:00
|
|
|
|
test-v2v-networks-and-bridges.sh \
|
|
|
|
|
test-v2v-no-copy.sh \
|
2020-07-28 07:17:48 +00:00
|
|
|
|
@@ -621,7 +620,6 @@ EXTRA_DIST += \
|
2019-08-01 12:44:12 +00:00
|
|
|
|
test-v2v-i-vmx-3.vmx \
|
|
|
|
|
test-v2v-i-vmx-4.vmx \
|
|
|
|
|
test-v2v-i-vmx-5.vmx \
|
|
|
|
|
- test-v2v-in-place.sh \
|
|
|
|
|
test-v2v-it-vddk-io-query.sh \
|
|
|
|
|
test-v2v-machine-readable.sh \
|
2020-07-28 07:17:48 +00:00
|
|
|
|
test-v2v-mac-expected.xml \
|
2019-08-01 12:44:12 +00:00
|
|
|
|
diff --git a/v2v/cmdline.ml b/v2v/cmdline.ml
|
2020-07-28 07:17:48 +00:00
|
|
|
|
index e3578ddcb..19c5a269b 100644
|
2019-08-01 12:44:12 +00:00
|
|
|
|
--- a/v2v/cmdline.ml
|
|
|
|
|
+++ b/v2v/cmdline.ml
|
2020-07-28 07:17:48 +00:00
|
|
|
|
@@ -230,8 +230,7 @@ let parse_cmdline () =
|
|
|
|
|
s_"Use password from file to connect to input hypervisor";
|
2019-08-01 12:44:12 +00:00
|
|
|
|
[ M"it" ], Getopt.String ("transport", set_string_option_once "-it" input_transport),
|
|
|
|
|
s_"Input transport";
|
|
|
|
|
- [ L"in-place" ], Getopt.Set in_place,
|
|
|
|
|
- s_"Only tune the guest in the input VM";
|
|
|
|
|
+ [ L"in-place" ], Getopt.Set in_place, Getopt.hidden_option_description;
|
2020-07-28 07:17:48 +00:00
|
|
|
|
[ L"mac" ], Getopt.String ("mac:network|bridge|ip:out", add_mac),
|
|
|
|
|
s_"Map NIC to network or bridge or assign static IP";
|
2019-08-01 12:44:12 +00:00
|
|
|
|
[ S 'n'; L"network" ], Getopt.String ("in:out", add_network),
|
2020-07-28 07:17:48 +00:00
|
|
|
|
@@ -369,7 +368,6 @@ read the man page virt-v2v(1).
|
|
|
|
|
pr "vddk\n";
|
|
|
|
|
pr "colours-option\n";
|
|
|
|
|
pr "vdsm-compat-option\n";
|
|
|
|
|
- pr "in-place\n";
|
|
|
|
|
pr "io/oo\n";
|
|
|
|
|
pr "mac-option\n";
|
|
|
|
|
pr "mac-ip-option\n";
|
|
|
|
|
@@ -544,6 +542,10 @@ read the man page virt-v2v(1).
|
2019-08-01 12:44:12 +00:00
|
|
|
|
error (f_"only ‘-it ssh’ can be used here") in
|
|
|
|
|
Input_vmx.input_vmx input_transport arg in
|
|
|
|
|
|
|
|
|
|
+ (* Prevent use of --in-place option in RHEL. *)
|
|
|
|
|
+ if in_place then
|
|
|
|
|
+ error (f_"--in-place cannot be used in RHEL");
|
|
|
|
|
+
|
|
|
|
|
(* Common error message. *)
|
|
|
|
|
let error_option_cannot_be_used_in_output_mode mode opt =
|
|
|
|
|
error (f_"-o %s: %s option cannot be used in this output mode") mode opt
|
|
|
|
|
diff --git a/v2v/test-v2v-docs.sh b/v2v/test-v2v-docs.sh
|
2020-07-28 07:17:48 +00:00
|
|
|
|
index dfb12bb14..2e45705a3 100755
|
2019-08-01 12:44:12 +00:00
|
|
|
|
--- a/v2v/test-v2v-docs.sh
|
|
|
|
|
+++ b/v2v/test-v2v-docs.sh
|
|
|
|
|
@@ -26,6 +26,7 @@ $top_srcdir/podcheck.pl virt-v2v.pod virt-v2v \
|
|
|
|
|
--debug-overlay,\
|
|
|
|
|
--ic,\
|
|
|
|
|
--if,\
|
|
|
|
|
+--in-place,\
|
|
|
|
|
--io,\
|
2020-07-28 07:17:48 +00:00
|
|
|
|
--ip,\
|
2019-08-01 12:44:12 +00:00
|
|
|
|
--it,\
|
|
|
|
|
diff --git a/v2v/test-v2v-in-place.sh b/v2v/test-v2v-in-place.sh
|
|
|
|
|
deleted file mode 100755
|
|
|
|
|
index 6f7d78f39..000000000
|
|
|
|
|
--- a/v2v/test-v2v-in-place.sh
|
|
|
|
|
+++ /dev/null
|
|
|
|
|
@@ -1,108 +0,0 @@
|
|
|
|
|
-#!/bin/bash -
|
|
|
|
|
-# libguestfs virt-v2v test script
|
|
|
|
|
-# Copyright (C) 2014 Red Hat Inc.
|
|
|
|
|
-# Copyright (C) 2015 Parallels IP Holdings GmbH.
|
|
|
|
|
-#
|
|
|
|
|
-# This program is free software; you can redistribute it and/or modify
|
|
|
|
|
-# it under the terms of the GNU General Public License as published by
|
|
|
|
|
-# the Free Software Foundation; either version 2 of the License, or
|
|
|
|
|
-# (at your option) any later version.
|
|
|
|
|
-#
|
|
|
|
|
-# This program is distributed in the hope that it will be useful,
|
|
|
|
|
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
-# GNU General Public License for more details.
|
|
|
|
|
-#
|
|
|
|
|
-# You should have received a copy of the GNU General Public License
|
|
|
|
|
-# along with this program; if not, write to the Free Software
|
|
|
|
|
-# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
|
|
|
-
|
|
|
|
|
-# Test --in-place.
|
|
|
|
|
-
|
|
|
|
|
-unset CDPATH
|
|
|
|
|
-export LANG=C
|
|
|
|
|
-set -e
|
|
|
|
|
-
|
|
|
|
|
-$TEST_FUNCTIONS
|
|
|
|
|
-skip_if_skipped
|
|
|
|
|
-skip_if_backend uml
|
|
|
|
|
-skip_unless_phony_guest windows.img
|
|
|
|
|
-
|
|
|
|
|
-img_base="$abs_top_builddir/test-data/phony-guests/windows.img"
|
|
|
|
|
-
|
|
|
|
|
-export VIRT_TOOLS_DATA_DIR="$top_srcdir/test-data/fake-virt-tools"
|
|
|
|
|
-export VIRTIO_WIN="$top_srcdir/test-data/fake-virtio-win"
|
|
|
|
|
-
|
|
|
|
|
-d=$PWD/test-v2v-in-place.d
|
|
|
|
|
-rm -rf $d
|
|
|
|
|
-mkdir $d
|
|
|
|
|
-
|
|
|
|
|
-img="$d/test.qcow2"
|
|
|
|
|
-rm -f $img
|
|
|
|
|
-qemu-img create -f qcow2 -b $img_base -o compat=1.1,backing_fmt=raw $img
|
|
|
|
|
-md5="$(do_md5 $img_base)"
|
|
|
|
|
-
|
|
|
|
|
-libvirt_xml="$d/test.xml"
|
|
|
|
|
-rm -f $libvirt_xml
|
|
|
|
|
-n=windows-overlay
|
|
|
|
|
-cat > $libvirt_xml <<EOF
|
|
|
|
|
-<node>
|
|
|
|
|
- <domain type='test'>
|
|
|
|
|
- <name>$n</name>
|
|
|
|
|
- <memory>1048576</memory>
|
|
|
|
|
- <os>
|
|
|
|
|
- <type>hvm</type>
|
|
|
|
|
- <boot dev='hd'/>
|
|
|
|
|
- </os>
|
|
|
|
|
- <devices>
|
|
|
|
|
- <disk type='file' device='disk'>
|
|
|
|
|
- <driver name='qemu' type='qcow2'/>
|
|
|
|
|
- <source file='$img'/>
|
|
|
|
|
- <target dev='vda' bus='virtio'/>
|
|
|
|
|
- </disk>
|
|
|
|
|
- </devices>
|
|
|
|
|
- </domain>
|
|
|
|
|
-</node>
|
|
|
|
|
-EOF
|
|
|
|
|
-
|
|
|
|
|
-$VG virt-v2v --debug-gc -i libvirt -ic "test://$libvirt_xml" $n --in-place
|
|
|
|
|
-
|
|
|
|
|
-# Test that the drivers have been copied over into the guest
|
|
|
|
|
-script="$d/test.fish"
|
|
|
|
|
-expected="$d/expected"
|
|
|
|
|
-response="$d/response"
|
|
|
|
|
-
|
|
|
|
|
-mktest ()
|
|
|
|
|
-{
|
|
|
|
|
- local cmd="$1" exp="$2"
|
|
|
|
|
-
|
|
|
|
|
- echo "echo '$cmd'" >> "$script"
|
|
|
|
|
- echo "$cmd" >> "$expected"
|
|
|
|
|
-
|
|
|
|
|
- echo "$cmd" >> "$script"
|
|
|
|
|
- echo "$exp" >> "$expected"
|
|
|
|
|
-}
|
|
|
|
|
-
|
|
|
|
|
-:> "$script"
|
|
|
|
|
-:> "$expected"
|
|
|
|
|
-
|
|
|
|
|
-firstboot_dir="/Program Files/Guestfs/Firstboot"
|
|
|
|
|
-mktest "is-dir \"$firstboot_dir\"" true
|
|
|
|
|
-mktest "is-file \"$firstboot_dir/firstboot.bat\"" true
|
|
|
|
|
-mktest "is-dir \"$firstboot_dir/scripts\"" true
|
|
|
|
|
-virtio_dir="/Windows/Drivers/VirtIO"
|
|
|
|
|
-mktest "is-dir \"$virtio_dir\"" true
|
|
|
|
|
-for drv in netkvm qxl vioscsi viostor; do
|
|
|
|
|
- for sfx in cat inf sys; do
|
|
|
|
|
- mktest "is-file \"$virtio_dir/$drv.$sfx\"" true
|
|
|
|
|
- done
|
|
|
|
|
-done
|
|
|
|
|
-
|
|
|
|
|
-guestfish --ro -a "$img" -i < "$script" > "$response"
|
|
|
|
|
-diff -u "$expected" "$response"
|
|
|
|
|
-
|
|
|
|
|
-# Test the base image remained untouched
|
|
|
|
|
-test "$md5" = "$(do_md5 $img_base)"
|
|
|
|
|
-
|
|
|
|
|
-# Clean up.
|
|
|
|
|
-rm -r $d
|
|
|
|
|
diff --git a/v2v/virt-v2v.pod b/v2v/virt-v2v.pod
|
2020-07-28 07:17:48 +00:00
|
|
|
|
index bd606592b..092d88635 100644
|
2019-08-01 12:44:12 +00:00
|
|
|
|
--- a/v2v/virt-v2v.pod
|
|
|
|
|
+++ b/v2v/virt-v2v.pod
|
2020-07-28 07:17:48 +00:00
|
|
|
|
@@ -8,10 +8,6 @@ virt-v2v - Convert a guest to use KVM
|
|
|
|
|
[-o mode] [other -o* options]
|
|
|
|
|
[guest|filename]
|
2019-08-01 12:44:12 +00:00
|
|
|
|
|
2020-07-28 07:17:48 +00:00
|
|
|
|
- virt-v2v --in-place
|
|
|
|
|
- [-i mode] [other -i* options]
|
|
|
|
|
- [guest|filename]
|
2019-08-01 12:44:12 +00:00
|
|
|
|
-
|
|
|
|
|
=head1 DESCRIPTION
|
|
|
|
|
|
2020-07-28 07:17:48 +00:00
|
|
|
|
Virt-v2v converts a single guest from a foreign hypervisor to run on
|
|
|
|
|
@@ -39,9 +35,6 @@ these sides of virt-v2v are documented separately in this manual.
|
2019-08-01 12:44:12 +00:00
|
|
|
|
|
2020-07-28 07:17:48 +00:00
|
|
|
|
Virt-v2v normally copies from the input to the output, called "copying
|
|
|
|
|
mode". In this case the source guest is always left unchanged.
|
|
|
|
|
-In-place conversion (I<--in-place>) only uses the I<-i*> options and
|
|
|
|
|
-modifies the source guest in-place. (See L</In-place conversion>
|
|
|
|
|
-below.)
|
|
|
|
|
|
|
|
|
|
=head2 Other virt-v2v topics
|
2019-08-01 12:44:12 +00:00
|
|
|
|
|
2020-07-28 07:17:48 +00:00
|
|
|
|
@@ -255,20 +248,6 @@ For I<-i disk> only, this specifies the format of the input disk
|
2019-08-01 12:44:12 +00:00
|
|
|
|
image. For other input methods you should specify the input
|
|
|
|
|
format in the metadata.
|
|
|
|
|
|
|
|
|
|
-=item B<--in-place>
|
|
|
|
|
-
|
|
|
|
|
-Do not create an output virtual machine in the target hypervisor.
|
|
|
|
|
-Instead, adjust the guest OS in the source VM to run in the input
|
|
|
|
|
-hypervisor.
|
|
|
|
|
-
|
|
|
|
|
-This mode is meant for integration with other toolsets, which take the
|
|
|
|
|
-responsibility of converting the VM configuration, providing for
|
|
|
|
|
-rollback in case of errors, transforming the storage, etc.
|
|
|
|
|
-
|
2020-07-28 07:17:48 +00:00
|
|
|
|
-See L</In-place conversion> below.
|
2019-08-01 12:44:12 +00:00
|
|
|
|
-
|
|
|
|
|
-Conflicts with all I<-o *> options.
|
|
|
|
|
-
|
|
|
|
|
=item B<-io> OPTION=VALUE
|
|
|
|
|
|
|
|
|
|
Set input option(s) related to the current input mode or transport.
|
2020-07-28 07:17:48 +00:00
|
|
|
|
@@ -1300,7 +1279,7 @@ Minimum free space: 10 MB
|
|
|
|
|
=head3 Minimum free space check in the host
|
2019-08-01 12:44:12 +00:00
|
|
|
|
|
|
|
|
|
You must have sufficient free space in the host directory used to
|
|
|
|
|
-store temporary overlays (except in I<--in-place> mode). To find out
|
|
|
|
|
+store temporary overlays. To find out
|
|
|
|
|
which directory this is, use:
|
|
|
|
|
|
|
|
|
|
$ df -h "`guestfish get-cachedir`"
|
2020-07-28 07:17:48 +00:00
|
|
|
|
@@ -1403,31 +1382,6 @@ that instead.
|
2019-08-01 12:44:12 +00:00
|
|
|
|
</devices>
|
|
|
|
|
</domain>
|
|
|
|
|
|
2020-07-28 07:17:48 +00:00
|
|
|
|
-=head2 In-place conversion
|
2019-08-01 12:44:12 +00:00
|
|
|
|
-
|
|
|
|
|
-It is also possible to use virt-v2v in scenarios where a foreign VM
|
|
|
|
|
-has already been imported into a KVM-based hypervisor, but still needs
|
|
|
|
|
-adjustments in the guest to make it run in the new virtual hardware.
|
|
|
|
|
-
|
|
|
|
|
-In that case it is assumed that a third-party tool has created the
|
|
|
|
|
-target VM in the supported KVM-based hypervisor based on the source VM
|
|
|
|
|
-configuration and contents, but using virtual devices more appropriate
|
|
|
|
|
-for KVM (e.g. virtio storage and network, etc.).
|
|
|
|
|
-
|
|
|
|
|
-Then, to make the guest OS boot and run in the changed environment,
|
|
|
|
|
-one can use:
|
|
|
|
|
-
|
|
|
|
|
- virt-v2v -ic qemu:///system converted_vm --in-place
|
|
|
|
|
-
|
|
|
|
|
-Virt-v2v will analyze the configuration of C<converted_vm> in the
|
|
|
|
|
-C<qemu:///system> libvirt instance, and apply various fixups to the
|
|
|
|
|
-guest OS configuration to make it match the VM configuration. This
|
|
|
|
|
-may include installing virtio drivers, configuring the bootloader, the
|
|
|
|
|
-mountpoints, the network interfaces, and so on.
|
|
|
|
|
-
|
|
|
|
|
-Should an error occur during the operation, virt-v2v exits with an
|
|
|
|
|
-error code leaving the VM in an undefined state.
|
|
|
|
|
-
|
2020-07-28 07:17:48 +00:00
|
|
|
|
=head2 Machine readable output
|
2019-08-01 12:44:12 +00:00
|
|
|
|
|
|
|
|
|
The I<--machine-readable> option can be used to make the output more
|
|
|
|
|
--
|
2020-07-28 07:17:48 +00:00
|
|
|
|
2.25.4
|
2019-08-01 12:44:12 +00:00
|
|
|
|
|