virsh edit does not work when <initiator> and <auth> is used in config

Fourhundred Thecat 400thecat at gmx.ch
Thu Jun 25 03:53:03 UTC 2020


Hello,

I am having problem when using: "virsh edit <vm_name>"

my VM has network iscsi disk defined:


     <disk type='network' device='disk'>
       <driver name='qemu' type='raw'/>
       <source protocol='iscsi'
name='iqn.1992-08.com.netapp:5481.60080e50001ff2000000000051aee24d/0'>
         <host name='10.1.212.52' port='3260'/>

         <initiator>
           <iqn name='iqn.2013-01.bla.bla:01:test'/>
         </initiator>

         <auth username='myname'>
           <secret type='iscsi' usage='libvirtiscsi'/>
         </auth>

       </source>
     ...
     </disk>

when I defined thje VM the first time, as always, libvirt reorders the
lines in the XML config file as it likes.

One of the reordering it did, was to put the "<initiator>" block above
the "<auth>" block.

But once I want to edit, "virsh edit <vm_name>", whatever change I make,
even unrelated to iscsi disk, it reports error:

error: XML document failed to validate against schema: Unable to
validate doc against /usr/share/libvirt/schemas/domain.rng
Extra element devices in interleave
Element domain failed to validate content


after long trial and error, I found I can finally save it when I reorder
the

"<initiator>" and "<auth>" blocks, so that  "<auth>" is above
"<initiator>". Once i save it, libvirt then reorders it back to the
order, which will generate erro next time I attemt to edit.

Anyway, this seems like a bug, and especially evil one.

How could I get rid of this behaviour?

thanks,





More information about the libvirt-users mailing list