Ovirt 4.1 USB Api problems

Hi, I don't know if this is the correct place for this question (i hope it is ;-) ). We are trying to make "enable USB support" work with a machine created from python ovirtsdk4 api, here is the code: cluster = ovirt.types.Cluster(id=six.binary_type(clusterId)) template = ovirt.types.Template(id=six.binary_type(templateId)) if usbType in ('native', 'legacy'): usb = ovirt.types.Usb(enabled=True, type=ovirt.types.UsbType.NATIVE if usbType == 'native' else ovirt.types.UsbType.LEGACY) else: usb = ovirt.types.Usb(enabled=False) memoryPolicy = ovirt.types.MemoryPolicy(guaranteed=guaranteedMB * 1024 * 1024) par = ovirt.types.Vm(name=name, cluster=cluster, template=template, description=comments, type=ovirt.types.VmType.DESKTOP, memory=memoryMB * 1024 * 1024, memory_policy=memoryPolicy, usb=usb) # display=display, return api.system_service().vms_service().add(par).id 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): Traceback (most recent call last): File "/usr/share/vdsm/virt/vm.py", line 552, in _startUnderlyingVm self._run() File "/usr/share/vdsm/virt/vm.py", line 1994, in _run self._connection.createXML(domxml, flags), File "/usr/lib/python2.7/site-packages/vdsm/libvirtconnection.py", line 123, in wrapper ret = f(*args, **kwargs) File "/usr/lib/python2.7/site-packages/vdsm/utils.py", line 941, in wrapper return func(inst, *args, **kwargs) File "/usr/lib64/python2.7/site-packages/libvirt.py", line 3784, in createXML if ret is None:raise libvirtError('virDomainCreateXML() failed', conn=self) libvirtError: Error XML: Duplicate USB controllers with index 0 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: This is the difference we have found: < <controller index="0" model="piix3-uhci" type="usb"> < <address bus="0x00" domain="0x0000" function="0x2" slot="0x01" type="pci" /> < </controller> 40a38
<address bus="0x00" domain="0x0000" function="0x0"
slot="0x02" type="pci" /> The "<" are from the non working (created from API call), and the ">" are same machine after disabling and enabling again "usb support". Is this a bug?, if not, ¿How is supposed to be enabled USB support from API on VM Creation?, By the way, the equivalent code for oVirt 3.x was working without problems, the problems arises from 4.0 onwards. Sorry for the inconveniences, and thank in advance for any help, Adolfo Gómez

On 16 Mar 2017, at 11:38, Adolfo <agomez@virtualcable.es> wrote:
Hi,
I don't know if this is the correct place for this question (i hope it is ;-) ).
We are trying to make "enable USB support" work with a machine created from python ovirtsdk4 api,
here is the code:
cluster = ovirt.types.Cluster(id=six.binary_type(clusterId)) template = ovirt.types.Template(id=six.binary_type(templateId)) if usbType in ('native', 'legacy'): usb = ovirt.types.Usb(enabled=True, type=ovirt.types.UsbType.NATIVE if usbType == 'native' else ovirt.types.UsbType.LEGACY)
legacy is no longer supported in 4.0 (and not needed/useful since 3.6 already)
else: usb = ovirt.types.Usb(enabled=False)
memoryPolicy = ovirt.types.MemoryPolicy(guaranteed=guaranteedMB * 1024 * 1024) par = ovirt.types.Vm(name=name, cluster=cluster, template=template, description=comments, type=ovirt.types.VmType.DESKTOP, memory=memoryMB * 1024 * 1024, memory_policy=memoryPolicy, usb=usb) # display=display,
return api.system_service().vms_service().add(par).id
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):
Traceback (most recent call last): File "/usr/share/vdsm/virt/vm.py", line 552, in _startUnderlyingVm self._run() File "/usr/share/vdsm/virt/vm.py", line 1994, in _run self._connection.createXML(domxml, flags), File "/usr/lib/python2.7/site-packages/vdsm/libvirtconnection.py", line 123, in wrapper ret = f(*args, **kwargs) File "/usr/lib/python2.7/site-packages/vdsm/utils.py", line 941, in wrapper return func(inst, *args, **kwargs) File "/usr/lib64/python2.7/site-packages/libvirt.py", line 3784, in createXML if ret is None:raise libvirtError('virDomainCreateXML() failed', conn=self) libvirtError: Error XML: Duplicate USB controllers with index 0
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:
This is the difference we have found:
< <controller index="0" model="piix3-uhci" type="usb"> < <address bus="0x00" domain="0x0000" function="0x2" slot="0x01" type="pci" /> < </controller> 40a38
<address bus="0x00" domain="0x0000" function="0x0" slot="0x02" type="pci" />
The "<" are from the non working (created from API call), and the ">" are same machine after disabling and enabling again "usb support".
Is this a bug?, if not, ¿How is supposed to be enabled USB support from API on VM Creation?,
By the way, the equivalent code for oVirt 3.x was working without problems, the problems arises from 4.0 onwards.
Sounds like bug, adding Jakub
Sorry for the inconveniences, and thank in advance for any help,
Adolfo Gómez
_______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users

