Bug 1691659

Summary: virt-v2v should show a message when qemu-guest-agent is installed in guest successfully during conversion
Product: Red Hat Enterprise Linux 7 Reporter: liuzi <zili>
Component: libguestfsAssignee: Richard W.M. Jones <rjones>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.7CC: juzhou, mxie, mzhan, ptoscano, tzheng, xiaodwan
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: V2V
Fixed In Version: libguestfs-1.40.2-3.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-08-06 12:44:47 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description liuzi 2019-03-22 07:53:47 UTC
Description:
virt-v2v should show a message when qemu-guest-agent is installed in guest successfully during virt-v2v conversion

How reproducible:
100%

Version:
rhv-guest-tools-iso-4.3-3.el7ev.noarch
libguestfs-1.40.2-1.el7.x86_64
virt-v2v-1.40.2-1.el7.x86_64
libvirt-4.5.0-10.el7_6.4.x86_64

Steps:
1. Install the rhv-guest-tools-iso-4.3-3.el7ev.noarch on the rhel7.7 conversion server, and set the following environment variable:
export VIRTIO_WIN=/usr/share/rhv-guest-tools-iso/rhv-tools-setup.iso
2. Use virt-v2v to convert a rhel6-x86-64 guest
# virt-v2v -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 esx6.7-rhel6.10-x86_64 --password-file /tmp/passwd -o rhv-upload -oc https://ibm-x3250m5-03.rhts.eng.pek2.redhat.com/ovirt-engine/api -os nfs_data -op /tmp/rhvpasswd -oo rhv-cafile=/home/ca.pem -oo rhv-direct=true -oo rhv-cluster=nfs
Exception AttributeError: "'module' object has no attribute 'dump_plugin'" in <module 'threading' from '/usr/lib64/python2.7/threading.pyc'> ignored
[ 0.4] Opening the source -i libvirt -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 esx6.7-rhel6.10-x86_64
[ 2.5] Creating an overlay to protect the source from being modified
[ 3.3] Opening the overlay
[ 23.6] Inspecting the overlay
[ 144.4] Checking for sufficient free disk space in the guest
[ 144.4] Estimating space required on target for each disk
[ 144.4] Converting Red Hat Enterprise Linux Server release 6.10 (Santiago) to run on KVM
virt-v2v: This guest has virtio drivers installed.
[1198.8] Mapping filesystem data to avoid copying unused and blank areas
[1201.7] Closing the overlay
[1202.2] Assigning disks to buses
[1202.2] Checking if the guest needs BIOS or UEFI to boot
[1202.2] Initializing the target -o rhv-upload -oc https://ibm-x3250m5-03.rhts.eng.pek2.redhat.com/ovirt-engine/api -op /tmp/rhvpasswd -os nfs_data
[1203.7] Copying disk 1/1 to qemu URI json:
{ "file.driver": "nbd", "file.path": "/var/tmp/rhvupload.QCZqh3/nbdkit0.sock", "file.export": "/" }

(raw)
(100.00/100%)
[2158.3] Creating output metadata
[2174.0] Finishing off

3. Conversion can be finished successfully,and boot guest on rhv

4. Check if the guest has correctly installed qume-guest-agent and the service is running normally.
# rpm -q qemu-guest-agent
qemu-guest-agent-0.12.1.2-2.506.el6_10.1.x86_64
# service qemu-ga status
qemu-ga (pid 1073) is running...
#service network restart

Actual results:
Virt-v2v successfully installed the qemu-guest-agent but there isn't show any message during conversion.

Expected results:
virt-v2v should show a message when qemu-guest-agent is installed in guest successfully during conversion

Comment 2 Pino Toscano 2019-03-26 17:46:53 UTC
Just sent a small patch series to show only when the qemu guest agent package is installed:
https://www.redhat.com/archives/libguestfs/2019-March/msg00161.html

