Bug 683834 - ifname in openvz container
Summary: ifname in openvz container
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: Unspecified
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-03-10 13:16 UTC by knawnd
Modified: 2016-03-23 12:01 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-03-23 12:01:10 UTC
Embargoed:


Attachments (Terms of Use)

Description knawnd 2011-03-10 13:16:49 UTC
Description of problem:
It looks for me like there is no way to specify ethernet device name to be created inside the openvz container. At least I couldn't find such info at http://libvirt.org/formatdomain.html#elementsNICS.
If I do as below I get br0 as ethernet device inside VM whereas I'd like it to be eth0.

Version-Release number of selected component (if applicable):
ovzkernel release is 2.6.18-194.26.1.el5.028stab081.1, vzctl-3.0.26-1, OS is CentOS 5.5, libvirt/virsh version is 0.8.8, 

How reproducible:
$ cat ovz.xml
<domain type='openvz' id='144'>
  <name>144</name>
  <uuid>0071c128-58b4-4688-be17-1e062a22b36c</uuid>
  <vcpu>1</vcpu>
  <memory>524288</memory>
  <os>
    <type>exe</type>
    <init>/sbin/init</init>
  </os>
  <devices>
    <filesystem type='template'>
      <source name='centos-5-x86'/>
      <target dir='/'/>
    </filesystem>
    <interface type='bridge'>
      <source bridge='br0'/>
    </interface>
  </devices>
</domain>

$ virsh create ovz.xml
Domain 144 created from ovz.xml


Actual results:
$ grep -i netif /etc/vz/conf/144.conf
NETIF="ifname=br0,bridge=br0,mac=52:54:00:74:DD:F3,host_ifname=veth144.0,host_mac=52:54:00:06:78:76"


Expected results:
$ grep -i netif /etc/vz/conf/144.conf
NETIF="ifname=eth0,bridge=br0,mac=52:54:00:74:DD:F3,host_ifname=veth144.0,host_mac=52:54:00:06:78:76"


Additional info:
One of the possible reason of observing behaviour is the syntax of vzctl commands had been changed since 3.0.22 version as it's written at http://wiki.openvz.org/Veth#syntax_vzctl_version_.3E_3.0.22.

Comment 1 Cole Robinson 2016-03-23 12:01:10 UTC
commit 7a5ac8352073bd9babbec76d2ef74df7ab8e61eb
Author: Alvaro Polo <apoloval>
Date:   Tue Jun 4 09:44:32 2013 +0200

    Fix a invalid usage of virDomainNetDef in OpenVZ driver
    
    OpenVZ was accessing ethernet data to obtain the guest iface name
    regardless the domain is configured to use ethernet or bridged
    networking. This prevented the guest network interface to be rightly
    named for bridged networking.


Note You need to log in before you can comment on or make changes to this bug.