Bug 1804750 - blockdev: libvirt doesn't preserve the 'sslverify', 'cookie', 'timeout' and 'readahead properties of the http(s) driver
Summary: blockdev: libvirt doesn't preserve the 'sslverify', 'cookie', 'timeout' and '...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux Advanced Virtualization
Classification: Red Hat
Component: libvirt
Version: 8.2
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: rc
: 8.0
Assignee: Peter Krempa
QA Contact: Han Han
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-02-19 14:50 UTC by Xiaodai Wang
Modified: 2020-05-05 09:58 UTC (History)
15 users (show)

Fixed In Version: libvirt-6.0.0-16.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-05-05 09:57:19 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)
v2v debug log (102.38 KB, text/plain)
2020-02-19 14:53 UTC, Xiaodai Wang
no flags Details
virt-v2v-debug-log-bug1804750.log (21.14 KB, text/plain)
2020-03-19 09:13 UTC, mxie@redhat.com
no flags Details
v2v-libvirt-6.0.0-16.log (21.42 KB, text/plain)
2020-04-02 16:10 UTC, mxie@redhat.com
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:2017 0 None None None 2020-05-05 09:58:26 UTC

Description Xiaodai Wang 2020-02-19 14:50:55 UTC
Description of problem:
virt-v2v: error: libguestfs error: could not create appliance through libvirt

Version-Release number of selected component (if applicable):
libvirt-6.0.0-5.module+el8.2.0+5765+64816f89.x86_64
libguestfs-1.40.2-20.module+el8.2.0+5433+9e1420c8.x86_64
qemu-kvm-4.2.0-10.module+el8.2.0+5740+c3dff59e.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Make sure LIBGUESTFS_BACKEND=libvirt.
2. Convert a guest to rhv by v2v -o rhv-upload like following command.
# virt-v2v  -ic vpx://root.73.141/data/10.73.196.89/?no_verify=1 -o rhv-upload -os nfs_data -of raw -b ovirtmgmt -n ovirtmgmt esx6.5-rhel7.7-x86_64 -on esx6.5-rhel7.7-x86_64vH6 -oc https://hp-dl360eg8-03.lab.eng.pek2.redhat.com/ovirt-engine/api -op /tmp/rhv_upload_passwd_file -oo rhv-cafile=/tmp/rhv_upload_ca.pem -oo rhv-cluster=NFS -oo rhv-verifypeer=false -oo rhv-direct -ip /tmp/v2v_vpx_passwd -v -x

Actual results:
# virt-v2v  -ic vpx://root.73.141/data/10.73.196.89/?no_verify=1 -o rhv-upload -os nfs_data -of raw -b ovirtmgmt -n ovirtmgmt esx6.5-rhel7.7-x86_64 -on esx6.5-rhel7.7-x86_64vH6 -oc https://hp-dl360eg8-03.lab.eng.pek2.redhat.com/ovirt-engine/api -op /tmp/rhv_upload_passwd_file -oo rhv-cafile=/tmp/rhv_upload_ca.pem -oo rhv-cluster=NFS -oo rhv-verifypeer=false -oo rhv-direct -ip /tmp/v2v_vpx_passwd 
[   0.8] Opening the source -i libvirt -ic vpx://root.73.141/data/10.73.196.89/?no_verify=1 esx6.5-rhel7.7-x86_64
[   2.7] Creating an overlay to protect the source from being modified
[   3.3] Opening the overlay
virt-v2v: error: libguestfs error: could not create appliance through 
libvirt.

Try running qemu directly without libvirt using this environment variable:
export LIBGUESTFS_BACKEND=direct

Original error from libvirt: internal error: process exited while 
connecting to monitor: 2020-02-19T14:46:48.209274Z qemu-kvm: -blockdev 
{"driver":"https","url":"https://10.73.73.141:443/folder/esx6.5-rhel7.7-x86_64/esx6.5-rhel7.7-x86_64-flat.vmdk","node-name":"libvirt-4-storage","cache":{"direct":false,"no-flush":true},"auto-read-only":true,"discard":"unmap"}: 
CURL: Error opening file: SSL certificate problem: unable to get local 
issuer certificate [code=1 int1=-1]

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]


Expected results:
v2v should run success.

