<div dir="ltr">Thanks very much Martin!<div><br></div><div>It looks like <guest dev='' /> is available only from 1.2.7 version of libvirt. I am on 1.2.2, so bad luck!</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature">Regards,<br>Harish</div></div>
<br><div class="gmail_quote">On Mon, Nov 2, 2015 at 9:35 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 10:09:51PM +0530, Harish Vishwanath wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Thanks Martin. What I would like to achieve is govern the interface name<br>
created within the container, so that my application can take different<br>
actions on different interfaces (such as eth0, eth1 etc.,).<br>
<br>
</blockquote>
<br></span>
<interface><br>
 <guest dev='devicename'/><br>
</interface><br>
<br>
That is what you're looking for.  Although I usually recommend not<br>
relying on the name, but rather using the MAC address.<br>
<br>
Also <target dev='othername'/> says how the device will be named on<br>
the host.<div class="HOEnZb"><div class="h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Libvirt's lxc driver seems to create interfaces as eth0, eth1 and so on,<br>
when there are multiple <interface /> entries in the domain xml. How can I<br>
request for a particular interface name?<br>
<br>
I saw that in some of the examples in <a href="https://libvirt.org/formatdomain.html" rel="noreferrer" target="_blank">https://libvirt.org/formatdomain.html</a>,<br>
<source dev=" " network=" "> is specified. I tried setting the "dev"<br>
attribute of source tag, but it doesn't look like that is being parsed and<br>
stored either.<br>
<br>
<br>
Regards,<br>
Harish<br>
<br>
On Fri, Oct 30, 2015 at 8:32 PM, Martin Kletzander <<a href="mailto:mkletzan@redhat.com" target="_blank">mkletzan@redhat.com</a>><br>
wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On Fri, Oct 30, 2015 at 08:16:33PM +0530, Harish Vishwanath wrote:<br>
<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>
<br>
</blockquote>
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.<br>
<br>
This doesn't seem to work; it always ends up creating interface with name<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
as "eth0".<br>
<br>
I found some examples here:<br>
<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>
<br>
</blockquote>
<br>
_______________________________________________<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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>
<br>
</blockquote>
<br>
</blockquote></blockquote>
</div></div></blockquote></div><br></div></div>