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