Bug 1015608 - Getting error "Unable to add port macvtap0 to OVS bridge Test1" while adding VM interface to OVS
Summary: Getting error "Unable to add port macvtap0 to OVS bridge Test1" while adding ...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Virtualization Tools
Classification: Community
Component: libvirt
Version: unspecified
Hardware: All
OS: Linux
unspecified
high
Target Milestone: ---
Assignee: Libvirt Maintainers
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-04 15:19 UTC by Haresh
Modified: 2016-04-27 13:51 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-04-27 13:51:07 UTC
Embargoed:


Attachments (Terms of Use)
Screen shot (13.35 KB, image/png)
2013-10-04 15:19 UTC, Haresh
no flags Details

Description Haresh 2013-10-04 15:19:52 UTC
Created attachment 807734 [details]
Screen shot

Description of problem:
Hi,

I am trying to add virtual machine's interface to openvswitch created bridge.
Following is output of virsh
[root@O6MXHE4 tmp]# virsh dumpxml Data-VM2
....
    <interface type='bridge'>
      <mac address='52:54:00:76:b7:64'/>
      <source bridge='Test1'/>
      <virtualport type='openvswitch'>
        <parameters interfaceid='cffede7f-f99e-4bc0-8438-34a64ab36e58'/>
      </virtualport>
      <target dev='macvtap0'/>
      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>
......

When i started domain, it threw me following error.

[root@O6MXHE4 tmp]# virsh start Data-VM2 --console
error: Failed to start domain Data-VM2
error: Unable to add port macvtap0 to OVS bridge Test1: Operation not permitted

Following is stack trace  when VM is started at virt-manager.
Error starting domain: Unable to add port macvtap0 to OVS bridge Test1: Operation not permitted

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 44, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 65, in tmpcb
    callback(*args, **kwargs)
  File "/usr/share/virt-manager/virtManager/domain.py", line 1063, in startup
    self._backend.create()
  File "/usr/lib64/python2.6/site-packages/libvirt.py", line 678, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: Unable to add port macvtap0 to OVS bridge Test1: Operation not permitted

Version-Release number of selected component (if applicable):
[root@O6MXHE4 tmp]# cat /etc/lsb-release
LSB_VERSION=base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch

[root@O6MXHE4 tmp]# ovs-vsctl -V
ovs-vsctl (Open vSwitch) 1.9.0
Compiled Aug 19 2013 23:40:33
[root@O6MXHE4 tmp]#

[root@O6MXHE4 tmp]# libvirtd --version
libvirtd (libvirt) 0.10.2
[root@O6MXHE4 tmp]#


How reproducible:
1) Bring up said version of openvswitch
2) Configure bridge
[root@O6MXHE4 tmp]# ovs-vsctl show
cffede7f-f99e-4bc0-8438-34a64ab36e58
    Bridge "Test1"
        Port "Test1"
            Interface "Test1"
                type: internal
3) Create VM using virt manager
4) associate OVS created bridge "Test1" as shown in attached screen shot.

Steps to Reproduce:
1. Please follow above steps

Actual results:
Error thrown

Expected results:
vnet/macvtap intefaces should be added to OVS bridge

Additional info:
NA

Comment 1 Haresh 2013-10-04 15:22:14 UTC
This issue is consistent reproducible.

[root@O6MXHE4 tmp]# uname -a
Linux O6MXHE4 2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@O6MXHE4 tmp]#


Thanks
-Haresh

Comment 2 Haresh 2013-10-09 09:16:46 UTC
Hi,

Can anybody help me with work around? I am not able to use OVS with lib virt due to this issue.

Thanks
-Haresh

Comment 3 Michael Liu 2016-04-27 09:46:00 UTC
You can run the following command to see the results:
 
"ovsctl add-port Test1 macvtap0",

Check whether the same error will occur.

Comment 4 Laine Stump 2016-04-27 13:51:07 UTC
It is nonsensical to tell libvirt to use a macvtap device to connect to a bridge device (whether it is a standard Linux bridge or an OVS bridge). Simply remove the <target dev='macvtap0'/> from your config and let libvirt create a tap device itself and you won't have any problem.

    <interface type='bridge'>
      <mac address='52:54:00:76:b7:64'/>
      <source bridge='Test1'/>
      <virtualport type='openvswitch'>
        <parameters interfaceid='cffede7f-f99e-4bc0-8438-34a64ab36e58'/>
      </virtualport>
      <target dev='macvtap0'/>
                   ^^^^^^^^^^^^


      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
    </interface>


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