Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-58446

Opening a vpx:// URL fails if the backing VMX file has a "*" character in any key

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • rhel-9.6
    • rhel-9.4
    • libvirt
    • None
    • libvirt-10.8.0-1.el9
    • No
    • Important
    • ZStream
    • Customer Escalated
    • rhel-sst-virt-tools
    • ssg_virtualization
    • 11
    • 3
    • Dev ack
    • False
    • Hide

      None

      Show
      None
    • None
    • Migration Toolkit for Virtualization
    • None
    • Approved Blocker
    • x86_64
    • 10.8.0
    • None

      What were you trying to do that didn't work?

      Migrate a VM from VMware using Migration Toolkit for Virtualization 

      What is the impact of this issue to you?

      Critical - blocking migration of 35,000 VMs to openshift 

      Please provide the package NVR for which the bug is seen:

      How reproducible is this bug?:

      Seen on multiple VM migration attempts 

      Steps to reproduce

      Attempt to migrate VM using MTV 

      Expected results

      Migration succeeds

      Actual results

      Preparing virt-v2v

      2exec: /usr/bin/virt-v2v v -x --root first -i libvirt -ic vpx://SVC59616%40example.local@example.example.local/WKLD-Domain-VHHN-DC/host/Cluster_VHH45W01N%20%20STANDARD%20LINUX%20%28max.16vCPU-192GB%29/esx-example.example.local?no_verify=1 -o local -os /var/tmp/v2v -ip /etc/secret/secretKey -it vddk -io vddk-libdir=/opt/vmware-vix-disklib-distrib -io vddk-thumbprint=0D:FA:FE:D0:B2:57:CC:2E:2E:A0:FC:7A:0F:3B:6F:7A:4D:2F:34:DE – is-uxautohub01s

      3virt-v2v monitoring: Setting up prometheus endpoint :2112/metrics

      4virt-v2v monitoring: Prometheus progress counter registered.

      5virt-v2v: virt-v2v 2.4.0rhel=9,release=4.el9_4 (x86_64)

      6libvirt version: 10.0.0

      7check_host_free_space: large_tmpdir=/var/tmp free_space=345146433536

      8[ 0.0] Setting up the source: i libvirt -ic vpx://SVC59616%40example.local@example.example.local/WKLD-Domain-VHHN-DC/host/Cluster_VHH45W01N%20%20STANDARD%20LINUX%20%28max.16vCPU-192GB%29/esx-example.example.local?no_verify=1 -it vddk is-uxautohub01s

      9virt-v2v: error: exception: libvirt: VIR_ERR_CONF_SYNTAX: VIR_FROM_CONF: configuration file syntax error: memory conf:74: expecting an assignment

      10rm -rf – '/tmp/v2v.29uC4B'

      11Error executing command: exit status 1

      12Error executing virt-v2v command exit status 1

            [RHEL-58446] Opening a vpx:// URL fails if the backing VMX file has a "*" character in any key

            The 'blocked by' issue RHEL-50574 is transitioned to Release Pending.

            RHEL Jira bot added a comment - The 'blocked by' issue RHEL-50574 is transitioned to Release Pending.

            Ming Xie added a comment -

            Test the bug with below builds:
            libvirt-libs-10.8.0-2.el9.x86_64
            qemu-img-9.1.0-1.el9.x86_64
            virt-v2v-2.6.0-1.el9.x86_64

             

            Steps:
            1. Prepare a VMware guest and its vmx file contains info 'pciPassthru*.present = "False" '

            #cat Auto-esx8.0-rhel8-vmx-contains-specical-char-_/Auto-esx8.0-rhel8-vmx-contains-specical-char-_.vmx |grep pciPassthru
            pciPassthru*.present = "False"
            

            2. Get the libvirtxml of VMware guest by virsh

            # virsh -c vpx://non-admin%40vsphere.local@10.73.212.129/data/10.73.212.36/?no_verify=1 dumpxml Auto-esx8.0-rhel8-vmx-contains-specical-char-*
            Enter non-admin@vsphere.local's password for 10.73.212.129: 
            <domain type='vmware' xmlns:vmware='http://libvirt.org/schemas/domain/vmware/1.0'>
              <name>Auto-esx8.0-rhel8-vmx-contains-specical-char-*</name>
              <uuid>42207a0f-feb2-200a-4320-7964db0679b6</uuid>
              <memory unit='KiB'>2097152</memory>
              <currentMemory unit='KiB'>2097152</currentMemory>
              <vcpu placement='static'>4</vcpu>
              <cputune>
                <shares>4000</shares>
              </cputune>
              <os firmware='efi'>
                <type arch='x86_64'>hvm</type>
              </os>
              <clock offset='utc'/>
              <on_poweroff>destroy</on_poweroff>
              <on_reboot>restart</on_reboot>
              <on_crash>destroy</on_crash>
              <devices>
                <disk type='file' device='disk'>
                  <source file='[esx8.0-function] Auto-esx8.0-rhel8-vmx-contains-specical-char-_/Auto-esx8.0-rhel8-vmx-contains-specical-char-_.vmdk'/>
                  <target dev='sda' bus='scsi'/>
                  <address type='drive' controller='0' bus='0' target='0' unit='0'/>
                </disk>
                <disk type='file' device='cdrom'>
            ......
            </domain>

            3. Convert the guest from VMware by virt-v2v

            # virt-v2v -ic vpx://non-admin%40vsphere.local@10.73.212.129/data/10.73.212.36/?no_verify=1 -it vddk -io vddk-libdir=/home/vddk8.0.3 -io vddk-thumbprint=CB:9F:B1:9D:33:49:6C:60:AD:3C:A5:16:77:91:5F:CD:1B:24:B1:43 -ip /home/passwd Auto-esx8.0-rhel8-vmx-contains-specical-char-* --move /var/tmp:/root --hostname virt.example.com
            [   0.0] Setting up the source: -i libvirt -ic vpx://non-admin%40vsphere.local@10.73.212.129/data/10.73.212.36/?no_verify=1 -it vddk Auto-esx8.0-rhel8-vmx-contains-specical-char-*
            [   1.7] Opening the source
            [   7.3] Inspecting the source
            [  17.6] Checking for sufficient free disk space in the guest
            [  17.6] Converting Red Hat Enterprise Linux 8.6 (Ootpa) (rhel8.6) to run on KVM
            virt-v2v: This guest has virtio drivers installed.
            [  61.5] Setting a random seed
            [  61.5] Moving: /var/tmp -> /root
            [  61.5] Setting the hostname: virt.example.com
            [  61.6] SELinux relabelling
            [  80.8] Mapping filesystem data to avoid copying unused and blank areas
            [  81.6] Closing the overlay
            [  81.9] Assigning disks to buses
            [  81.9] Checking if the guest needs BIOS or UEFI to boot
            virt-v2v: This guest requires UEFI on the target to boot.
            [  81.9] Setting up the destination: -o libvirt
            [  83.6] Copying disk 1/1
            █ 100% [****************************************]
            [ 252.1] Creating output metadata
            [ 252.1] Finishing off
            

            4. Check the guest after v2v conversion, the checkpoints of the guest are passed

            Test result: the bug has been fixed

            Ming Xie added a comment - Test the bug with below builds: libvirt-libs-10.8.0-2.el9.x86_64 qemu-img-9.1.0-1.el9.x86_64 virt-v2v-2.6.0-1.el9.x86_64   Steps: 1. Prepare a VMware guest and its vmx file contains info 'pciPassthru*.present = "False" ' #cat Auto-esx8.0-rhel8-vmx-contains-specical- char -_/Auto-esx8.0-rhel8-vmx-contains-specical- char -_.vmx |grep pciPassthru pciPassthru*.present = "False" 2. Get the libvirtxml of VMware guest by virsh # virsh -c vpx: //non-admin%40vsphere.local@10.73.212.129/data/10.73.212.36/?no_verify=1 dumpxml Auto-esx8.0-rhel8-vmx-contains-specical- char -* Enter non-admin@vsphere.local's password for 10.73.212.129:  <domain type= 'vmware' xmlns:vmware= 'http: //libvirt.org/schemas/domain/vmware/1.0' >   <name>Auto-esx8.0-rhel8-vmx-contains-specical- char -*</name>   <uuid>42207a0f-feb2-200a-4320-7964db0679b6</uuid>   <memory unit= 'KiB' >2097152</memory>   <currentMemory unit= 'KiB' >2097152</currentMemory>   <vcpu placement= ' static ' >4</vcpu>   <cputune>     <shares>4000</shares>   </cputune>   <os firmware= 'efi' >     <type arch= 'x86_64' >hvm</type>   </os>   <clock offset= 'utc' />   <on_poweroff>destroy</on_poweroff>   <on_reboot>restart</on_reboot>   <on_crash>destroy</on_crash>   <devices>     <disk type= 'file' device= 'disk' >       <source file= '[esx8.0-function] Auto-esx8.0-rhel8-vmx-contains-specical- char -_/Auto-esx8.0-rhel8-vmx-contains-specical- char -_.vmdk' />       <target dev= 'sda' bus= 'scsi' />       <address type= 'drive' controller= '0' bus= '0' target= '0' unit= '0' />     </disk>     <disk type= 'file' device= 'cdrom' > ...... </domain> 3. Convert the guest from VMware by virt-v2v # virt-v2v -ic vpx: //non-admin%40vsphere.local@10.73.212.129/data/10.73.212.36/?no_verify=1 -it vddk -io vddk-libdir=/home/vddk8.0.3 -io vddk-thumbprint=CB:9F:B1:9D:33:49:6C:60:AD:3C:A5:16:77:91:5F:CD:1B:24:B1:43 -ip /home/passwd Auto-esx8.0-rhel8-vmx-contains-specical- char -* --move / var /tmp:/root --hostname virt.example.com [   0.0] Setting up the source: -i libvirt -ic vpx: //non-admin%40vsphere.local@10.73.212.129/data/10.73.212.36/?no_verify=1 -it vddk Auto-esx8.0-rhel8-vmx-contains-specical- char -* [   1.7] Opening the source [   7.3] Inspecting the source [  17.6] Checking for sufficient free disk space in the guest [  17.6] Converting Red Hat Enterprise Linux 8.6 (Ootpa) (rhel8.6) to run on KVM virt-v2v: This guest has virtio drivers installed. [  61.5] Setting a random seed [  61.5] Moving: / var /tmp -> /root [  61.5] Setting the hostname: virt.example.com [  61.6] SELinux relabelling [  80.8] Mapping filesystem data to avoid copying unused and blank areas [  81.6] Closing the overlay [  81.9] Assigning disks to buses [  81.9] Checking if the guest needs BIOS or UEFI to boot virt-v2v: This guest requires UEFI on the target to boot. [  81.9] Setting up the destination: -o libvirt [  83.6] Copying disk 1/1 █ 100% [****************************************] [ 252.1] Creating output metadata [ 252.1] Finishing off 4. Check the guest after v2v conversion, the checkpoints of the guest are passed Test result: the bug has been fixed

            No Permission: Watson Automation set this Blocker/Exception as "Approved".

            RHEL Jira bot added a comment - No Permission: Watson Automation set this Blocker/Exception as "Approved".

            Richard Jones added a comment - Upstream in https://gitlab.com/libvirt/libvirt/-/commit/94e8a5b650a270c28ebfce22a1bd834f88a095a3

            Ming Xie added a comment - - edited

            I can reproduce the bug with below builds:
            libvirt-libs-10.5.0-7.el9_5.x86_64
            qemu-img-9.0.0-10.el9_5.x86_64
            virt-v2v-2.5.6-6.el9_5.x86_64

            Steps to reproduce:

            1. Modify the vmx file of VMware guest on ESXi host by adding info 'pciPassthru*.present = "False" '

            #cat zzz/zzz.vmx |grep pciPass
            pciPassthru*.present = "False"
            

            2. Delete the guest from vsphere client and register the guest from modified vmx file
            3. Can't convert the guest from VMware by virt-v2v via https

            # virt-v2v -ic vpx://non-admin%40vsphere.local@10.73.212.129/data/10.73.212.36/?no_verify=1  -it vddk -io vddk-libdir=/home/vddk8.0.3 -io vddk-thumbprint=CB:9F:B1:9D:33:49:6C:60:AD:3C:A5:16:77:91:5F:CD:1B:24:B1:43 -ip /home/passwd  esx8.0-rhel8-for-bug-RHEL-58446
            [   0.0] Setting up the source: -i libvirt -ic vpx://non-admin%40vsphere.local@10.73.212.129/data/10.73.212.36/?no_verify=1 -it vddk esx8.0-rhel8-for-bug-RHEL-58446
            virt-v2v: error: exception: libvirt: VIR_ERR_CONF_SYNTAX: VIR_FROM_CONF: 
            configuration file syntax error: memory conf:72: expecting an assignmentIf reporting bugs, run virt-v2v with debugging enabled and include the 
            complete output:  virt-v2v -v -x [...] 

            4.Can convert the guest from VMware by virt-v2v via vmx

            # virt-v2v -i vmx -it ssh ssh://root@10.73.212.36/vmfs/volumes/datastore1/zzz/zzz.vmx -ip /home/esxpwd
            [   0.0] Setting up the source: -i vmx ssh://root@10.73.212.36/vmfs/volumes/datastore1/zzz/zzz.vmx
            [   4.1] Opening the source
            [  24.8] Inspecting the source
            [  36.7] Checking for sufficient free disk space in the guest
            [  36.7] Converting Red Hat Enterprise Linux 8.6 (Ootpa) to run on KVM
            virt-v2v: This guest has virtio drivers installed.
            [ 121.3] Mapping filesystem data to avoid copying unused and blank areas
            [ 122.7] Closing the overlay
            [ 123.0] Assigning disks to buses
            [ 123.0] Checking if the guest needs BIOS or UEFI to boot
            virt-v2v: This guest requires UEFI on the target to boot.
            [ 123.0] Setting up the destination: -o libvirt
            [ 124.9] Copying disk 1/1
            █ 100% [****************************************]
            [ 231.7] Creating output metadata
            [ 231.7] Finishing off 

            Ming Xie added a comment - - edited I can reproduce the bug with below builds: libvirt-libs-10.5.0-7.el9_5.x86_64 qemu-img-9.0.0-10.el9_5.x86_64 virt-v2v-2.5.6-6.el9_5.x86_64 Steps to reproduce: 1. Modify the vmx file of VMware guest on ESXi host by adding info 'pciPassthru*.present = "False" ' #cat zzz/zzz.vmx |grep pciPass pciPassthru*.present = "False" 2. Delete the guest from vsphere client and register the guest from modified vmx file 3. Can't convert the guest from VMware by virt-v2v via https # virt-v2v -ic vpx: //non-admin%40vsphere.local@10.73.212.129/data/10.73.212.36/?no_verify=1  -it vddk -io vddk-libdir=/home/vddk8.0.3 -io vddk-thumbprint=CB:9F:B1:9D:33:49:6C:60:AD:3C:A5:16:77:91:5F:CD:1B:24:B1:43 -ip /home/passwd  esx8.0-rhel8- for -bug-RHEL-58446 [   0.0] Setting up the source: -i libvirt -ic vpx: //non-admin%40vsphere.local@10.73.212.129/data/10.73.212.36/?no_verify=1 -it vddk esx8.0-rhel8- for -bug-RHEL-58446 virt-v2v: error: exception: libvirt: VIR_ERR_CONF_SYNTAX: VIR_FROM_CONF:  configuration file syntax error: memory conf:72: expecting an assignmentIf reporting bugs, run virt-v2v with debugging enabled and include the  complete output:  virt-v2v -v -x [...] 4.Can convert the guest from VMware by virt-v2v via vmx # virt-v2v -i vmx -it ssh ssh: //root@10.73.212.36/vmfs/volumes/datastore1/zzz/zzz.vmx -ip /home/esxpwd [   0.0] Setting up the source: -i vmx ssh: //root@10.73.212.36/vmfs/volumes/datastore1/zzz/zzz.vmx [   4.1] Opening the source [  24.8] Inspecting the source [  36.7] Checking for sufficient free disk space in the guest [  36.7] Converting Red Hat Enterprise Linux 8.6 (Ootpa) to run on KVM virt-v2v: This guest has virtio drivers installed. [ 121.3] Mapping filesystem data to avoid copying unused and blank areas [ 122.7] Closing the overlay [ 123.0] Assigning disks to buses [ 123.0] Checking if the guest needs BIOS or UEFI to boot virt-v2v: This guest requires UEFI on the target to boot. [ 123.0] Setting up the destination: -o libvirt [ 124.9] Copying disk 1/1 █ 100% [****************************************] [ 231.7] Creating output metadata [ 231.7] Finishing off

            Richard Jones added a comment - Patch posted: https://lists.libvirt.org/archives/list/devel@lists.libvirt.org/thread/3LABIOC4F4A3CUPQRK3GW5AO2U2WQRYX/

            Virt-v2v's vmx parser allows anything which is non-whitespace and non-'=':

            https://github.com/libguestfs/virt-v2v/blob/28eca7457995cb927e7926659629685476982cdf/input/parse_vmx.ml#L229

            Richard Jones added a comment - Virt-v2v's vmx parser allows anything which is non-whitespace and non-'=': https://github.com/libguestfs/virt-v2v/blob/28eca7457995cb927e7926659629685476982cdf/input/parse_vmx.ml#L229

            The root cause is the 'virConfParseName' method only allowing  alpha-numeric, _, :, ., -  in key names. Either we add '*' to this list, or allow any non-whitespace char for VMX.

            Daniel Berrangé added a comment - The root cause is the 'virConfParseName' method only allowing  alpha-numeric, _, :, ., -  in key names. Either we add '*' to this list, or allow any non-whitespace char for VMX.

            The .vmx file supplied contains a "*" character in one of the keys:

            pciPassthru*.present = "False"
            

            Richard Jones added a comment - The .vmx file supplied contains a "*" character in one of the keys: pciPassthru*.present = "False"

              jdenemar@redhat.com Jiri Denemark
              shaselde@redhat.com Sean Haselden
              virt-maint virt-maint
              Ming Xie Ming Xie
              Votes:
              1 Vote for this issue
              Watchers:
              21 Start watching this issue

                Created:
                Updated: