Created attachment 1757778 [details] virt-v2v-rhel8.3-guest-usr-partition.log Description of problem: Virt-v2v can't convert rhel8 guest whose usr partition is dependent Version-Release number of selected component (if applicable): virt-v2v-1.42.0-9.module+el8.4.0+9561+069bb9c1.x86_64 libguestfs-1.44.0-1.module+el8.4.0+9398+f376ac33.x86_64 libvirt-libs-7.0.0-3.module+el8.4.0+9709+a99efd61.x86_64 qemu-kvm-5.2.0-5.module+el8.4.0+9775+0937c167.x86_64 nbdkit-1.24.0-1.module+el8.4.0+9341+96cf2672.x86_64 How reproducible: 100% Steps to Reproduce: 1.Prepare a rhel8.3 guest whose usr partition is dependent # uname -a .... 4.18.0-240.13.1.el8_3.x86_64 #1 SMP Tue Jan 19 05:05:52 EST 2021 x86_64 x86_64 x86_64 GNU/Linux # lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 12G 0 disk ├─sda1 8:1 0 1G 0 part /boot └─sda2 8:2 0 11G 0 part ├─rhel_bootp--73--199--183-root 253:0 0 8G 0 lvm / ├─rhel_bootp--73--199--183-swap 253:1 0 1.2G 0 lvm [SWAP] └─rhel_bootp--73--199--183-usr 253:2 0 1.8G 0 lvm /usr sr0 11:0 1 1024M 0 rom # cat /etc/fstab .... /dev/mapper/rhel_bootp--73--199--183-root / xfs defaults 0 0 UUID=43518872-9dfc-484b-b990-33bdeda165e7 /boot xfs defaults 0 0 /dev/mapper/rhel_bootp--73--199--183-usr /usr xfs defaults 0 0 /dev/mapper/rhel_bootp--73--199--183-swap none swap defaults 0 0 2.Use virt-v2v to convert the guest but the conversion is failed # virt-v2v -ic vpx://root.198.169/data/10.73.199.217/?no_verify=1 -it vddk -io vddk-libdir=/home/vddk7.0 -io vddk-thumbprint=B5:52:1F:B4:21:09:45:24:51:32:56:F6:63:6A:93:5D:54:08:2D:78 Auto-esx7.0-rhel8.3-usr-partition -ip /home/passwd [ 0.0] Opening the source -i libvirt -ic vpx://root.198.169/data/10.73.199.217/?no_verify=1 Auto-esx7.0-rhel8.3-usr-partition -it vddk -io vddk-libdir=/home/vddk7.0 -io vddk-thumbprint=B5:52:1F:B4:21:09:45:24:51:32:56:F6:63:6A:93:5D:54:08:2D:78 [ 1.7] Creating an overlay to protect the source from being modified [ 2.4] Opening the overlay [ 7.6] Inspecting the overlay virt-v2v: error: inspection could not detect the source guest (or physical machine). Assuming that you are running virt-v2v/virt-p2v on a source which is supported (and not, for example, a blank disk), then this should not happen. Inspection field ‘i_arch’ was ‘unknown’. If reporting bugs, run virt-v2v with debugging enabled and include the complete output: virt-v2v -v -x [...] Actual result: As above description Expected results: Virt-v2v can convert rhel8 guest whose usr partition is dependent successfully Additional info: Virt-v2v can convert rhel7 guest whose usr partition is dependent (fixed in bug1401474) 1.Prepare a rhel7 guest whose usr partition is dependent # uname -a ..... 3.10.0-327.el7.x86_64 #1 SMP Thu Oct 29 17:29:29 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux # lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT fd0 2:0 1 4K 0 disk sda 8:0 0 16G 0 disk ├─sda1 8:1 0 500M 0 part /boot ├─sda2 8:2 0 8G 0 part / ├─sda3 8:3 0 4.9G 0 part /usr ├─sda4 8:4 0 1K 0 part └─sda5 8:5 0 1.6G 0 part └─rhel-swap 253:0 0 1.6G 0 lvm [SWAP] sr0 11:0 1 1024M 0 rom # cat /etc/fstab .... UUID=8a55631d-6839-4781-bdd9-e56ffc053d84 / ext4 defaults 1 1 UUID=5c23ea89-11dd-4e0a-8a3f-d1cf76a136c3 /boot ext4 defaults 1 2 UUID=51f78971-21ca-44f3-97e1-7ea5e701eb23 /usr ext4 defaults 1 2 /dev/mapper/rhel-swap swap swap defaults 0 0 2.Use virt-v2v to convert the guest # virt-v2v -ic vpx://root.73.148/data/10.73.3.19/?no_verify=1 -it vddk -io vddk-libdir=/home/vddk6.5 -io vddk-thumbprint=AA:F5:4C:48:C9:BF:75:1A:94:41:61:4C:D5:EC:DF:46:48:B5:9B:4D --password-file /home/passwd Auto-esx5.5-rhel7.2-usr-partition [ 0.0] Opening the source -i libvirt -ic vpx://root.73.148/data/10.73.3.19/?no_verify=1 Auto-esx5.5-rhel7.2-usr-partition -it vddk -io vddk-libdir=/home/vddk6.5 -io vddk-thumbprint=AA:F5:4C:48:C9:BF:75:1A:94:41:61:4C:D5:EC:DF:46:48:B5:9B:4D [ 1.6] Creating an overlay to protect the source from being modified [ 4.7] Opening the overlay [ 12.1] Inspecting the overlay [ 25.7] Checking for sufficient free disk space in the guest [ 25.7] Estimating space required on target for each disk [ 25.7] Converting Red Hat Enterprise Linux Server 7.2 (Maipo) to run on KVM virt-v2v: This guest has virtio drivers installed. [ 76.1] Mapping filesystem data to avoid copying unused and blank areas [ 77.3] Closing the overlay [ 77.6] Assigning disks to buses [ 77.6] Checking if the guest needs BIOS or UEFI to boot [ 77.6] Initializing the target -o libvirt -os default [ 77.6] Copying disk 1/1 to /var/lib/libvirt/images/Auto-esx5.5-rhel7.2-usr-partition-sda (raw) ^C (4.01/100%)
*** Bug 1949683 has been marked as a duplicate of this bug. ***
https://github.com/libguestfs/libguestfs/commit/26427b9ecc64e7e5e53a1d577cef9dc080d08877
To test this I had to prepare a VM with a split /usr partition, as follows: $ virt-builder fedora-33 $ virt-tar-out -a fedora-33.img /usr usr.tar $ rm -f fedora-33-split-usr.img $ truncate -s 10G fedora-33-split-usr.img $ virt-resize fedora-33.img fedora-33-split-usr.img Set up the separate /usr inside the new disk image: $ guestfish -a fedora-33-split-usr.img -i ><fs> rm-rf /usr ><fs> mkfs xfs /dev/sda4 ><fs> mkdir /usr ><fs> mount /dev/sda4 /usr ><fs> tar-in usr.tar /usr xattrs:true selinux:true acls:true ><fs> vi /etc/fstab Add the following line at the end of /etc/fstab: /dev/sda4 /usr xfs defaults 0 0 ><fs> exit Verify the split /usr partition configuration is detected: $ guestfish --ro -a fedora-33-split-usr.img -i /dev/sda3 mounted on / /dev/sda2 mounted on /boot /dev/sda4 mounted on /usr <--- note ><fs> exit However if you run virt-inspector on the new image you will see there is no <arch> entry and inspection is incomplete: $ virt-inspector -a fedora-33-split-usr.img --no-applications Also virt-v2v fails. The error message is slightly different, but the root cause is the same thing: $ virt-v2v -i disk fedora-33-split-usr.img -o null virt-v2v: error: inspection could not detect the source guest (or physical machine). ... Inspection field ‘i_distro’ was ‘unknown’.
back to modified as it was included in the wrong errata.
Verified with package: libguestfs-1.44.0-3.module+el8.5.0+10681+17a9b157.x86_64 Steps: 1. Prepare a VM with a split /usr partition on rhel8.4 host(refer to comment 4) $ guestfish --ro -a fedora-33-split-usr.img -i ... Operating system: Fedora 33 (Thirty Three) /dev/sda3 mounted on / /dev/sda2 mounted on /boot /dev/sda4 mounted on /usr ><fs> exit 2. $ virt-inspector -a fedora-33-split-usr.img --no-applications <?xml version="1.0"?> <operatingsystems> <operatingsystem> <root>/dev/sda3</root> <name>linux</name> <arch>x86_64</arch> <distro>fedora</distro> <product_name>Fedora 33 (Thirty Three)</product_name> <major_version>33</major_version> <minor_version>0</minor_version> <package_format>rpm</package_format> <package_management>yum</package_management> <hostname>localhost.localdomain</hostname> <osinfo>fedora33</osinfo> <mountpoints> <mountpoint dev="/dev/sda3">/</mountpoint> <mountpoint dev="/dev/sda4">/usr</mountpoint> <mountpoint dev="/dev/sda2">/boot</mountpoint> </mountpoints> <filesystems> <filesystem dev="/dev/sda2"> <type>xfs</type> <uuid>b36104d1-1e5c-4057-9617-f3ade113a291</uuid> </filesystem> <filesystem dev="/dev/sda3"> <type>xfs</type> <uuid>f490d97d-4ab4-481e-9fdc-9180c8823ded</uuid> </filesystem> <filesystem dev="/dev/sda4"> <type>xfs</type> <uuid>30794fe7-6125-4dff-be8b-33d11128e387</uuid> </filesystem> </filesystems> </operatingsystem> </operatingsystems> 3. $ virt-v2v -i disk fedora-33-split-usr.img -o null [ 0.0] Opening the source -i disk fedora-33-split-usr.img [ 0.0] Creating an overlay to protect the source from being modified [ 0.1] Opening the overlay [ 8.5] Inspecting the overlay virt-v2v: error: libguestfs error: filesize: /var/lib/rpm/Name: No such file or directory --- It's another expected error, need upstream rebase libguestfs 1.45.3.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (virt:av bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2021:4684