Unable to assign profile to the nic

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 ? -- Regards Shanil

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.

Hi Juan, I have attached the screenshot of the ovirt panel after creating the nic's with the above code, Please check it. -- Regards Shanil On Thu, Aug 28, 2014 at 3:23 PM, Juan Hernandez <jhernand@redhat.com> wrote:
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.

On 08/29/2014 05:21 AM, Shanil S wrote:
Hi Juan,
I have attached the screenshot of the ovirt panel after creating the nic's with the above code, Please check it.
May it be that you are using version 3.3.0? The RESTAPI support for vNIC profiles was added in 3.3.1.
On Thu, Aug 28, 2014 at 3:23 PM, Juan Hernandez <jhernand@redhat.com <mailto:jhernand@redhat.com>> wrote:
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.
_______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
-- 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.

Hi Juan, We are using the using the Ovirt 3.4.3 version. -- Regards Shanil On Fri, Aug 29, 2014 at 1:56 PM, Juan Hernandez <jhernand@redhat.com> wrote:
On 08/29/2014 05:21 AM, Shanil S wrote:
Hi Juan,
I have attached the screenshot of the ovirt panel after creating the nic's with the above code, Please check it.
May it be that you are using version 3.3.0? The RESTAPI support for vNIC profiles was added in 3.3.1.
On Thu, Aug 28, 2014 at 3:23 PM, Juan Hernandez <jhernand@redhat.com <mailto:jhernand@redhat.com>> wrote:
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.
_______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
-- 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.

----- Original Message -----
From: "Shanil S" <xielesshanil@gmail.com> To: users@ovirt.org Sent: Thursday, August 28, 2014 11:31:30 AM Subject: [ovirt-users] Unable to assign profile to the nic
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>
Try not to provide the 'network' element at all. The vnic profile replaced the 'network' element when attaching a nic to a network. In this context you should use either <network><name>...</name></network> or the <vnic_profile id="..."/>. As Juan explained in other thread, any other parameter for network are being ignored and network element without name is referred as "empty network".
<on_boot>true</on_boot> <vnic_profile id='bbabc471-667d-4221-bc8e-4ab30b3dcc34' /> </nic>
Could you please check if anything wrong with it ?
-- Regards Shanil
_______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users

Hi Moti, Thanks for your reply. Let me check it with this solution. -- Regards Shanil On Sun, Aug 31, 2014 at 2:15 PM, Moti Asayag <masayag@redhat.com> wrote:
----- Original Message -----
From: "Shanil S" <xielesshanil@gmail.com> To: users@ovirt.org Sent: Thursday, August 28, 2014 11:31:30 AM Subject: [ovirt-users] Unable to assign profile to the nic
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>
Try not to provide the 'network' element at all. The vnic profile replaced the 'network' element when attaching a nic to a network.
In this context you should use either <network><name>...</name></network> or the <vnic_profile id="..."/>.
As Juan explained in other thread, any other parameter for network are being ignored and network element without name is referred as "empty network".
<on_boot>true</on_boot> <vnic_profile id='bbabc471-667d-4221-bc8e-4ab30b3dcc34' /> </nic>
Could you please check if anything wrong with it ?
-- Regards Shanil
_______________________________________________ Users mailing list Users@ovirt.org http://lists.ovirt.org/mailman/listinfo/users
participants (3)
-
Juan Hernandez
-
Moti Asayag
-
Shanil S