<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
Hello,</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
I hit a bug, and just want to share a solution.</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
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".</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
Yes, both cdrom devices have the same serial. Empty serial:</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<br>
</div>
<div>
<div><font face="Calibri,sans-serif"> <disk device="cdrom" snapshot="no" type="file"></font></div>
<div><font face="Calibri,sans-serif"> <source file="/var/run/vdsm/payload/2eaf9c8e-2123-4b48-9b62-f96168ac7a36.41f22cb1676858ad4e22e8440519032d.img" startupPolicy="optional"/></font></div>
<div><font face="Calibri,sans-serif"> <target bus="ide" dev="hdd"/></font></div>
<div><font face="Calibri,sans-serif"> <readonly/></font></div>
<div><font face="Calibri,sans-serif"> <serial/></font></div>
<div><font face="Calibri,sans-serif"> </disk></font></div>
<div><font face="Calibri,sans-serif"> <disk device="cdrom" snapshot="no" type="file"></font></div>
<div><font face="Calibri,sans-serif"> <source file="" startupPolicy="optional"/></font></div>
<div><font face="Calibri,sans-serif"> <target bus="ide" dev="hdc"/></font></div>
<div><font face="Calibri,sans-serif"> <readonly/></font></div>
<div><font face="Calibri,sans-serif"> <serial/></font></div>
<div><font face="Calibri,sans-serif"> </disk></font></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<br>
</div>
</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
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.</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
Related bug - <a href="https://bugzilla.redhat.com/show_bug.cgi?id=1245013">https://bugzilla.redhat.com/show_bug.cgi?id=1245013</a></div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
Quick fix is to install a VDSM hook to /usr/libexec/vdsm/hooks/before_vm_start:</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
---------- cut here ----------</div>
<div>
<div>
<div><font face="Calibri,sans-serif">#!/usr/bin/python</font></div>
<div><font face="Calibri,sans-serif"><br>
</font></div>
<div><font face="Calibri,sans-serif">import hooking</font></div>
<div><font face="Calibri,sans-serif">import uuid</font></div>
<div><font face="Calibri,sans-serif"><br>
</font></div>
<div><font face="Calibri,sans-serif">domxml = hooking.read_domxml()</font></div>
<div><font face="Calibri,sans-serif"><br>
</font></div>
<div><font face="Calibri,sans-serif">for disk in domxml.getElementsByTagName('disk'):</font></div>
<div><font face="Calibri,sans-serif"> if disk.getAttribute('device') == 'cdrom':</font></div>
<div><font face="Calibri,sans-serif"> for source in disk.getElementsByTagName('source'):</font></div>
<div><font face="Calibri,sans-serif"> if source.getAttribute('file').find('/payload/') > 0:</font></div>
<div><font face="Calibri,sans-serif"> for serial in disk.getElementsByTagName('serial'):</font></div>
<div><font face="Calibri,sans-serif"> if not serial.hasChildNodes():</font></div>
<div><font face="Calibri,sans-serif"> serial.appendChild(domxml.createTextNode(str(uuid.uuid4())))</font></div>
<div><font face="Calibri,sans-serif"> hooking.write_domxml(domxml)</font></div>
</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
---------- cut here ----------</div>
</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<br>
</div>
<div style="color: rgb(0, 0, 0); font-family: Calibri, sans-serif; font-size: 14px;">
<div id="MAC_OUTLOOK_SIGNATURE"></div>
</div>
</body>
</html>