Additional info:
1) v2v can run success if convert by -o rhv-upload and vddk on same rhel8 host.
virt-v2v  -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 -o rhv-upload -os nfs_data -of raw -b ovirtmgmt -n ovirtmgmt esx6.7-rhel7.7-x86_64 -it vddk -io vddk-libdir=/var/tmp/avocado_mi9vrvy6/vddk_libdir -io vddk-thumbprint=1F:97:34:5F:B6:C2:BA:66:46:CB:1A:71:76:7D:6B:50:1E:03:00:EA -on esx6.7-rhel7.7-x86_64sNb -oc https://hp-dl360eg8-03.lab.eng.pek2.redhat.com/ovirt-engine/api -op /tmp/rhv_upload_passwd_file -oo rhv-cafile=/tmp/rhv_upload_ca.pem -oo rhv-cluster=NFS -oo rhv-verifypeer=true -oo rhv-direct -ip /tmp/v2v_vpx_passwd -v -x
2) The command in step2 can run success on rhel7.

Comment 1 Xiaodai Wang 2020-02-19 14:53:36 UTC
Created attachment 1664074 [details]
v2v debug log

Comment 2 Peter Krempa 2020-02-19 15:44:44 UTC
The backing store string used by v2v is:

{ "file.cookie": "vmware_soap_session=\"0c8db85112873a79b7ef7494f71df294cb70ef7f\"",
  "file.sslverify": "off",
  "file.driver": "https",
  "file.url": "https://.../folder/esx6.5-rhel7.7-x86%5f64/esx6.5-rhel7.7-x86%5f64-flat.vmdk?dcPath=data&dsName=esx6.5-matrix",
  "file.timeout": 2000
}

Comment 3 Han Han 2020-02-20 01:58:22 UTC
Example in libvirt:
version: libvirt-6.0.0-5.module+el8.2.0+5765+64816f89.x86_64 qemu-kvm-4.2.0-10.module+el8.2.0+5740+c3dff59e.x86_64

steps:
1. Create https backing file with optional parameters:
➜  ~ qemu-img create /tmp/https.qcow2 -f qcow2 -b 'json:{"file":{"driver":"https", "url":"https://ftp.sjtu.edu.cn/fedora/linux/releases/30/Everything/x86_64/iso/Fedora-Everything-netinst-x86_64-30-1.2.iso", "sslverify":"off","timeout":"2000"}}' -o backing_fmt=raw 
Formatting '/tmp/https.qcow2', fmt=qcow2 size=627048448 backing_file=json:{"file":{"driver":"https",, "url":"https://ftp.sjtu.edu.cn/fedora/linux/releases/30/Everything/x86_64/iso/Fedora-Everything-netinst-x86_64-30-1.2.iso",, "sslverify":"off",,"timeout":"2000"}} backing_fmt=raw cluster_size=65536 lazy_refcounts=off refcount_bits=16


2. Attach the overlay image to running vm:
➜  ~ virsh attach-disk q35 /tmp/https.qcow2 vdb --subdriver qcow2
Disk attached successfully


Check the vm xml
➜  ~ virsh dumpxml q35 |xmllint --xpath //disk -                                                                                                                                                          
<disk type="file" device="disk">
      <driver name="qemu" type="qcow2" copy_on_read="on"/>
      <source file="/var/lib/libvirt/images/q35.qcow2" index="1"/>
      <backingStore/>
      <target dev="vda" bus="virtio"/>
      <alias name="virtio-disk0"/>
      <address type="pci" domain="0x0000" bus="0x04" slot="0x00" function="0x0"/>
    </disk><disk type="file" device="disk">
      <driver name="qemu" type="qcow2"/>
      <source file="/tmp/https.qcow2" index="103"/>
      <backingStore type="network" index="104">
        <format type="raw"/>
        <source protocol="https" name="fedora/linux/releases/30/Everything/x86_64/iso/Fedora-Everything-netinst-x86_64-30-1.2.iso">
          <host name="ftp.sjtu.edu.cn" port="443"/>
        </source>
      </backingStore>
      <target dev="vdb" bus="virtio"/>
      <alias name="virtio-disk1"/>
      <address type="pci" domain="0x0000" bus="0x06" slot="0x00" function="0x0"/>
    </disk>

The optional parameters sslverify and timeout are ignored.

Comment 4 mxie@redhat.com 2020-02-24 07:43:30 UTC
I can't reproduce the bug with rhel8.1.1 builds:
virt-v2v-1.40.2-16.module+el8.1.1+5309+6d656f05.x86_64
libguestfs-1.40.2-16.module+el8.1.1+5309+6d656f05.x86_64
libvirt-5.6.0-10.module+el8.1.1+5309+6d656f05.x86_64
qemu-kvm-4.1.0-23.module+el8.1.1+5467+ba2d821b.x86_64


Can reproduce the bug with rhel8.2 builds:
libvirt-6.0.0-6.module+el8.2.0+5821+109ee33c.x86_64
virt-v2v-1.40.2-20.module+el8.2.0+5433+9e1420c8.x86_64
libguestfs-1.40.2-20.module+el8.2.0+5433+9e1420c8.x86_64
qemu-kvm-4.2.0-11.module+el8.2.0+5837+4c1442ec.x86_64

Comment 5 Richard W.M. Jones 2020-02-24 08:39:28 UTC
Where these parameters are generated:
https://github.com/libguestfs/libguestfs/blob/91698a8500d19e06811133bfab27d1e1e65a583e/v2v/vCenter.ml#L77

Note that upstream virt-v2v (which should be in RHEL AV 8.3) will use
an nbdkit process (using nbdkit-curl-plugin) which will probably avoid
this issue as libvirt will simply see an NBD backing disk.

(This doesn't change the fact that it'll be broken in AV 8.2.)

Comment 6 Peter Krempa 2020-03-09 16:25:08 UTC
Patches proposed upstream: https://www.redhat.com/archives/libvir-list/2020-March/msg00247.html

Comment 7 Peter Krempa 2020-03-16 15:04:02 UTC
Fixed upstream by:

d6db013c6e qemu: Pass through arguments of 'ssh' block driver used by libguestfs
d089234110 qemublocktest: Add JSON->JSON test cases for block device backends
7f8d0ca56a qemublocktest: XMLjsonXML: Test formatting/parsing of modern JSON
218ce53069 qemublocktest: Extract schema root for blockdev-add validation
1262cdede4 qemublocktest: Load QMP schema earlier
5179cc6b08 virStorageSourceParseBackingJSONUri: Handle undocumented value 'off' for sslverify
77194db01c virstoragefile: Add JSON parser for 'sslverify', 'readahead', 'cookies' and 'timeout'
9cac141cd6 qemu: block: Implement readahead and timeout properties for 'curl' driver
06d3e8d539 qemu: block: Add support for HTTP cookies
b512935b17 qemu: Handle hotplug and commandline for secret objects for http cookies
877cd35887 qemuDomainSecretStorageSourcePrepare: Setup secret for http cookies
4e8faa5cdc qemu: domain: Store data for 'secret' object representing http cookies
304da9376c qemu: block: Implement ssl verification configuration
3dd7952f6f qemuxml2argvtest: Add test case for disks with http(s) source
c1409e308f qemuDomainValidateStorageSource: Validate new network storage parameters
63fd461773 conf: Add support for setting timeout and readahead size for network disks
3b076391be conf: Add support for cookies for HTTP based disks
25481e25b1 conf: Add support for modifying ssl validation for https/ftps disks
43a3d2e02e qemuDomainGetSecretAESAlias: Replace outstanding uses with qemuAliasForSecret
70d2758a9c qemuDomainSecretStorageSourcePrepare: Change aliases for disk secrets
86fecaedf5 qemuDomainSecretAESSetupFromSecret: Use 'qemuAliasForSecret'
740dd1a4e5 qemu: Split out initialization of secrets for 'iscsi' hostdevs
95a8c4332d qemuDomainDeviceDiskDefPostParseRestoreSecAlias: Hardcode restored aliases
b05322fc03 qemuDomainSecretStorageSourcePrepare: Fix naming of alias variables
bb2a81df21 qemu: Introduce another helper for creating alias for a 'secret' object
f742461389 Remove qemuDomainSecretInfoNew
88663e59ef qemuDomainSecretAESSetup: Split out lookup of secret data
bad8637892 qemuDomainSecretAESSetup: Allocate and return 'secinfo' here
88126d5f0e qemuDomainSecretAESSetup: Automatically free non-secret locals
b544481a91 qemuDomainSecretInfo: Register autoptr cleanup function
7a34e04d82 qemuMigrationParamsResetTLS: Fix comment
3b61106550 qemuMigrationParamsResetTLS: Adapt to modern memory management
38bc76bcc1 qemu: Don't take double pointer in qemuDomainSecretInfoFree
4415b11d6b qemuBlockStorageSourceDetachPrepare: Get rid of cleanup section

Comment 12 mxie@redhat.com 2020-03-19 02:52:07 UTC
Verify the bug with below builds:
libvirt-6.0.0-13.module+el8.2.0+6048+0fa476b4.x86_64
qemu-kvm-4.2.0-15.module+el8.2.0+6029+618ef2ec.x86_64
virt-v2v-1.40.2-22.module+el8.2.0+6029+618ef2ec.x86_64

Steps:
1.Convert a guest from vmware without vddk by virt-v2v
#  virt-v2v  -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 -o rhv-upload -os nfs_data -of raw --mac 00:50:56:ac:e5:3e:network:ovirtmgmt  -oc https://ibm-x3250m5-03.rhts.eng.pek2.redhat.com/ovirt-engine/api -op /home/rhvpasswd  -b ovirtmgmt esx6.7-rhel8.2-x86_64 -ip /home/passwd 
[   0.5] Opening the source -i libvirt -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 esx6.7-rhel8.2-x86_64
[   2.3] Creating an overlay to protect the source from being modified
[   2.9] Opening the overlay
virt-v2v: error: libguestfs error: could not create appliance through 
libvirt.

Try running qemu directly without libvirt using this environment variable:
export LIBGUESTFS_BACKEND=direct

Original error from libvirt: internal error: process exited while 
connecting to monitor: 2020-03-19T02:48:02.926904Z qemu-kvm: -blockdev 
{"driver":"https","url":"https://10.73.73.141:443/folder/esx6.7-rhel8.2-x86_64/esx6.7-rhel8.2-x86_64-flat.vmdk","node-name":"libvirt-4-storage","cache":{"direct":false,"no-flush":true},"auto-read-only":true,"discard":"unmap"}: 
CURL: Error opening file: SSL certificate problem: unable to get local 
issuer certificate [code=1 int1=-1]

If reporting bugs, run virt-v2v with debugging enabled and include the 
complete output:

  virt-v2v -v -x [...]

Result:
   V2V conversion is still failed without vddk mode, so the bug is not fixed

Comment 13 Han Han 2020-03-19 07:11:46 UTC
Check in libvirt-6.0.0-13.virtcov.el8.x86_64:
# qemu-img create /tmp/https.qcow2 -f qcow2 -b 'json:{"file":{"driver":"https", "url":"https://ftp.sjtu.edu.cn/fedora/linux/releases/30/Everything/x86_64/iso/Fedora-Everything-netinst-x86_64-30-1.2.iso", "sslverify":"off","timeout":2000}}'

# virsh attach-disk new  /tmp/https.qcow2 sdb --subdriver qcow2
Disk attached successfully

# virsh attach-disk new  /tmp/https-str.qcow2 sdc --subdriver qcow2
error: Failed to attach disk
error: invalid argument: malformed 'timeout' field in backing store definition '{"file":{"driver":"https", "url":"https://ftp.sjtu.edu.cn/fedora/linux/releases/30/Everything/x86_64/iso/Fedora-Everything-netinst-x86_64-30-1.2.iso", "sslverify":"off","timeout":"2000"}}'

It looks like you forget to transform str to int when the value of timeout is quoted by "".

