Bug 1325687

Summary: RFE: lxc: support interface type="ethernet"
Product: [Community] Virtualization Tools Reporter: Abhishek Jain <ashujain9727>
Component: libvirtAssignee: Laine Stump <laine>
Status: CLOSED UPSTREAM QA Contact:
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: unspecifiedCC: ashujain9727, crobinso, libvirt-maint, rbalakri, soniaverma9727, topradeepyaduvanshi, yalzhang
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-08-10 14:52:59 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
attached is the xml file witj network type=ethernet none

Description Abhishek Jain 2016-04-10 16:49:22 UTC
Created attachment 1145692 [details]
attached is the xml file witj network type=ethernet

Description of problem:
I need to launch  LXC VM using ethernet network type using libvirt.While trying the same, I'm getting below errors ..

error: internal error: Unsupported network type ethernet

However using KVM I'm able to launch the VM using ethernet network type. 

Version-Release number of selected component (if applicable):

1.2.2
How reproducible:
Please fine the attached XML file with network type="ethernet"


Steps to Reproduce:

1.virsh -c lxc: define lxc.xmk
2.virsh -c lxc: start test


Actual results:
Unsupported network type ethernet

Expected results:

Instance should be running

Additional info:

Comment 1 Cole Robinson 2016-04-10 22:05:06 UTC
ethernet support was actually enabled for lxc via this commit:

commit 22cff52a2b8e06c913b1f97767e5d390fb17fc3b
Author: Anirban Chakraborty <abchak>
Date:   Tue Nov 18 15:55:48 2014 -0800

    network: Add network bandwidth support to ethernet interfaces


Which looks like libvirt v1.2.10 or v1.2.11

Comment 2 Abhishek Jain 2016-04-11 18:30:34 UTC
(In reply to Cole Robinson from comment #1)
> ethernet support was actually enabled for lxc via this commit:
> 
> commit 22cff52a2b8e06c913b1f97767e5d390fb17fc3b
> Author: Anirban Chakraborty <abchak>
> Date:   Tue Nov 18 15:55:48 2014 -0800
> 
>     network: Add network bandwidth support to ethernet interfaces
> 
> 
> Which looks like libvirt v1.2.10 or v1.2.11

I'm trying to launch LXC VM with libvirt 1.2.12 having commit 22cff52a2b8e06c913b1f97767e5d390fb17fc3b with below XML configuration..

<domain type="lxc">
  <uuid>64c48da2-e318-4085-8b88-c980aab4de34</uuid>
  <name>test</name>
  <memory>524288</memory>
  <vcpu>1</vcpu>
  <os>
    <type machine="virt">exe</type>
    <cmdline>root=/dev/ram0 rw  console=ttyAMA0 rootwait earlyprintk</cmdline>
    <init>/bin/sh</init>
  </os>
  <clock offset="utc"/>
  <devices>
    <file/>
    <interface type='ethernet'>
      <mac address='02:74:ff:9d:52:f5'/>
      <script path=''/>
      <target dev='tap74f2-f5'/>
    </interface>
    <console type="pty"/>
  </devices>
</domain>

I'm getting following errors while launching LXC VM using above XML file..

virsh -c lxc: define lxc.xml
virsh -c lxc: start test                                                                                                        
error: Failed to start domain test
error: internal error: guest failed to start: /usr/lib/libvirt/libvirt_lxc: option '--veth' requires an argument
syntax: /usr/lib/libvirt/libvirt_lxc [OPTIONS]
Options
  -b, --background
  -n NAME, --name NAME
  -c FD, --console FD
  -v VETH, --veth VETH
  -s FD, --handshakefd FD
  -S NAME, --security NAME
  -h, --help
Unknown failure in libvirt_lxc startup

Comment 3 Cole Robinson 2016-04-11 18:38:39 UTC
To clarify, this was discussed on list here:

http://www.redhat.com/archives/libvirt-users/2016-April/msg00031.html

The above commit I referenced doesn't actually add working type=ethernet support, so I sent a patch to make the error explicit again:

http://www.redhat.com/archives/libvir-list/2016-April/msg00505.html

So the RFC for proper type=ethernet support is still relevant

Comment 4 Abhishek Jain 2016-04-12 06:09:52 UTC
(In reply to Cole Robinson from comment #3)
> To clarify, this was discussed on list here:
> 
> http://www.redhat.com/archives/libvirt-users/2016-April/msg00031.html
> 
> The above commit I referenced doesn't actually add working type=ethernet
> support, so I sent a patch to make the error explicit again:
> 
> http://www.redhat.com/archives/libvir-list/2016-April/msg00505.html
> 
> So the RFC for proper type=ethernet support is still relevant

Hi Cole

I tested the LXC VM with libvirt 1.2.12 after applying the patch 

http://www.redhat.com/archives/libvir-list/2016-April/msg00505.html

I'm now getting errors..

virsh -c lxc: start test      
error: Failed to start domain test
error: internal error: Unsupported network type ethernet

I'm using the below XML file for launching LXC VM..

<domain type="lxc">
  <uuid>64c48da2-e318-4085-8b88-c980aab4de34</uuid>
  <name>test</name>
  <memory>524288</memory>
  <vcpu>1</vcpu>
  <os>
    <type machine="virt">exe</type>
    <cmdline>root=/dev/ram0 rw  console=ttyAMA0 rootwait earlyprintk</cmdline>
    <init>/bin/sh</init>
  </os>
  <clock offset="utc"/>
  <devices>
    <file/>
    <interface type='ethernet'>
      <mac address='02:74:ff:9d:52:f5'/>
      <script path=''/>
      <target dev='tap74f2-f5'/>
    </interface>
    <console type="pty"/>
  </devices>
</domain>

Thanks
Abhishek Jain

Thanks

Comment 5 Ján Tomko 2016-04-13 13:23:34 UTC
*** Bug 1326819 has been marked as a duplicate of this bug. ***

Comment 6 Pradeep Kumar 2016-04-28 10:30:48 UTC
Hi Team,

Do LXC hypervisor support interface_type="Ethernet" now, if yes Please let me know as i am facing the same issue from last few days.

Comment 7 Cole Robinson 2016-04-29 10:24:22 UTC
No, libvirt does not support type=ethernet for LXC, and I don't think anyone is currently working on it

Comment 8 Cole Robinson 2016-05-16 22:30:10 UTC
Patch posted upstream:

http://www.redhat.com/archives/libvir-list/2016-May/msg01172.html

Comment 9 Cole Robinson 2016-08-10 14:52:59 UTC
Patch is upstream nowadays:

commit 002b7704ff757f4bb30741b6fa78a469f6e543d0
Author: Laine Stump <laine>
Date:   Fri May 13 13:20:54 2016 -0400

    lxc: support <interface type='ethernet'>