<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;" class="">adding the list back for future reference<div class=""><br class=""></div><div class="">Hi,<br class=""><br class="">this is most probably a bug being tracked as<br class=""><a href="https://bugzilla.redhat.com/attachment.cgi?id=1260877" class="">https://bugzilla.redhat.com/attachment.cgi?id=1260877</a>. The fix is<br class="">merged but not yet released.<br class=""><br class="">A workaround could be re-adjusting of usb settings ofter VM creation<br class="">by a separate updating request.<br class=""><br class="">Regards<br class="">Jakub</div><div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On 16 Mar 2017, at 11:49, Michal Skrivanek <<a href="mailto:michal.skrivanek@redhat.com" class="">michal.skrivanek@redhat.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class=""><br class=""><blockquote type="cite" class="">On 16 Mar 2017, at 11:38, Adolfo <<a href="mailto:agomez@virtualcable.es" class="">agomez@virtualcable.es</a>> wrote:<br class=""><br class="">Hi,<br class=""><br class="">I don't know if this is the correct place for this question (i hope it is ;-) ).<br class=""><br class="">We are trying to make "enable USB support" work with a machine created from python ovirtsdk4 api,<br class=""><br class="">here is the code:<br class=""><br class=""> cluster = ovirt.types.Cluster(id=six.binary_type(clusterId))<br class=""> template = ovirt.types.Template(id=six.binary_type(templateId))<br class=""> if usbType in ('native', 'legacy'):<br class=""> usb = ovirt.types.Usb(enabled=True, type=ovirt.types.UsbType.NATIVE if usbType == 'native' else ovirt.types.UsbType.LEGACY)<br class=""></blockquote><br class="">legacy is no longer supported in 4.0 (and not needed/useful since 3.6 already)<br class=""><br class=""><blockquote type="cite" class=""> else:<br class=""> usb = ovirt.types.Usb(enabled=False)<br class=""><br class=""> memoryPolicy = ovirt.types.MemoryPolicy(guaranteed=guaranteedMB * 1024 * 1024)<br class=""> par = ovirt.types.Vm(name=name, cluster=cluster, template=template, description=comments,<br class="">type=ovirt.types.VmType.DESKTOP, memory=memoryMB * 1024 * 1024, memory_policy=memoryPolicy,<br class=""> usb=usb) # display=display,<br class=""><br class=""> return api.system_service().vms_service().add(par).id<br class=""><br class=""><br class="">The cuestion is that the machines gets correctly created, but when we try to start the machine, we get an this error (extract from vdsm):<br class=""><br class="">Traceback (most recent call last):<br class=""> File "/usr/share/vdsm/virt/vm.py", line 552, in _startUnderlyingVm<br class=""> self._run()<br class=""> File "/usr/share/vdsm/virt/vm.py", line 1994, in _run<br class=""> self._connection.createXML(domxml, flags),<br class=""> File "/usr/lib/python2.7/site-packages/vdsm/libvirtconnection.py", line 123, in wrapper<br class=""> ret = f(*args, **kwargs)<br class=""> File "/usr/lib/python2.7/site-packages/vdsm/utils.py", line 941, in wrapper<br class=""> return func(inst, *args, **kwargs)<br class=""> File "/usr/lib64/python2.7/site-packages/libvirt.py", line 3784, in createXML<br class=""> if ret is None:raise libvirtError('virDomainCreateXML() failed', conn=self)<br class="">libvirtError: Error XML: Duplicate USB controllers with index 0<br class=""><br class="">The question is, that if to this machine we have created, from administration interface, remove an add support for usb, the machine works, and the generated XML differs:<br class=""><br class="">This is the difference we have found:<br class=""><br class="">< <controller index="0" model="piix3-uhci" type="usb"><br class="">< <address bus="0x00" domain="0x0000" function="0x2" slot="0x01" type="pci" /><br class="">< </controller><br class="">40a38<br class=""><blockquote type="cite" class=""> <address bus="0x00" domain="0x0000" function="0x0" slot="0x02" type="pci" /><br class=""></blockquote><br class="">The "<" are from the non working (created from API call), and the ">" are same machine after disabling and enabling again "usb support".<br class=""><br class="">Is this a bug?, if not, ¿How is supposed to be enabled USB support from API on VM Creation?,<br class=""><br class="">By the way, the equivalent code for oVirt 3.x was working without problems, the problems arises from 4.0 onwards.<br class=""></blockquote><br class="">Sounds like bug, adding Jakub<br class=""><br class=""><blockquote type="cite" class=""><br class=""><br class="">Sorry for the inconveniences, and thank in advance for any help,<br class=""><br class=""><br class="">Adolfo Gómez<br class=""><br class="">_______________________________________________<br class="">Users mailing list<br class=""><a href="mailto:Users@ovirt.org" class="">Users@ovirt.org</a><br class="">http://lists.ovirt.org/mailman/listinfo/users<br class=""></blockquote><br class=""></div></div></blockquote></div><br class=""></div></body></html>