Hello,

I hit a bug, and just want to share a solution.

VM with a payload (Initial run) do not start with libvirt >= 1.3.2. VDSM log 
says: "libvirtError: unsupported configuration: Disks 'hdc' and 'hdd' have 
identical serial".

Yes, both cdrom devices have the same serial. Empty serial:

                <disk device="cdrom" snapshot="no" type="file">
                        <source 
file="/var/run/vdsm/payload/2eaf9c8e-2123-4b48-9b62-f96168ac7a36.41f22cb1676858ad4e22e8440519032d.img"
 startupPolicy="optional"/>
                        <target bus="ide" dev="hdd"/>
                        <readonly/>
                        <serial/>
                </disk>
                <disk device="cdrom" snapshot="no" type="file">
                        <source file="" startupPolicy="optional"/>
                        <target bus="ide" dev="hdc"/>
                        <readonly/>
                        <serial/>
                </disk>

I don't know where is the issue. Either libvirt should work with empty serials, 
or VDSM should generate serial at least for payload device.

Related bug -  https://bugzilla.redhat.com/show_bug.cgi?id=1245013

Quick fix is to install a VDSM hook to /usr/libexec/vdsm/hooks/before_vm_start:
---------- cut here ----------
#!/usr/bin/python

import hooking
import uuid

domxml = hooking.read_domxml()

for disk in domxml.getElementsByTagName('disk'):
    if disk.getAttribute('device') == 'cdrom':
        for source in disk.getElementsByTagName('source'):
            if source.getAttribute('file').find('/payload/') > 0:
                for serial in disk.getElementsByTagName('serial'):
                    if not serial.hasChildNodes():
                        
serial.appendChild(domxml.createTextNode(str(uuid.uuid4())))
                        hooking.write_domxml(domxml)
---------- cut here ----------

_______________________________________________
Users mailing list
Users@ovirt.org
http://lists.ovirt.org/mailman/listinfo/users

Reply via email to