Comment 3 mxie@redhat.com 2019-04-12 08:35:51 UTC
Also should verify if the virt-v2v warning like "guest tools directory ‘linux/el7’ is missing from the virtio-win directory or ISO. guest tools are only provided in the RHV Guest Tools ISO.." is hidden if the target is not rhv

Comment 5 liuzi 2019-04-25 09:15:44 UTC
Verify bug with builds:
virt-v2v-1.40.2-3.el7.x86_64
libvirt-4.5.0-12.el7.x86_64
libguestfs-1.40.2-3.el7.x86_64
qemu-kvm-rhev-2.12.0-26.el7.x86_64
rhv-guest-tools-iso-4.3-6.el7ev.noarch

Steps:
Set environment for the conversion server:
a)Download package from:https://brewweb.engineering.redhat.com/brew/packageinfo?packageID=64501

b)Install the rhv-guest-tools-iso-4.3-6.el7ev.noarch on the rhel7.7 conversion server, and set the following environment variable:
export VIRTIO_WIN=/usr/share/rhv-guest-tools-iso/rhv-tools-setup.iso

c)Mount /usr/share/rhv-guest-tools-iso/rhv-tools-setup.iso to /mnt,and check which linux os are supported in /mnt/linux directory.
debian:
qemu-guest-agent_2.8+dfsg-6+deb9u4_amd64.deb

el6:
qemu-guest-agent-0.12.1.2-2.506.el6_10.1.x86_64.rpm

el7:
qemu-guest-agent-2.12.0-2.el7.x86_64.rpm

fc28:
qemu-guest-agent-2.11.2-4.fc28.x86_64.rpm

lp151:
qemu-guest-agent-2.11.1-lp151.8.2.x86_64.rpm


scenario 1:Convert a rhel6-x86_64 guest from EXSI6.7 to rhv:
1.1#  virt-v2v -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 esx6.7-rhel6.10-x86_64 --password-file /tmp/passwd -o rhv-upload -oc https://ibm-x3250m5-03.rhts.eng.pek2.redhat.com/ovirt-engine/api -os rhvh_data -op /tmp/rhvpasswd -oo rhv-cafile=/home/ca.pem  -oo rhv-direct=true -oo rhv-cluster=rhvh
Exception AttributeError: "'module' object has no attribute 'dump_plugin'" in <module 'threading' from '/usr/lib64/python2.7/threading.pyc'> ignored
[   0.4] Opening the source -i libvirt -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 esx6.7-rhel6.10-x86_64
[   2.3] Creating an overlay to protect the source from being modified
[   3.2] Opening the overlay
[  24.3] Inspecting the overlay
[ 145.1] Checking for sufficient free disk space in the guest
[ 145.1] Estimating space required on target for each disk
[ 145.1] Converting Red Hat Enterprise Linux Server release 6.10 (Santiago) to run on KVM
virt-v2v: QEMU Guest Agent installed for this guest.
virt-v2v: This guest has virtio drivers installed.
[1153.0] Mapping filesystem data to avoid copying unused and blank areas
[1155.6] Closing the overlay
[1156.4] Assigning disks to buses
[1156.4] Checking if the guest needs BIOS or UEFI to boot
[1156.4] Initializing the target -o rhv-upload -oc https://ibm-x3250m5-03.rhts.eng.pek2.redhat.com/ovirt-engine/api -op /tmp/rhvpasswd -os rhvh_data
[1157.9] Copying disk 1/1 to qemu URI json:{ "file.driver": "nbd", "file.path": "/var/tmp/rhvupload.1OalwR/nbdkit0.sock", "file.export": "/" } (raw)
    (100.00/100%)
[2272.6] Creating output metadata
[2295.6] Finishing off 

1.2 Conversion can be finished successfully,and boot guest on rhv

1.3 Check if the guest has correctly installed qume-guest-agent and the service is running normally.

scenario 2:Convert a ubuntu guest from ESXI6.7 to rhv:
2.1# virt-v2v -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1  esx6.7-ubuntu18.04LTS-x86_64 --password-file /tmp/passwd  -o rhv -os 10.73.194.236:/home/nfs_export 
[   0.0] Opening the source -i libvirt -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 esx6.7-ubuntu18.04LTS-x86_64
[   2.1] Creating an overlay to protect the source from being modified
[   3.1] Opening the overlay
[  18.9] Inspecting the overlay
[  34.3] Checking for sufficient free disk space in the guest
[  34.3] Estimating space required on target for each disk
[  34.3] Converting Ubuntu 18.04.2 LTS to run on KVM
virt-v2v: warning: could not determine a way to update the configuration of 
Grub2
virt-v2v: This guest has virtio drivers installed.
[ 899.8] Mapping filesystem data to avoid copying unused and blank areas
[ 901.8] Closing the overlay
[ 902.4] Assigning disks to buses
[ 902.4] Checking if the guest needs BIOS or UEFI to boot
[ 902.4] Initializing the target -o rhv -os 10.73.194.236:/home/nfs_export
[ 903.5] Copying disk 1/1 to /tmp/v2v.HLrYrp/bde9fcca-7eef-4738-8079-9f2c93afc544/images/e63f6172-405f-4267-a6cc-4aa7be6799de/a361415f-a949-480e-b043-6edfca3d67a5 (raw)
    (100.00/100%)
[1542.9] Creating output metadata
[1543.2] Finishing off

2.2 Conversion can be finished successfully and with no warning info about rhv-guest-tools.

scenario 3:Convert a ubuntu guest from ESXI6.7 to kvm:
3.1# virt-v2v -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 -it vddk -io vddk-libdir=/home/vmware-vix-disklib-distrib -io  vddk-thumbprint=1F:97:34:5F:B6:C2:BA:66:46:CB:1A:71:76:7D:6B:50:1E:03:00:EA -n default esx6.7-ubuntu18.04LTS-x86_64 --password-file /tmp/passwd
[   0.2] Opening the source -i libvirt -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 esx6.7-ubuntu18.04LTS-x86_64 -it vddk  -io vddk-libdir=/home/vmware-vix-disklib-distrib -io vddk-thumbprint=1F:97:34:5F:B6:C2:BA:66:46:CB:1A:71:76:7D:6B:50:1E:03:00:EA
[   3.0] Creating an overlay to protect the source from being modified
[   6.8] Opening the overlay
[  47.2] Inspecting the overlay
[  50.7] Checking for sufficient free disk space in the guest
[  50.7] Estimating space required on target for each disk
[  50.7] Converting Ubuntu 18.04.2 LTS to run on KVM
virt-v2v: warning: could not determine a way to update the configuration of 
Grub2
virt-v2v: This guest has virtio drivers installed.
[ 116.1] Mapping filesystem data to avoid copying unused and blank areas
[ 118.6] Closing the overlay
[ 119.9] Assigning disks to buses
[ 119.9] Checking if the guest needs BIOS or UEFI to boot
[ 119.9] Initializing the target -o libvirt -os default
[ 120.1] Copying disk 1/1 to /var/lib/libvirt/images/esx6.7-ubuntu18.04LTS-x86_64-sda (raw)
    (100.00/100%)
[ 420.7] Creating output metadata
Pool default refreshed

Domain esx6.7-ubuntu18.04LTS-x86_64 defined from /tmp/v2vlibvirt91099c.xml

[ 425.6] Finishing off


3.2 Conversion can be finished successfully and with no warning info about rhv-guest-tools.

Result:virt-v2v will only show a message when qemu-guest-agent is installed in guest successfully during conversion,and hide warning info about rhv-guest-tools for other cases.So change the bug from ON_QA to VERIFIED.

Comment 7 errata-xmlrpc 2019-08-06 12:44:47 UTC
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, 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/RHEA-2019:2096