Comment 14 Peter Krempa 2020-03-19 08:14:58 UTC
(In reply to mxie from comment #12)
> Verify the bug with below builds:
> libvirt-6.0.0-13.module+el8.2.0+6048+0fa476b4.x86_64
> qemu-kvm-4.2.0-15.module+el8.2.0+6029+618ef2ec.x86_64
> virt-v2v-1.40.2-22.module+el8.2.0+6029+618ef2ec.x86_64
> 
> Steps:
> 1.Convert a guest from vmware without vddk by virt-v2v
> #  virt-v2v  -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 -o
> rhv-upload -os nfs_data -of raw --mac 00:50:56:ac:e5:3e:network:ovirtmgmt 
> -oc https://ibm-x3250m5-03.rhts.eng.pek2.redhat.com/ovirt-engine/api -op
> /home/rhvpasswd  -b ovirtmgmt esx6.7-rhel8.2-x86_64 -ip /home/passwd 
> [   0.5] Opening the source -i libvirt -ic
> vpx://root.73.141/data/10.73.75.219/?no_verify=1 esx6.7-rhel8.2-x86_64
> [   2.3] Creating an overlay to protect the source from being modified
> [   2.9] Opening the overlay
> virt-v2v: error: libguestfs error: could not create appliance through 
> libvirt.
> 
> Try running qemu directly without libvirt using this environment variable:
> export LIBGUESTFS_BACKEND=direct
> 
> Original error from libvirt: internal error: process exited while 
> connecting to monitor: 2020-03-19T02:48:02.926904Z qemu-kvm: -blockdev 
> {"driver":"https","url":"https://10.73.73.141:443/folder/esx6.7-rhel8.2-
> x86_64/esx6.7-rhel8.2-x86_64-flat.vmdk","node-name":"libvirt-4-storage",
> "cache":{"direct":false,"no-flush":true},"auto-read-only":true,"discard":
> "unmap"}: 
> CURL: Error opening file: SSL certificate problem: unable to get local 
> issuer certificate [code=1 int1=-1]

Could you please attach output of qemu-img info of the file which was passed to libvirt as the disk? I need to see the backing store string as formatted by libguestfs.

Comment 15 Peter Krempa 2020-03-19 08:17:37 UTC
(In reply to Han Han from comment #13)
> Check in libvirt-6.0.0-13.virtcov.el8.x86_64:
> # qemu-img create /tmp/https.qcow2 -f qcow2 -b
> 'json:{"file":{"driver":"https",
> "url":"https://ftp.sjtu.edu.cn/fedora/linux/releases/30/Everything/x86_64/
> iso/Fedora-Everything-netinst-x86_64-30-1.2.iso",
> "sslverify":"off","timeout":2000}}'
> 
> # virsh attach-disk new  /tmp/https.qcow2 sdb --subdriver qcow2
> Disk attached successfully
> 
> # virsh attach-disk new  /tmp/https-str.qcow2 sdc --subdriver qcow2
> error: Failed to attach disk
> error: invalid argument: malformed 'timeout' field in backing store
> definition '{"file":{"driver":"https",
> "url":"https://ftp.sjtu.edu.cn/fedora/linux/releases/30/Everything/x86_64/
> iso/Fedora-Everything-netinst-x86_64-30-1.2.iso",
> "sslverify":"off","timeout":"2000"}}'
> 
> It looks like you forget to transform str to int when the value of timeout
> is quoted by "".

Is this something that would be formatted by virt-v2v? The QAPI schema documents this as an 'int' so the string representation is not valid. Unless virt-v2v uses that I'm not going to support any legacy/obsolete format for the json:// pseudo-protocol

Comment 16 Han Han 2020-03-19 08:33:34 UTC
(In reply to Peter Krempa from comment #15)
> (In reply to Han Han from comment #13)
> > Check in libvirt-6.0.0-13.virtcov.el8.x86_64:
> > # qemu-img create /tmp/https.qcow2 -f qcow2 -b
> > 'json:{"file":{"driver":"https",
> > "url":"https://ftp.sjtu.edu.cn/fedora/linux/releases/30/Everything/x86_64/
> > iso/Fedora-Everything-netinst-x86_64-30-1.2.iso",
> > "sslverify":"off","timeout":2000}}'
> > 
> > # virsh attach-disk new  /tmp/https.qcow2 sdb --subdriver qcow2
> > Disk attached successfully
> > 
> > # virsh attach-disk new  /tmp/https-str.qcow2 sdc --subdriver qcow2
> > error: Failed to attach disk
> > error: invalid argument: malformed 'timeout' field in backing store
> > definition '{"file":{"driver":"https",
> > "url":"https://ftp.sjtu.edu.cn/fedora/linux/releases/30/Everything/x86_64/
> > iso/Fedora-Everything-netinst-x86_64-30-1.2.iso",
> > "sslverify":"off","timeout":"2000"}}'
> > 
> > It looks like you forget to transform str to int when the value of timeout
> > is quoted by "".
> 
> Is this something that would be formatted by virt-v2v? The QAPI schema
> documents this as an 'int' so the string representation is not valid. Unless
> virt-v2v uses that I'm not going to support any legacy/obsolete format for
> the json:// pseudo-protocol

No. It will not formated by v2v, here is the disk json from v2v log:
json: { "file.cookie": "vmware_soap_session=\"0c8db85112873a79b7ef7494f71df294cb70ef7f\"", "file.sslverify": "off", "file.driver": "https", "file.url": "https://10.73.73.141/folder/esx6.5-rhel7.7-x86%5f64/esx6.5-rhel7.7-x86%5f64-flat.vmdk?dcPath=data&dsName=esx6.5-matrix", "file.timeout": 2000 } (raw) [scsi]

I think v2v uses value of timeout as int here