On 16 Mar 2017, at 11:49, Michal Skrivanek = <michal.skrivanek@redhat.com> wrote: =20 =20
On 16 Mar 2017, at 11:38, Adolfo <agomez@virtualcable.es> wrote: =20 Hi, =20 I don't know if this is the correct place for this question (i hope = it is ;-) ). =20 We are trying to make "enable USB support" work with a machine = created from python ovirtsdk4 api, =20 here is the code: =20 cluster =3D = ovirt.types.Cluster(id=3Dsix.binary_type(clusterId)) template =3D = ovirt.types.Template(id=3Dsix.binary_type(templateId)) if usbType in ('native', 'legacy'): usb =3D ovirt.types.Usb(enabled=3DTrue, = type=3Dovirt.types.UsbType.NATIVE if usbType =3D=3D 'native' else = ovirt.types.UsbType.LEGACY) =20 legacy is no longer supported in 4.0 (and not needed/useful since 3.6 = already) =20 else: usb =3D ovirt.types.Usb(enabled=3DFalse) =20 memoryPolicy =3D = ovirt.types.MemoryPolicy(guaranteed=3DguaranteedMB * 1024 * 1024) par =3D ovirt.types.Vm(name=3Dname, cluster=3Dcluster, = template=3Dtemplate, description=3Dcomments, type=3Dovirt.types.VmType.DESKTOP, memory=3DmemoryMB * 1024 * 1024, = memory_policy=3DmemoryPolicy, usb=3Dusb) # display=3Ddisplay, =20 return api.system_service().vms_service().add(par).id =20 =20 The cuestion is that the machines gets correctly created, but when we =
=20 Traceback (most recent call last): File "/usr/share/vdsm/virt/vm.py", line 552, in _startUnderlyingVm self._run() File "/usr/share/vdsm/virt/vm.py", line 1994, in _run self._connection.createXML(domxml, flags), File "/usr/lib/python2.7/site-packages/vdsm/libvirtconnection.py", =
ret =3D f(*args, **kwargs) File "/usr/lib/python2.7/site-packages/vdsm/utils.py", line 941, in = wrapper return func(inst, *args, **kwargs) File "/usr/lib64/python2.7/site-packages/libvirt.py", line 3784, in = createXML if ret is None:raise libvirtError('virDomainCreateXML() failed', = conn=3Dself) libvirtError: Error XML: Duplicate USB controllers with index 0 =20 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: =20 This is the difference we have found: =20 < <controller index=3D"0" model=3D"piix3-uhci" type=3D"usb"> < <address bus=3D"0x00" domain=3D"0x0000" function=3D"0x2" = slot=3D"0x01" type=3D"pci" /> < </controller> 40a38
<address bus=3D"0x00" domain=3D"0x0000" function=3D"0x0" =
slot=3D"0x02" type=3D"pci" /> =20 The "<" are from the non working (created from API call), and the ">" = are same machine after disabling and enabling again "usb support". =20 Is this a bug?, if not, =C2=BFHow is supposed to be enabled USB = support from API on VM Creation?, =20 By the way, the equivalent code for oVirt 3.x was working without =
--Apple-Mail=_502E058C-640D-496F-A843-A5BB982B8301 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 adding the list back for future reference Hi, this is most probably a bug being tracked as https://bugzilla.redhat.com/attachment.cgi?id=3D1260877 = <https://bugzilla.redhat.com/attachment.cgi?id=3D1260877>. The fix is merged but not yet released. A workaround could be re-adjusting of usb settings ofter VM creation by a separate updating request. Regards Jakub try to start the machine, we get an this error (extract from vdsm): line 123, in wrapper problems, the problems arises from 4.0 onwards.
=20 Sounds like bug, adding Jakub =20
=20 =20 Sorry for the inconveniences, and thank in advance for any help, =20 =20 Adolfo G=C3=B3mez =20 _______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users =20
--Apple-Mail=_502E058C-640D-496F-A843-A5BB982B8301 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 <html><head><meta http-equiv=3D"Content-Type" content=3D"text/html = charset=3Dutf-8"></head><body style=3D"word-wrap: break-word; = -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" = class=3D"">adding the list back for future reference<div class=3D""><br = class=3D""></div><div class=3D"">Hi,<br class=3D""><br class=3D"">this = is most probably a bug being tracked as<br class=3D""><a = href=3D"https://bugzilla.redhat.com/attachment.cgi?id=3D1260877" = class=3D"">https://bugzilla.redhat.com/attachment.cgi?id=3D1260877</a>. = The fix is<br class=3D"">merged but not yet released.<br class=3D""><br = class=3D"">A workaround could be re-adjusting of usb settings ofter VM = creation<br class=3D"">by a separate updating request.<br class=3D""><br = class=3D"">Regards<br class=3D"">Jakub</div><div class=3D""><br = class=3D""><div><blockquote type=3D"cite" class=3D""><div class=3D"">On = 16 Mar 2017, at 11:49, Michal Skrivanek <<a = href=3D"mailto:michal.skrivanek@redhat.com" = class=3D"">michal.skrivanek@redhat.com</a>> wrote:</div><br = class=3D"Apple-interchange-newline"><div class=3D""><div class=3D""><br = class=3D""><blockquote type=3D"cite" class=3D"">On 16 Mar 2017, at = 11:38, Adolfo <<a href=3D"mailto:agomez@virtualcable.es" = class=3D"">agomez@virtualcable.es</a>> wrote:<br class=3D""><br = class=3D"">Hi,<br class=3D""><br class=3D"">I don't know if this is the = correct place for this question (i hope it is ;-) ).<br = class=3D""><br class=3D"">We are trying to make "enable USB support" = work with a machine created from python ovirtsdk4 api,<br class=3D""><br = class=3D"">here is the code:<br class=3D""><br class=3D""> = cluster =3D = ovirt.types.Cluster(id=3Dsix.binary_type(clusterId))<br class=3D""> = template =3D = ovirt.types.Template(id=3Dsix.binary_type(templateId))<br class=3D""> = if usbType = in ('native', 'legacy'):<br class=3D""> = &n= bsp; usb =3D ovirt.types.Usb(enabled=3DTrue, = type=3Dovirt.types.UsbType.NATIVE if usbType =3D=3D 'native' else = ovirt.types.UsbType.LEGACY)<br class=3D""></blockquote><br = class=3D"">legacy is no longer supported in 4.0 (and not needed/useful = since 3.6 already)<br class=3D""><br class=3D""><blockquote type=3D"cite" = class=3D""> = else:<br = class=3D""> = &n= bsp; usb =3D ovirt.types.Usb(enabled=3DFalse)<br class=3D""><br = class=3D""> = memoryPolicy = =3D ovirt.types.MemoryPolicy(guaranteed=3DguaranteedMB * 1024 * 1024)<br = class=3D""> = par =3D = ovirt.types.Vm(name=3Dname, cluster=3Dcluster, template=3Dtemplate, = description=3Dcomments,<br class=3D"">type=3Dovirt.types.VmType.DESKTOP, = memory=3DmemoryMB * 1024 * 1024, memory_policy=3DmemoryPolicy,<br = class=3D""> = &n= bsp; &nbs= p; usb=3Dusb) # display=3Ddisplay,<br class=3D""><br = class=3D""> = return = api.system_service().vms_service().add(par).id<br class=3D""><br = class=3D""><br class=3D"">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=3D""><br class=3D"">Traceback (most = recent call last):<br class=3D""> File "/usr/share/vdsm/virt/vm.py", = line 552, in _startUnderlyingVm<br class=3D""> = self._run()<br class=3D""> File = "/usr/share/vdsm/virt/vm.py", line 1994, in _run<br class=3D""> = self._connection.createXML(domxml, flags),<br class=3D""> = File "/usr/lib/python2.7/site-packages/vdsm/libvirtconnection.py", line = 123, in wrapper<br class=3D""> ret =3D f(*args, **kwargs)<br = class=3D""> File "/usr/lib/python2.7/site-packages/vdsm/utils.py", line = 941, in wrapper<br class=3D""> return func(inst, *args, = **kwargs)<br class=3D""> File = "/usr/lib64/python2.7/site-packages/libvirt.py", line 3784, in = createXML<br class=3D""> if ret is None:raise = libvirtError('virDomainCreateXML() failed', conn=3Dself)<br = class=3D"">libvirtError: Error XML: Duplicate USB controllers with index = 0<br class=3D""><br class=3D"">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=3D""><br class=3D"">This is the difference we have found:<br = class=3D""><br class=3D"">< = <controller index=3D"0"= model=3D"piix3-uhci" type=3D"usb"><br class=3D"">< = &l= t;address bus=3D"0x00" domain=3D"0x0000" function=3D"0x2" slot=3D"0x01" = type=3D"pci" /><br class=3D"">< = </controller><br = class=3D"">40a38<br class=3D""><blockquote type=3D"cite" class=3D""> = <addr= ess bus=3D"0x00" domain=3D"0x0000" function=3D"0x0" slot=3D"0x02" = type=3D"pci" /><br class=3D""></blockquote><br class=3D"">The "<" = are from the non working (created from API call), and the ">" are = same machine after disabling and enabling again "usb support".<br = class=3D""><br class=3D"">Is this a bug?, if not, =C2=BFHow is supposed = to be enabled USB support from API on VM Creation?,<br = class=3D""><br class=3D"">By the way, the equivalent code for oVirt 3.x = was working without problems, the problems arises from 4.0 onwards.<br = class=3D""></blockquote><br class=3D"">Sounds like bug, adding Jakub<br = class=3D""><br class=3D""><blockquote type=3D"cite" class=3D""><br = class=3D""><br class=3D"">Sorry for the inconveniences, and thank in = advance for any help,<br class=3D""><br class=3D""><br class=3D"">Adolfo = G=C3=B3mez<br class=3D""><br = class=3D"">_______________________________________________<br = class=3D"">Users mailing list<br class=3D""><a = href=3D"mailto:Users@ovirt.org" class=3D"">Users@ovirt.org</a><br = class=3D"">http://lists.ovirt.org/mailman/listinfo/users<br = class=3D""></blockquote><br class=3D""></div></div></blockquote></div><br = class=3D""></div></body></html>= --Apple-Mail=_502E058C-640D-496F-A843-A5BB982B8301--
participants (2)
-
Adolfo
-
Michal Skrivanek