<div dir="ltr"><div>Hi Juan,<br><br></div>I have attached the screenshot of the ovirt panel after creating the nic's with the above code, Please check it.<br></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr">
<span>-- <br></span>Regards
<br>Shanil
</div></div>
<br><br><div class="gmail_quote">On Thu, Aug 28, 2014 at 3:23 PM, Juan Hernandez <span dir="ltr"><<a href="mailto:jhernand@redhat.com" target="_blank">jhernand@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">On 08/28/2014 10:31 AM, Shanil S wrote:<br>
> Hi All,<br>
><br>
> I am unable to assign the profile using the ovirt api code, the<br>
> following xml code is used for creating the nic<br>
><br>
> <nic><br>
> <interface>virtio</interface><br>
> <name>eth0</name><br>
> <boot_protocol>static</boot_protocol><br>
> <mac address='".$ip->mac_address."'/><br>
> <network><br>
> <ip address='".$ip->mac_ip."' netmask='255.255.255.0'<br>
> gateway='".$ip->mac_gateway."'/><br>
> </network><br>
> <on_boot>true</on_boot><br>
> <vnic_profile id='bbabc471-667d-4221-bc8e-4ab30b3dcc34' /><br>
> </nic><br>
><br>
> Could you please check if anything wrong with it ?<br>
><br>
<br>
</div></div>There is nothing severely wrong with that XML, it should work. What<br>
specific problems are you having? Does the API return an error? Anything<br>
in the logs?<br>
<br>
Note also that the boot_protocol, ip, and on_boot elements will just be<br>
ignored. These elements are used only for host NICs, not for VM NICs. If<br>
you want to change the IP configuration of the OS of the VM then you<br>
have to use whatever mechanisms that OS provides. The RESTAPI can help<br>
you in these regards only if you combine it with Cloud-init or Sysprep.<br>
<span class="HOEnZb"><font color="#888888"><br>
--<br>
Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta<br>
3ºD, 28016 Madrid, Spain<br>
Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.<br>
</font></span></blockquote></div><br></div>