You can follow this example:
http://ovirt.github.io/ovirt-engine-api-model/master/#_create_a_virtual_machine_nic

Have you tried creating first the VM without the NIC and then creating its
nic with
POST /ovirt-engine/api/vms/#id/nics ?


*Regards,*

*Shani Leviim*


On Sun, May 2, 2021 at 1:14 PM Shani Leviim <[email protected]> wrote:

> For updating VMs, use PUT instead of POST
>
> http://ovirt.github.io/ovirt-engine-api-model/master/#services/vm/methods/update
>
>
> *Regards,*
>
> *Shani Leviim*
>
>
> On Sun, May 2, 2021 at 10:29 AM <[email protected]> wrote:
>
>> Temporary solution for me is:
>>
>> PUT /ovirt-engine/api/vms/$serverID/nics/$nicID
>>
>> <nic>
>>                   <name>ovirtmgmt_25</name>
>>                   <interface>virtio</interface>
>>                   <vnic_profile id="$profileID"/>
>>                 </nic>
>>
>> But this solution is not optional, i need set this on "create VM".
>>
>> Ad this to:
>>
>> POST /ovirt-engine/api/vms
>>
>> <vm>
>>                         <name>$hostname</name>
>>                         <description>$description</description>
>>                         <cluster>
>>                                 <name>$cluster</name>
>>                         </cluster>
>>                         <template>
>>                                 <name>$template</name>
>>                         </template>
>>
>>                         <cpu>
>>                                 <topology>
>>                                         <cores>1</cores>
>>                                         <sockets>$cpu</sockets>
>>                                         <threads>1</threads>
>>                                 </topology>
>>                         </cpu>
>>                         <memory>$ramMB</memory>
>>                         <memory_policy>
>>                                 <ballooning>true</ballooning>
>>                                 <guaranteed>$ramMBguaranteed</guaranteed>
>>                                 <max>$ramMBmax</max>
>>                         </memory_policy>
>>                 </vm>
>>
>> like this, but not workling:
>>
>> <vm>
>>                         <name>$hostname</name>
>>                         <description>$description</description>
>>                         <cluster>
>>                                 <name>$cluster</name>
>>                         </cluster>
>>                         <template>
>>                                 <name>$template</name>
>>                         </template>
>>
>>                         <nic>
>>                           <name>ovirtmgmt_25</name>
>>                           <interface>virtio</interface>
>>                           <vnic_profile id='$profileID'/>
>>                         </nic>
>>
>>                         <cpu>
>>                                 <topology>
>>                                         <cores>1</cores>
>>                                         <sockets>$cpu</sockets>
>>                                         <threads>1</threads>
>>                                 </topology>
>>                         </cpu>
>>                         <memory>$ramMB</memory>
>>                         <memory_policy>
>>                                 <ballooning>true</ballooning>
>>                                 <guaranteed>$ramMBguaranteed</guaranteed>
>>                                 <max>$ramMBmax</max>
>>                         </memory_policy>
>>                 </vm>
>> _______________________________________________
>> Users mailing list -- [email protected]
>> To unsubscribe send an email to [email protected]
>> Privacy Statement: https://www.ovirt.org/privacy-policy.html
>> oVirt Code of Conduct:
>> https://www.ovirt.org/community/about/community-guidelines/
>> List Archives:
>> https://lists.ovirt.org/archives/list/[email protected]/message/I3IHCJIR5N7M6ODF75QS7DR4E2VWSWYU/
>>
>
_______________________________________________
Users mailing list -- [email protected]
To unsubscribe send an email to [email protected]
Privacy Statement: https://www.ovirt.org/privacy-policy.html
oVirt Code of Conduct: 
https://www.ovirt.org/community/about/community-guidelines/
List Archives: 
https://lists.ovirt.org/archives/list/[email protected]/message/WWDZRY245GMWJGHU6PR5BDWH3GUGGTB3/

Reply via email to