Created attachment 1735990 [details] vmware-guset-with-nonexistent-iso.png Created attachment 1735990 [details] vmware-guset-with-nonexistent-iso.png Description of problem: Can't dump the xml of VMware guest if the guest is attached a nonexistent iso file Version-Release number of selected component (if applicable): libvirt-6.10.0-1.module+el8.4.0+8898+a84e86e1.x86_64 qemu-kvm-5.2.0-0.module+el8.4.0+8855+a9e237a9.x86_64 How reproducible: 100% Steps to Reproduce: 1. There is windows guest which has attached a nonexistent iso file on VMware, pls see the attached screenshot "vmware-guest-with-nonexistent-iso.png" 2. Fail to use virsh to dump the xml of guest from VMware # virsh -c vpx://root.198.169/data/10.73.199.217/?no_verify=1 dumpxml esx7.0-win2012r2-x86_64 Enter root's password for 10.73.198.169: error: internal error: File name '/vmfs/volumes/f84f070c-0d65498d/win-iso/en_windows_server_2012_r2_x64_dvd_2707946.iso' refers to non-existing datastore 'f84f070c-0d65498d' Actual results: As above description Expected results: Can dump the xml of VMware windows guest if the guest is attached a nonexistent iso file successfully Additional info: 1.Can't reproduce the problem on rhel8.3 fast stream Package version: libvirt-6.6.0-8.module+el8.3.1+8648+130818f2.x86_64 qemu-kvm-5.1.0-16.module+el8.3.1+8958+410ab178.x86_64 # virsh -c vpx://root.198.169/data/10.73.199.217/?no_verify=1 dumpxml esx7.0-win2012r2-x86_64 Enter root's password for 10.73.198.169: <domain type='vmware' xmlns:vmware='http://libvirt.org/schemas/domain/vmware/1.0'> <name>esx7.0-win2012r2-x86_64</name> ..... <devices> <disk type='file' device='disk'> <source file='[esx7.0-matrix] esx7.0-win2012r2-x86_64/esx7.0-win2012r2-x86_64.vmdk'/> <target dev='sda' bus='scsi'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> <controller type='scsi' index='0' model='lsisas1068'/> <interface type='bridge'> <mac address='00:50:56:83:17:d8' type='generated'/> <source bridge='VM Network'/> <model type='e1000e'/> </interface> ...... </domain> 2.Also can't reproduce the problem on rhel8.4 slow stream Package version: libvirt-6.0.0-30.module+el8.4.0+8705+34397d87.x86_64 qemu-kvm-4.2.0-37.module+el8.4.0+8837+c89bcfe6.x86_64 # virsh -c vpx://root.198.169/data/10.73.199.217/?no_verify=1 dumpxml esx7.0-win2012r2-x86_64 Enter root's password for 10.73.198.169: <domain type='vmware' xmlns:vmware='http://libvirt.org/schemas/domain/vmware/1.0'> <name>esx7.0-win2012r2-x86_64</name> ..... <devices> <disk type='file' device='disk'> <source file='[esx7.0-matrix] esx7.0-win2012r2-x86_64/esx7.0-win2012r2-x86_64.vmdk'/> <target dev='sda' bus='scsi'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> <controller type='scsi' index='0' model='lsisas1068'/> <interface type='bridge'> <mac address='00:50:56:83:17:d8'/> <source bridge='VM Network'/> <model type='e1000e'/> </interface> ..... </domain>
Created attachment 1736040 [details] vmware-guset-with-nonexistent-iso.vmx
So the original way this worked was that the drive got skipped and not included in the output, right? I think libvirt APIs should be close to the VMWare behaviour. What happens when you try starting such guest? Does it boot without that device? Or with empty cdrom?
(In reply to Martin Kletzander from comment #2) > So the original way this worked was that the drive got skipped and not > included in the output, right? I think libvirt APIs should be close to the > VMWare behaviour. What happens when you try starting such guest? Does it > boot without that device? Or with empty cdrom? VMware Guest can boot into OS normally if this non-existent iso file is attached to the guest, pls refer to screenshot"vmware-guest-poweron-with-nonexistent-iso"
Created attachment 1736435 [details] vmware-guest-poweron-with-nonexistent-iso.png
So from the guest the DVD drive looks just empty? OK, we can do something with that. Thanks for the info.
Patch posted upstream: https://www.redhat.com/archives/libvir-list/2020-December/msg00840.html
And a v2: https://www.redhat.com/archives/libvir-list/2020-December/msg00846.html
And a v3: https://www.redhat.com/archives/libvir-list/2021-January/msg00133.html
Fixed upstream with v6.10.0-298-g697a33b3b381..v6.10.0-305-g3b364c6509db: commit 697a33b3b381cce7ab34150ab14fffbb839f5af0 Author: Martin Kletzander <mkletzan> Date: Mon Dec 21 14:38:30 2020 +0100 esx: Unindent unnecessary conditional branch commit 49d0e0c3e6616ac1a8699982697366280c083dff Author: Martin Kletzander <mkletzan> Date: Mon Dec 21 16:56:25 2020 +0100 tests: Use g_autofree in testParseVMXFileName commit c1286d50e2598972815394bfb6ae49c532ec48a8 Author: Martin Kletzander <mkletzan> Date: Mon Dec 21 14:48:49 2020 +0100 vmx: Make virVMXParseFileName return an integer commit 152be66eafbf824ca1317de60ba0cbee1bc1a98f Author: Martin Kletzander <mkletzan> Date: Tue Jan 5 14:19:21 2021 +0100 tests: Allow testing for parse failures in vmx2xmltest commit eb07c7e56330a01f64d98a8c109ff66b5a6bd1de Author: Martin Kletzander <mkletzan> Date: Mon Dec 21 16:51:31 2020 +0100 vmx: Allow missing cdrom image file in virVMXParseFileName commit 6c001a37e4009b6a3b3aecd3c3717e951e8f9011 Author: Martin Kletzander <mkletzan> Date: Tue Jan 5 14:19:34 2021 +0100 tests: Test vmx files with missing images commit 2e6c13148749ce3f61980f922e6901d7b5557cfb Author: Martin Kletzander <mkletzan> Date: Tue Jan 5 13:58:53 2021 +0100 esx: Handle missing images in esxParseVMXFileName commit 3b364c6509db4ff643bdde3f8c5cd620304e64b4 Author: Martin Kletzander <mkletzan> Date: Mon Dec 21 16:34:32 2020 +0100 vmx: Treat missing cdrom-image as empty drive
Verify the bug with below builds: libvirt-client-7.0.0-1.module+el8.4.0+9464+3e71831a.x86_64 qemu-kvm-5.2.0-2.module+el8.4.0+9186+ec44380f.x86_64 Steps: 1.Prepare a windows guest which has attached a nonexistent iso file on VMware 2.Use virsh to dump the xml of VMware guest # virsh -c vpx://root.198.169/data/10.73.199.217/?no_verify=1 dumpxml esx7.0-win2012r2-x86_64 Enter root's password for 10.73.198.169: <domain type='vmware' xmlns:vmware='http://libvirt.org/schemas/domain/vmware/1.0'> <name>esx7.0-win2012r2-x86_64</name> ..... <devices> <disk type='file' device='disk'> <source file='[esx7.0-matrix] esx7.0-win2012r2-x86_64/esx7.0-win2012r2-x86_64.vmdk'/> <target dev='sda' bus='scsi'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> <disk type='file' device='cdrom'> <target dev='sda' bus='sata'/> <address type='drive' controller='0' bus='0' target='0' unit='0'/> </disk> ..... Result: Virsh can dump the xml of VMware guest when CD-ROM device of guest is attached a non-existent iso file, so move the bug from ON_QA to VERIFIED
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:2098