Comment 17 mxie@redhat.com 2020-03-19 09:12:46 UTC
Hi Peter, pls refer to virt-v2v-debug-log-bug1804750.log

Comment 18 mxie@redhat.com 2020-03-19 09:13:35 UTC
Created attachment 1671378 [details]
virt-v2v-debug-log-bug1804750.log

Comment 19 Richard W.M. Jones 2020-03-19 09:15:47 UTC
As far as I can tell, virt-v2v (at least back to 1.38) always used an integer
for the timeout field, and never a string.

Comment 20 Peter Krempa 2020-03-25 13:58:38 UTC
So I've created the qcow2 image using the command from the log file. (Modified to specify the image size as I don't have the correct cookie to authenticate). 

qemu-img 'create' '-q' '-f' 'qcow2' '-b' 'json: { "file.cookie": "vmware_soap_session=\"a4b94e2edfb6addc8fe12126f992af8eeacf8dea\"", "file.sslverify": "off", "file.driver": "https", "file.url": "https://10.73.73.141/folder/esx6.7-rhel8.2-x86%5f64/esx6.7-rhel8.2-x86%5f64-flat.vmdk?dcPath=data&dsName=esx6.7-matrix", "file.timeout": 2000 }' '-o' 'compat=1.1,backing_fmt=raw' '/var/tmp/v2vovl7ddc52.qcow2'
qemu-img: /var/tmp/v2vovl7ddc52.qcow2: CURL: Error opening file: The requested URL returned error: 401 Unauthorized
Could not open backing image to determine size.

The error is expected and I got the output file:

qemu-img info /var/tmp/v2vovl7ddc52.qcow2
image: /var/tmp/v2vovl7ddc52.qcow2
file format: qcow2
virtual size: 10 MiB (10485760 bytes)
disk size: 196 KiB
cluster_size: 65536
backing file: json: { "file.cookie": "vmware_soap_session=\"a4b94e2edfb6addc8fe12126f992af8eeacf8dea\"", "file.sslverify": "off", "file.driver": "https", "file.url": "https://10.73.73.141/folder/esx6.7-rhel8.2-x86%5f64/esx6.7-rhel8.2-x86%5f64-flat.vmdk?dcPath=data&dsName=esx6.7-matrix", "file.timeout": 2000 }
backing file format: raw
Format specific information:
    compat: 1.1
    lazy refcounts: false
    refcount bits: 16
    corrupt: false

I then tried starting the VM using the XML from the log file (some modifications were required to start it without libguestfs, but I kept the https backed disk):

$ virsh create v2v.xml 
error: Failed to create domain from v2v.xml
error: XML error: value of cookie 'vmware_soap_session' contains invalid characters

So this is a real problem, but a different one from the one reported. I'll be fixing that. Unfortunately the tests don't use validation and real tests were done with a different cookie.


At any rate, I've removed the quotes and got the expected 401 unauthorized:

error: internal error: process exited while connecting to monitor: 2020-03-25T13:52:18.466814Z qemu-system-x86_64: -blockdev {"driver":"https","url":"https://10.73.73.141:443/folder/esx6.7-rhel8.2-x86_64/esx6.7-rhel8.2-x86_64-flat.vmdk","sslverify":false,"cookie-secret":"libvirt-2-storage-httpcookie-secret0","timeout":2000,"node-name":"libvirt-2-storage","cache":{"direct":false,"no-flush":true},"auto-read-only":true,"discard":"unmap"}: CURL: Error opening file: The requested URL returned error: 401 Unauthorized


The "CURL: Error opening file: SSL certificate problem: unable to get local issuer certificate" error is printed only when ssl verification is not disabled, but I can't reproduce that issue with the above JSON string and the av-8.2 code base. In case you are able to reproduce it, please attach a full libvirtd debug [1] log and the VM log file (/var/log/libvirt/qemu/$VMNAME.log).

Moving back to assigned to track the relaxation of the validation.

[1] https://wiki.libvirt.org/page/DebugLogs

Comment 22 Peter Krempa 2020-03-27 14:53:16 UTC
Following commits accept quoted cookies

commit b9166baebe70a4b3577ddb6b2ee6af0dd4f60759
Author: Peter Krempa <pkrempa>
Date:   Wed Mar 25 16:06:39 2020 +0100

    virStorageSourceNetCookieValidate: Accept quoted cookie value
    
    The quotes are forbidden only inside the value, but the value itself may
    be enclosed in quotes. Fix the RNG schema and validator and add a test
    case.
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1804750
    
    Signed-off-by: Peter Krempa <pkrempa>
    Reviewed-by: Ján Tomko <jtomko>

commit c34ec56abad4b2286ef82a0a3ab9deb4d807a9bf
Author: Peter Krempa <pkrempa>
Date:   Wed Mar 25 16:18:50 2020 +0100

    qemuxml2xmltest: Wire up 'disk-network-http' case
    
    Signed-off-by: Peter Krempa <pkrempa>
    Reviewed-by: Ján Tomko <jtomko>

Comment 24 Peter Krempa 2020-03-30 14:50:02 UTC
And following commits parse the query part of the URI string:

commit 544ef82d05a675d9c6f939c67635ed46c094b164
Author: Peter Krempa <pkrempa>
Date:   Fri Mar 27 16:26:50 2020 +0100

    virStorageSourceParseBackingURI: Preserve query string of URI for http(s)
    
    For http/https URIs we need to preserve the query part as it may be
    important to refer to the image.
    
    Signed-off-by: Peter Krempa <pkrempa>
    Reviewed-by: Ján Tomko <jtomko>

commit 216860dd8b93c7da4d625055cf353e0eedda6093
Author: Peter Krempa <pkrempa>
Date:   Fri Mar 27 16:34:37 2020 +0100

    qemuBlockStorageSourceGetURI: Pass through query component
    
    If the storage source has the query part set, format it in the output.
    
    Signed-off-by: Peter Krempa <pkrempa>
    Reviewed-by: Ján Tomko <jtomko>

commit 56368124728f0d65dde07244c741b459fcd6b939
Author: Peter Krempa <pkrempa>
Date:   Mon Mar 30 14:54:02 2020 +0200

    conf: Add support for http(s) query strings
    
    Add a new attribute for holding the query part for http(s) disks.
    
    Signed-off-by: Peter Krempa <pkrempa>
    Reviewed-by: Ján Tomko <jtomko>

commit b24281c93405d6e3efb6edb3e7abff31628966b8
Author: Peter Krempa <pkrempa>
Date:   Mon Mar 30 14:46:04 2020 +0200

    docs: formatdomain: Mention missing protocols
    
    http, https, ftp, ftps, and tftp were not mentioned in the
    documentation. Note that 'ssh' is still omitted as it's used only
    internally.
    
    Signed-off-by: Peter Krempa <pkrempa>
    Reviewed-by: Ján Tomko <jtomko>

Comment 29 mxie@redhat.com 2020-04-02 16:10:11 UTC
Created attachment 1675825 [details]
v2v-libvirt-6.0.0-16.log

Comment 31 mxie@redhat.com 2020-04-03 03:43:47 UTC
Hi Peter,
   
   You're rignt, libvirtd service isn't restart automatically due to some reason(maybe a bug),  I can't reproduce the bug after restarting libvirtd service manually, thanks!

Verify the bug with below builds:
virt-v2v-1.40.2-22.module+el8.2.0+6029+618ef2ec.x86_64
libvirt-6.0.0-16.module+el8.2.0+6139+d66dece5.x86_64
qemu-kvm-4.2.0-17.module+el8.2.0+6141+0f540f16.x86_64

Steps:
1.Make sure environment variable 'LIBGUESTFS_BACKEND' is empty and libvirtd service is retarted
# echo $LIBGUESTFS_BACKEND

#systemctl libvirtd restart

2.Convert a guest from vmware without vddk by virt-v2v
# virt-v2v  -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 -o rhv-upload -os nfs_data -of raw --mac 00:50:56:ac:e5:3e:network:ovirtmgmt  -oc https://ibm-x3250m5-03.rhts.eng.pek2.redhat.com/ovirt-engine/api -op /home/rhvpasswd  -b ovirtmgmt esx6.7-rhel8.2-x86_64 -ip /home/passwd
[   0.6] Opening the source -i libvirt -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 esx6.7-rhel8.2-x86_64
[   2.3] Creating an overlay to protect the source from being modified
[   2.9] Opening the overlay
[  26.8] Inspecting the overlay
[ 123.2] Checking for sufficient free disk space in the guest
[ 123.2] Estimating space required on target for each disk
[ 123.2] Converting Red Hat Enterprise Linux 8.2 Beta (Ootpa) to run on KVM
virt-v2v: warning: guest tools directory ‘linux/el8’ is missing from
the virtio-win directory or ISO.

