<div dir="ltr">Thanks Martin. What I would like to achieve is govern the interface name created within the container, so that my application can take different actions on different interfaces (such as eth0, eth1 etc.,).<div><br></div><div>Libvirt's lxc driver seems to create interfaces as eth0, eth1 and so on, when there are multiple <interface /> entries in the domain xml. How can I request for a particular interface name?</div><div><br></div><div>I saw that in some of the examples in <a href="https://libvirt.org/formatdomain.html">https://libvirt.org/formatdomain.html</a>, <source dev=" " network=" "> is specified. I tried setting the "dev" attribute of source tag, but it doesn't look like that is being parsed and stored either.</div><div><br></div></div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature">Regards,<br>Harish</div></div>
<br><div class="gmail_quote">On Fri, Oct 30, 2015 at 8:32 PM, Martin Kletzander <span dir="ltr"><<a href="mailto:mkletzan@redhat.com" target="_blank">mkletzan@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Fri, Oct 30, 2015 at 08:16:33PM +0530, Harish Vishwanath wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello<br>
<br>
I am trying to create interfaces within an LXC container with specific<br>
name. I am using the following XML:<br>
<br>
   <interface type='network' name='blah'><br>
     <source network='dpbr_n_0'/><br>
   </interface><br>
<br>
</blockquote>
<br></span>
That name='' is not parsed, it won't get saved, it doesn't mean<br>
anything to libvirt.  This particular configuration doesn't say much,<br>
because type=network means all the settings will get set from the<br>
network dpbr_n_0.  See <a href="https://libvirt.org/formatdomain.html" rel="noreferrer" target="_blank">https://libvirt.org/formatdomain.html</a> for all<br>
the things you can configure in <interface/> and what does each option<br>
mean.<span class=""><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
This doesn't seem to work; it always ends up creating interface with name<br>
as "eth0".<br>
<br>
I found some examples here:<br>
<a href="http://libvirt.org/guide/html/Application_Development_Guide-Network_Interfaces-XML_Format.html" rel="noreferrer" target="_blank">http://libvirt.org/guide/html/Application_Development_Guide-Network_Interfaces-XML_Format.html</a><br>
<br>
That uses interface type as "ethernet" and specifies name also, If I do<br>
that, I get back an error while starting the container as "Unsupported<br>
network type ethernet".<br>
<br>
Appreciate your help.<br>
<br>
Regards,<br>
Harish<br>
</blockquote>
<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
_______________________________________________<br>
libvirt-users mailing list<br>
<a href="mailto:libvirt-users@redhat.com" target="_blank">libvirt-users@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/libvirt-users" rel="noreferrer" target="_blank">https://www.redhat.com/mailman/listinfo/libvirt-users</a><br>
</blockquote>
</blockquote></div><br></div>