[ovirt-devel] [ovirt-users] Ovirt 4.1 USB Api problems

Michal Skrivanek michal.skrivanek at redhat.com
Thu Mar 16 10:49:54 UTC 2017


> On 16 Mar 2017, at 11:38, Adolfo <agomez at 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 at ovirt.org
> http://lists.ovirt.org/mailman/listinfo/users



More information about the Devel mailing list