Guest tools are only provided in the RHV Guest Tools ISO, so this can
happen if you are using the version of virtio-win which contains just the
virtio drivers.  In this case only virtio drivers can be installed in the
guest, and installation of Guest Tools will be skipped.
virt-v2v: This guest has virtio drivers installed.
[ 717.9] Mapping filesystem data to avoid copying unused and blank areas
[ 720.1] Closing the overlay
[ 720.4] Assigning disks to buses
[ 720.4] Checking if the guest needs BIOS or UEFI to boot
[ 720.4] Initializing the target -o rhv-upload -oc https://ibm-x3250m5-03.rhts.eng.pek2.redhat.com/ovirt-engine/api -op /home/rhvpasswd -os nfs_data
[ 721.7] Copying disk 1/1 to qemu URI json:{ "file.driver": "nbd", "file.path": "/var/tmp/rhvupload.yCbGL2/nbdkit0.sock", "file.export": "/" } (raw)
    (100.00/100%)
[2817.3] Creating output metadata
[2818.9] Finishing off

Comment 36 Han Han 2020-04-15 00:47:06 UTC
mxie, please help to check if v2v works on libvirt-6.0.0-17.module+el8.2.0+6257+0d066c28.x86_64.

Comment 37 Peter Krempa 2020-04-15 09:10:46 UTC
Comment 31 contains the results of successful testing v2v on the -16 build.

Comment 38 mxie@redhat.com 2020-04-15 14:58:03 UTC
Verify the bug from v2v side with below builds:
virt-v2v-1.40.2-22.module+el8.2.0+6029+618ef2ec.x86_64
libvirt-6.0.0-17.module+el8.2.0+6257+0d066c28.x86_64
qemu-kvm-4.2.0-17.module+el8.2.0+6141+0f540f16.x86_64


Steps:
1.Make sure environment variable 'LIBGUESTFS_BACKEND' is empty and libvirtd service is retarted after updating libvirt 
# echo $LIBGUESTFS_BACKEND

## systemctl restart libvirtd

2.Convert a guest from vmware without vddk by virt-v2v
# virt-v2v  -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 -o rhv-upload -os nfs_data -of raw --mac 00:50:56:ac:e5:3e:network:ovirtmgmt  -oc https://ibm-x3250m5-03.rhts.eng.pek2.redhat.com/ovirt-engine/api -op /home/rhvpasswd  -b ovirtmgmt esx6.7-rhel8.2-x86_64 -ip /home/passwd
[   0.5] Opening the source -i libvirt -ic vpx://root.73.141/data/10.73.75.219/?no_verify=1 esx6.7-rhel8.2-x86_64
[   2.3] Creating an overlay to protect the source from being modified
[   2.9] Opening the overlay
[  26.0] Inspecting the overlay
[ 122.5] Checking for sufficient free disk space in the guest
[ 122.5] Estimating space required on target for each disk
[ 122.5] Converting Red Hat Enterprise Linux 8.2 Beta (Ootpa) to run on KVM
virt-v2v: warning: guest tools directory ‘linux/el8’ is missing from 
the virtio-win directory or ISO.

Guest tools are only provided in the RHV Guest Tools ISO, so this can 
happen if you are using the version of virtio-win which contains just the 
virtio drivers.  In this case only virtio drivers can be installed in the 
guest, and installation of Guest Tools will be skipped.
virt-v2v: This guest has virtio drivers installed.
[ 715.8] Mapping filesystem data to avoid copying unused and blank areas
[ 717.6] Closing the overlay
[ 717.9] Assigning disks to buses
[ 717.9] Checking if the guest needs BIOS or UEFI to boot
[ 717.9] Initializing the target -o rhv-upload -oc https://ibm-x3250m5-03.rhts.eng.pek2.redhat.com/ovirt-engine/api -op /home/rhvpasswd -os nfs_data
[ 719.1] Copying disk 1/1 to qemu URI json:{ "file.driver": "nbd", "file.path": "/var/tmp/rhvupload.evPuvt/nbdkit0.sock", "file.export": "/" } (raw)
    (100.00/100%)
[2872.4] Creating output metadata
[2874.0] Finishing off

Result:
    V2V conversion can finish successfully and checkpoints of guest are passed, so the bug has been fixed from v2v side.

Comment 39 Han Han 2020-04-16 02:36:03 UTC
Verified by comment32 and comment38

Comment 42 errata-xmlrpc 2020-05-05 09:57:19 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/RHBA-2020:2017


Note You need to log in before you can comment on or make changes to this bug.