RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2026199 - virt-v2v: error: <disk><driver type="format"> attribute is missing from the libvirt XML
Summary: virt-v2v: error: <disk><driver type="format"> attribute is missing from the l...
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: libvirt
Version: 8.6
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: rc
: ---
Assignee: Jaroslav Suchanek
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-24 03:33 UTC by Xiaodai Wang
Modified: 2021-11-24 11:26 UTC (History)
15 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-11-24 11:26:11 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker RHELPLAN-103786 0 None None None 2021-11-24 03:36:42 UTC

Description Xiaodai Wang 2021-11-24 03:33:12 UTC
Description of problem:
virt-v2v: error: <disk><driver type="format"> attribute is missing from the libvirt XML

Version-Release number of selected component (if applicable):
virt-v2v-1.42.0-17.module+el8.6.0+13435+b5ec01cb.x86_64
qemu-kvm-6.1.0-4.module+el8.6.0+13039+4b81a1dc.x86_64
libvirt-7.9.0-1.module+el8.6.0+13150+28339563.x86_64

How reproducible:
100%

Steps to Reproduce:
Convert a VM from VMware by v2v.

# virt-v2v -i libvirt -ic vpx://root.x.x/data/x.x.x.x/?no_verify=1 esx7.0-rhel8.3-x86_64-gating-2 -it vddk  -io vddk-libdir=/root/vddk_libdir/latest -io vddk-thumbprint=xx -o null -ip /root/v2v_vpx_passwd -v -x
virt-v2v: virt-v2v 1.42.0rhel=8,release=17.module+el8.6.0+13435+b5ec01cb (x86_64)
libvirt version: 7.9.0
[   0.0] Opening the source -i libvirt -ic vpx://root.x.x/data/x.x.x.x/?no_verify=1 esx7.0-rhel8.3-x86_64-gating-2 -it vddk  -io vddk-libdir=/root/vddk_libdir/latest -io vddk-thumbprint=xx
libvirt xml is:
<domain type='vmware' xmlns:vmware='http://libvirt.org/schemas/domain/vmware/1.0'>
  <name>esx7.0-rhel8.3-x86_64-gating-2</name>
  <uuid>42397974-17ae-a92e-9491-3f94704dd6e2</uuid>
  <memory unit='KiB'>2097152</memory>
  <currentMemory unit='KiB'>2097152</currentMemory>
  <vcpu placement='static'>1</vcpu>
  <cputune>
    <shares>1000</shares>
  </cputune>
  <os>
    <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='[datastore2] esx7.0-rhel8.3-x86_64-gating-2/esx7.0-rhel8.3-x86_64-gating-2.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='hda' bus='ide'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <controller type='scsi' index='0' model='vmpvscsi'/>
    <controller type='ide' index='0'/>
    <interface type='bridge'>
      <mac address='00:50:56:b9:1b:52' type='generated'/>
      <source bridge='VM Network'/>
      <model type='vmxnet3'/>
    </interface>
    <video>
      <model type='vmvga' vram='8192' primary='yes'/>
    </video>
  </devices>
  <vmware:datacenterpath>data</vmware:datacenterpath>
  <vmware:moref>vm-1012</vmware:moref>
</domain>

virt-v2v: error: <disk><driver type="format"> attribute is missing from the
libvirt XML
rm -rf '/var/tmp/null.qLpkfa'

Actual results:
virt-v2v: error: <disk><driver type="format"> attribute is missing from the
libvirt XML

Expected results:
Libvirt should add the <driver type="format"> into the xml.

Additional info:
This blocks virt-v2v. If it's a v2v issue, please help to reassign it
to v2v, thanks.

Comment 4 Peter Krempa 2021-11-24 09:42:24 UTC
One thing to note is that none of our vmware test data captured from real vmware instances seem to contain the <driver type=''> attribute for disks at all:

E.g. in tests/vmx2xmldata/esx-in-the-wild-8.xml

    <disk type='file' device='disk'>
      <source file='[datastore] directory/RHEL7_6.vmdk'/>
      <target dev='sda' bus='scsi'/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>
    <disk type='file' device='disk'>
      <source file='[datastore] directory/RHEL7_6_1.vmdk'/>
      <target dev='sdb' bus='scsi'/>
      <transient/>
      <address type='drive' controller='0' bus='0' target='0' unit='1'/>
    </disk>
    <disk type='file' device='disk'>
      <source file='[5669422e-699d77db-c144-00e0815e303e] block4/block4.vmdk'/>
      <target dev='sdc' bus='scsi'/>
      <address type='drive' controller='0' bus='0' target='0' unit='2'/>
    </disk>
    <disk type='file' device='cdrom'>
      <source file='[692eb778-2d4937fe] CentOS-4.7.ServerCD-x86_64.iso'/>
      <target dev='sda' bus='sata'/>
      <readonly/>
      <address type='drive' controller='0' bus='0' target='0' unit='0'/>
    </disk>

There is one instance in 'tests/vmx2xmldata/esx-in-the-wild-2.xml' having <driver cache='writethrough'/> but that's it.

Comment 5 Richard W.M. Jones 2021-11-24 10:02:54 UTC
I don't think this is actually a bug in libvirt, or at least it's a sort of
bug but not a test blocker.  Below is my analysis from email.

---

I don't think this is a libvirt bug actually.  In the code we don't
expect libvirt to return a type here, and so we substitute "raw"
format always:

https://github.com/libguestfs/virt-v2v/blob/a3d09f8a7435270e376a53d241ee54c2ebab2b0d/v2v/input_libvirt_vcenter_https.ml#L95

However before we reach this code, we go through parse_libvirt_domain
here which gives the error about the missing type/format:

https://github.com/libguestfs/virt-v2v/blob/a3d09f8a7435270e376a53d241ee54c2ebab2b0d/v2v/parse_libvirt_xml.ml#L270

So this needs another fix in virt-v2v 1.44.  I think we can keep the
same bug (bug 2025769) for the extra fix.

Comment 6 Xiaodai Wang 2021-11-24 10:16:12 UTC
Since QEMU requires the attribute, if libvirt can provide it, then
other applications using libvirt will not have to handle it by themselves.
I'm not sure about it.

Comment 7 Richard W.M. Jones 2021-11-24 10:26:02 UTC
That's an argument in favour of providing it.  The next issue is whether
libvirt can determine the format.  In Peter's example (comment 4) there are
VMDK files (type="vmdk"), and an ISO (probably type="raw").  However the
underlying VMX file doesn't expose the format.  It may be possible to guess
based on file extension or the .deviceType field.

Note that virt-v2v will always want to replace this with "raw" because
we actually use either the -flat.vmdk file (really a raw file) or VDDK
(exposes raw blocks), so having libvirt provide the true type doesn't really
help us.

Comment 8 Xiaodai Wang 2021-11-24 10:50:29 UTC
ok, I see, thanks.
so I think this bug could be closed as WONT_FIX and use bug 2025769
to track the issue.

Comment 9 Jaroslav Suchanek 2021-11-24 11:26:11 UTC
Closing based on previous comments, please reopen if there is anything libvirt should fixed. Thanks.


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