
Hi Tommaso, I don't have much experience with API, but let me ask differently: Have you tried using oVirt Ansible modules <https://docs.ansible.com/ansible/latest/modules/list_of_cloud_modules.html#ovirt> to achieve your goal? It's really easy to create a vm with ovirt_vm <https://docs.ansible.com/ansible/latest/modules/ovirt_vm_module.html#ovirt-vm-module> and oVirt engine already includes all the requirements for that. Jan On Tue, Feb 4, 2020 at 11:08 AM Tommaso - Shellrent <tommaso@shellrent.com> wrote:
Hi to all.
we are tring to create a new VM via API, but we are unable to select the desidered storage where to deploy it.
We make a call like this:
CALL:
POST /ovirt-engine/api/vms?clone=true
Data:
{"cpu":{"topology":{"sockets":1,"cores":4,"threads":1}},"memory":4294967296,"memory_policy":{"guaranteed":4294967296,"max":4294967296},"disk_attachments":[{"disk":{"id":"925c999e-536f-4905-bc54-5cf64477a3a7","format":"cow","storage_domains":[{"id":"a772c71a-bd7b-4898-9497-120dcd853d96"}]}}],"name":"apitest.domain.com","fqdn":"apitest.domain.com","cluster":{"id":"890681f6-e0fe-11e9-81b5-0200007c8e05"},"template":{"id":"45da14a2-7f6f-43d9-9481-19a2034700fe"}}
But the reply is:
Reply HTTP 400 { "detail" : "For correct usage, see: https://XXXXXXX/ovirt-engine/apidoc#services/vms/methods/add <https://ovirt-engine.serverlet.com/ovirt-engine/apidoc#services/vms/methods/add> ", "reason" : "Request syntactically incorrect." }
Have someone some suggestion or good example??
Best regards. -- [image: Shellrent Logo] *Tommaso De Marchi* COO Chief Operating Officer - Shellrent S.r.l. Tel. 0444321155 <+390444321155> | Fax 04441492177 Via dell'Edilizia, 19 - 36100 Vicenza _______________________________________________ Users mailing list -- users@ovirt.org To unsubscribe send an email to users-leave@ovirt.org Privacy Statement: https://www.ovirt.org/site/privacy-policy/ oVirt Code of Conduct: https://www.ovirt.org/community/about/community-guidelines/ List Archives: https://lists.ovirt.org/archives/list/users@ovirt.org/message/NBXQHG26GOYVUH...
-- Jan Zmeskal Quality Engineer, RHV Core System Red Hat <https://www.redhat.com> <https://www.redhat.com>