<div dir="ltr"><div>Hi Juan,<br><br></div>Okay.. Thanks.. i will check it with your solution.<br></div><div class="gmail_extra"><br clear="all"><div><div dir="ltr"><span>-- <br></span>Regards
<br>Shanil
</div></div>
<br><div class="gmail_quote">On Tue, Sep 16, 2014 at 8:23 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"><span class="">On 09/16/2014 11:46 AM, Shanil S wrote:<br>
&gt; Hi All,<br>
&gt;<br>
&gt; I would like to add multiple ips to a single nic using the ovirt api<br>
&gt; function. Is it possible to assign multiple ips to a single nic using<br>
&gt; the ovirt api ?<br>
&gt;<br>
<br>
</span>Remember that you can&#39;t set any IP configuration of a network interface<br>
from outside the guest, so you need to use cloud-init or similar. With<br>
cloud-init you can use the &quot;nic&quot; element several times, using names like<br>
eth0:0, eth0:1, etc:<br>
<br>
&lt;action&gt;<br>
  &lt;vm&gt;<br>
    &lt;initialization&gt;<br>
      &lt;cloud_init&gt;<br>
        &lt;network_configuration&gt;<br>
          &lt;nics&gt;<br>
            &lt;nic&gt;<br>
              &lt;name&gt;eth0&lt;/name&gt;<br>
              &lt;boot_protocol&gt;static&lt;/boot_protocol&gt;<br>
              &lt;network&gt;<br>
                &lt;ip address=&quot;192.168.122.31&quot; netmask=&quot;255.255.255&quot;<br>
gateway=&quot;192.168.122.1&quot;/&gt;<br>
              &lt;/network&gt;<br>
              &lt;on_boot&gt;true&lt;/on_boot&gt;<br>
            &lt;/nic&gt;<br>
            &lt;nic&gt;<br>
              &lt;name&gt;eth0:0&lt;/name&gt;<br>
              &lt;boot_protocol&gt;static&lt;/boot_protocol&gt;<br>
              &lt;network&gt;<br>
                &lt;ip address=&quot;192.168.122.32&quot; netmask=&quot;255.255.255.0&quot;<br>
gateway=&quot;192.168.122.1&quot;/&gt;<br>
              &lt;/network&gt;<br>
              &lt;on_boot&gt;true&lt;/on_boot&gt;<br>
            &lt;/nic&gt;<br>
            &lt;nic&gt;<br>
              &lt;name&gt;eth0:1&lt;/name&gt;<br>
              &lt;boot_protocol&gt;static&lt;/boot_protocol&gt;<br>
              &lt;network&gt;<br>
                &lt;ip address=&quot;192.168.122.33&quot; netmask=&quot;255.255.255.0&quot;<br>
gateway=&quot;192.168.122.1&quot;/&gt;<br>
              &lt;/network&gt;<br>
              &lt;on_boot&gt;true&lt;/on_boot&gt;<br>
            &lt;/nic&gt;<br>
          &lt;/nics&gt;<br>
        &lt;/network_configuration&gt;<br>
      &lt;/cloud_init&gt;<br>
    &lt;/initialization&gt;<br>
  &lt;/vm&gt;<br>
&lt;/action&gt;<br>
<br>
This will produce a network configuration file like this:<br>
<br>
iface eth0 inet static<br>
  address 192.168.122.31<br>
  netmask 255.255.255<br>
  gateway 192.168.122.1<br>
iface eth0:0 inet static<br>
  address 192.168.122.32<br>
  netmask 255.255.255.0<br>
  gateway 192.168.122.1<br>
iface eth0:1 inet static<br>
  address 192.168.122.33<br>
  netmask 255.255.255.0<br>
  gateway 192.168.122.1<br>
auto eth0 eth0:0 eth0:1<br>
<br>
Cloud-init should then translate that into the correct configuration<br>
within the host. It should work correctly in RHEL/Fedora, but I guess<br>
this isn&#39;t a contract of cloud-init, so it may fail in other distros or<br>
in future versions.<br>
<br>
Anyhow, you may consider adding multiple network interfaces to the VM,<br>
instead of multiple IPs in the same interface. They don&#39;t cost anything<br>
and give you more flexibility if you want to physically separate networks.<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>