[ovirt-users] Getting error while trying to add VmPool using ovirtsdk4 version of the python api

Manuel Luis Aznar manuel.luis.aznar at gmail.com
Fri Feb 10 12:43:03 UTC 2017


Hello there,

I am trying to add a VmPool to oVirt using the python ovirtSDK4 with
following lines:

I am omitting the import packages lines and connection lines.



system_service = connection.system_service()

vm_pools_service = system_service.vm_pools_service()

templates_service = system_service.templates_service()

clusters_service = system_service.clusters_service()

tplist = templates_service.list(search='name=prueba')

tpl=None
biggest=-1
for t in tplist:
     ver = t.version
     if ver.version_number > biggest:
         biggest = ver.version_number
         tid = t.id
         tpl = t

c = None
for cluster in clusters_service.list():
    if cluster.name == 'Pruebacluster':
        c = cluster

pool = ovirtsdk4.types.VmPool(name='PRUEBA',size=1,type
=ovirtsdk4.types.VmPoolType('manual'),template=tpl,cluster=c)
vm_pools_service.add(pool=pool)



I am getting the following error:

   Fault reason is "Request syntactically incorrect.". Fault detail is "For
correct usage, see:
https://ovirt.example.com/ovirt-engine/api/v4/model#services/vm-pools/methods/add".
HTTP      response code is 400.

I am a newbie in using this version of the API, suppose this is quite easy
problem.

Thanks for all the answers to come,
Manuel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/users/attachments/20170210/d00651bf/attachment-0001.html>


More information about the Users mailing list