[ovirt-users] Unable to assign profile to the nic

Juan Hernandez jhernand at redhat.com
Thu Aug 28 09:53:14 UTC 2014


On 08/28/2014 10:31 AM, Shanil S wrote:
> Hi All,
> 
> I am unable to assign the profile using the ovirt api code, the
> following xml code is used for creating the nic
> 
>  <nic>
>     <interface>virtio</interface> 
>     <name>eth0</name>
>     <boot_protocol>static</boot_protocol>
>     <mac address='".$ip->mac_address."'/>
>     <network>
>      <ip address='".$ip->mac_ip."' netmask='255.255.255.0'
> gateway='".$ip->mac_gateway."'/>
>     </network>
>     <on_boot>true</on_boot>
>     <vnic_profile id='bbabc471-667d-4221-bc8e-4ab30b3dcc34' />
>    </nic>
> 
> Could you please check if anything wrong with it ?
> 

There is nothing severely wrong with that XML, it should work. What
specific problems are you having? Does the API return an error? Anything
in the logs?

Note also that the boot_protocol, ip, and on_boot elements will just be
ignored. These elements are used only for host NICs, not for VM NICs. If
you want to change the IP configuration of the OS of the VM then you
have to use whatever mechanisms that OS provides. The RESTAPI can help
you in these regards only if you combine it with Cloud-init or Sysprep.

-- 
Dirección Comercial: C/Jose Bardasano Baos, 9, Edif. Gorbea 3, planta
3ºD, 28016 Madrid, Spain
Inscrita en el Reg. Mercantil de Madrid – C.I.F. B82657941 - Red Hat S.L.



More information about the Users mailing list