<div dir="ltr"><div>Hi Juan,<br><br></div>Thanks for your reply. I will check it with this solution.<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 Fri, Aug 29, 2014 at 5:12 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="">On 08/29/2014 12:02 PM, Shanil S wrote:<br>
> Hi Juan,<br>
><br>
> These are the xml details which i used for the vm start function, please<br>
> check it<br>
><br>
<br>
</div>Ok, this explains this problem and the other problem that you are having<br>
with assigning profile.<br>
<br>
It is important to understand that there are two sets of parameters<br>
associated to a network interface:<br>
<br>
1. Those that define the virtual hardware configuration, like the model,<br>
interface, MAC and profile. Those are assigned when you create or update<br>
the NIC. For example:<br>
<br>
#!/bin/sh -x<br>
<br>
url="<a href="https://ovirt.example.com/ovirt-engine/api" target="_blank">https://ovirt.example.com/ovirt-engine/api</a>"<br>
user="admin@internal"<br>
password="******"<br>
<br>
curl \<br>
--verbose \<br>
--insecure \<br>
--request POST \<br>
--header "Accept: application/xml" \<br>
--header "Content-Type: application/xml" \<br>
--user "${user}:${password}" \<br>
--data "<br>
<nic><br>
<interface>virtio</interface><br>
<name>nic1</name><br>
<mac address='00:1a:4a:16:01:53'/><br>
<vnic_profile id='8d69b87d-a6df-4912-adb7-d498c2fdc8e3'/><br>
</nic><br>
" \<br>
"${url}/vms/b848fc2e-5df2-4754-ae7c-98a20c0e373d/nics"<br>
<br>
If you include in a request like this any IP information, like boot<br>
protocol, address, etc, it will be just silently ignored.<br>
<br>
2. Those that define the software device configuration. These are<br>
managed by the guest OS, and you can set them using cloud-init, as you<br>
are doing. But you can't change the hardware configuration with<br>
cloud-init, that is why your <vnic_profile> element is ignored.<br>
<br>
See some more comments below:<br>
<div class=""><br>
><br>
> <action><br>
> <vm><br>
> <os><br>
> <boot dev='cdrom'/><br>
> </os><br>
> <initialization><br>
> <cloud_init><br>
><br>
> <users><br>
> <user><br>
> <user_name>root</user_name><br>
> <password></password><br>
> </user><br>
> </users><br>
> <network_configuration><br>
> <nics><br>
> <nic><br>
> <interface>virtio</interface><br>
<br>
</div>This ^ line is ignored by cloud-init.<br>
<div class=""><br>
> <name>eth0</name><br>
><br>
> <boot_protocol>static</boot_protocol><br>
> <mac address='xx:xx:xx:xx:xx:xx'/><br>
<br>
</div>This ^ line is ignored by cloud-init.<br>
<div class=""><br>
> <network><br>
> <ip address='xx.xx.xx.xx'<br>
> netmask='255.255.255.0' gateway='xx.xx.xx.xx'/><br>
> </network><br>
> <on_boot>true</on_boot><br>
> <vnic_profile<br>
> id='bbabc471-667d-4221-bc8e-4ab30b3dcc34' /><br>
<br>
</div>This ^ line is ignored by cloud-init. The vnic_profile is only used when<br>
creating the NIC.<br>
<div class=""><br>
> </nic><br>
> <nic><br>
> <interface>virtio</interface><br>
<br>
</div>This ^ line is ignored by cloud-init.<br>
<br>
> <name>eth1</name><br>
<br>
You should add <boot_protocol>static</boot_protocol> here, like in eth0.<br>
<div class=""><br>
> <mac address='xx:xx:xx:xx:xx:xx'/><br>
<br>
</div>This ^ line is ignored by cloud-init.<br>
<div class=""><br>
> <network><br>
> <ip address='xx.xx.xx.xx'<br>
> netmask='255.255.255.0' gateway=''/><br>
> </network><br>
> <on_boot>true</on_boot><br>
> <vnic_profile<br>
> id='bbabc471-667d-4221-bc8e-4ab30b3dcc34' /><br>
<br>
</div>This ^ line is ignored by cloud-init. The vnic_profile is only used when<br>
creating the NIC.<br>
<div class=""><br>
> </nic><br>
> </nics><br>
> <dns><br>
> <servers><br>
> <host><br>
> <address>8.8.8.8</address><br>
> </host><br>
> </servers><br>
> </dns><br>
> </network_configuration><br>
> </cloud_init><br>
> </initialization><br>
> </vm><br>
> </action><br>
><br>
><br>
><br>
> --<br>
> Regards<br>
> Shanil<br>
><br>
><br>
> On Fri, Aug 29, 2014 at 2:15 PM, Juan Hernandez <<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a><br>
</div><div class="">> <mailto:<a href="mailto:jhernand@redhat.com">jhernand@redhat.com</a>>> wrote:<br>
><br>
> On 08/29/2014 05:30 AM, Shanil S wrote:<br>
> > Hi Dan,<br>
> ><br>
> > Please ignore the previous screenshot and check this.<br>
> ><br>
> > --<br>
> > Regards<br>
> > Shanil<br>
> ><br>
> ><br>
> > On Fri, Aug 29, 2014 at 8:49 AM, Shanil S <<a href="mailto:xielesshanil@gmail.com">xielesshanil@gmail.com</a><br>
> <mailto:<a href="mailto:xielesshanil@gmail.com">xielesshanil@gmail.com</a>><br>
</div>> > <mailto:<a href="mailto:xielesshanil@gmail.com">xielesshanil@gmail.com</a> <mailto:<a href="mailto:xielesshanil@gmail.com">xielesshanil@gmail.com</a>>>><br>
<div class="im HOEnZb">> wrote:<br>
> ><br>
> > Hi Dan,<br>
> ><br>
> > I have attached the screenshot of the console, please check it.<br>
> ><br>
> > --<br>
> > Regards<br>
> > Shanil<br>
> ><br>
> ><br>
> > On Thu, Aug 28, 2014 at 4:46 PM, Dan Kenigsberg<br>
> <<a href="mailto:danken@redhat.com">danken@redhat.com</a> <mailto:<a href="mailto:danken@redhat.com">danken@redhat.com</a>><br>
</div><div class="HOEnZb"><div class="h5">> > <mailto:<a href="mailto:danken@redhat.com">danken@redhat.com</a> <mailto:<a href="mailto:danken@redhat.com">danken@redhat.com</a>>>> wrote:<br>
> ><br>
> > On Thu, Aug 28, 2014 at 01:50:22PM +0530, Shanil S wrote:<br>
> > > Hi Aill,<br>
> > ><br>
> > > We are creating two nics using the api, but it seems the<br>
> > second network is<br>
> > > not come up and the first one is working. The following<br>
> xml is<br>
> > used to for<br>
> > > the nic creation<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<br>
> id='bbabc471-667d-4221-bc8e-4ab30b3dcc34' /><br>
> > > </nic><br>
> > ><br>
> > > <nic><br>
> > > <interface>virtio</interface><br>
> > > <name>eth1</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<br>
> id='037d806f-d76b-4da3-84b6-ac7a5087f836' /><br>
> > > </nic><br>
> > ><br>
> > > When i checked the configuration file<br>
> > > (/etc/sysconfig/network-scripts/ifcfg-eth1) after<br>
> creating...i<br>
> > find it<br>
> > > seems the ONBOOT=no.....eventhough we set it true from the<br>
> > api. Is this a<br>
> > > bug ?<br>
> ><br>
> > I do not know what "on_boot" means in oVirt API, but it<br>
> > certainly is not<br>
> > passed to Vdsm or the guest, and as such cannot control what's<br>
> > in the<br>
> > guest's /etc/sysconfig/network-scripts/ifcfg-eth1.<br>
> ><br>
> > The guest may have ifcfg files, it may run NetworkManager,<br>
> or it<br>
> > may be<br>
> > Ubunto or Windows. oVirt is responsible to exposing a<br>
> (virtual)<br>
> > NIC to<br>
> > the guest, but does not interfere with its configuration.<br>
> ><br>
> > Dan<br>
> ><br>
><br>
> The on_boot parameter that you pass when creating the NIC is completely<br>
> ignored, like all the other IP configuration parameters.<br>
><br>
> But looking at your screenshot it looks like you are already using<br>
> cloud-init to solve this. Are you using those <nic>...</nic> XML<br>
> documents as part of larger request to create a VM? In that case we need<br>
> to check the complete XML document in order to see if there is something<br>
> wrong. Can you share it?<br>
><br>
<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>
</div></div></blockquote></div><br></div>