<div dir="ltr"><br><br><div class="gmail_quote">2008/9/30 Daniel P. Berrange <span dir="ltr"><<a href="mailto:berrange@redhat.com" target="_blank">berrange@redhat.com</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">


<div>On Tue, Sep 30, 2008 at 05:57:20PM +0400, Anton Protopopov wrote:<br>
> ><br>
> > Possibly, though its not terribly consistent so far.<br>
> ><br>
> > Xen  - vifNNN.MMM   (NNN dom ID, MMM = nic number)<br>
> > QEMU - vnetNNN      (NNN = global host nic number)<br>
> > LXC  - vethNNN      (MMM = global host nic number)<br>
><br>
><br>
> And how these drivers choose NNN? Do QEMU driver and LXC driver use the same<br>
> NNN?<br>
<br>
</div>Start from vnet0 and look for the first available name.<br>
<div><br>
> ><br>
> > We can't change the format Xen uses, but it could be desirable to make<br>
> > LXC, QEMU and OpenVZ all use  vnetNNN scheme by default for auto assigned<br>
> > nics names on the host side.<br>
><br>
><br>
> Now openvz driver chooses not interface name in host, but interface name in<br>
> container.<br>
<br>
</div>The interface name inside the container is not something that is expressed<br>
in the libvirt XML. That is left upto the guest OS to decide, and not<br>
something libvirt needs to care about.</blockquote><div> </div><div>In OpenVZ case you _must_ to decide what name the<br>interface will have inside the container. The command line for ading an interface in OpenVZ looks like<br>
  # vzctl set $veid --ifname_add ifname[mac, host_ifname, host_mac]<br>

The only mandatory field is the name of _container interface_<br><br>The possible solution is the following:<br><br>* absolutely ignore the <target dev=".."> in openvz XML description<br>* Set (ifname, host_ifname) of the interface to (eth${N}, veth${ID}.${N}),<br>


   where ID is the container id and N is the interface number within that container.<br><br>It is simplifies saving the bridge name and adding the interface to the bridge too,<br>for example, by adding the following line to the $veid.conf:<br>
#BRIDGE$N: <name of bridge for interface # $N ><br>
<br></div>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<br>
We only care about configuration from the host side. <br></blockquote><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>
<div><div></div><div><br>
Daniel<br>
--<br>
|: Red Hat, Engineering, London   -o-   <a href="http://people.redhat.com/berrange/" target="_blank">http://people.redhat.com/berrange/</a> :|<br>
|: <a href="http://libvirt.org" target="_blank">http://libvirt.org</a>  -o-  <a href="http://virt-manager.org" target="_blank">http://virt-manager.org</a>  -o-  <a href="http://ovirt.org" target="_blank">http://ovirt.org</a> :|<br>



|: <a href="http://autobuild.org" target="_blank">http://autobuild.org</a>       -o-         <a href="http://search.cpan.org/%7Edanberr/" target="_blank">http://search.cpan.org/~danberr/</a> :|<br>
|: GnuPG: 7D3B9505  -o-  F3C9 553F A1DA 4AC2 5648 23C1 B3DF F742 7D3B 9505 :|<br>
</div></div></blockquote></div><br></div>