Bug #1424

Cannot create a VM with two interfaces on the same VLAN

Added by Sylvain Baubeau over 8 years ago. Updated over 8 years ago.

Status:ClosedStart date:08/22/2012
Priority:NormalDue date:
Assignee:Jaime Melis% Done:

100%

Category:Drivers - Auth
Target version:Release 3.8
Resolution:fixed Pull request:
Affected Versions:OpenNebula 3.6

Description

If one creates a virtual machines with two interfaces and the two interfaces use the same VLAN ID, the VM fails to start with the following log :

[VMM][D]: Message received: LOG I 0 pre: Executed "sudo /sbin/brctl addbr br-200".
[VMM][D]: Message received: LOG I 0 pre: Executed "sudo /sbin/ip link set br-200 up".
[VMM][D]: Message received: LOG I 0 Device "eth1.200" does not exist.
[VMM][D]: Message received: LOG I 0 pre: Executed "sudo /sbin/vconfig add eth1 200".
[VMM][D]: Message received: LOG I 0 pre: Executed "sudo /sbin/ip link set eth1.200 up".
[VMM][D]: Message received: LOG I 0 pre: Executed "sudo /sbin/brctl addif br-200 eth1.200".
[VMM][D]: Message received: LOG E 0 pre: Command "sudo /sbin/brctl addbr br-200" failed.
[VMM][D]: Message received: LOG E 0 pre: device br-100 already exists; can't create bridge with the same name
[VMM][D]: Message received: LOG E 0 device br-100 already exists; can't create bridge with the same name

The problems seems to lay in the file 'src/vnm_mad/remotes/802.1Q/HostManaged.rb' :

The list of the existing bridges is fetched at the initialization of the OpenNebulaHM object (line 24 : @bridges = get_interfaces)
When OpenNebula creates a bridge, this list is not updated. Therefore, the second time the loop is executed, OpenNebula tries to create the bridge again.

This happens only when the bridge does not exist before the VM is started. The attached patch tries to address this issue.

0001-Keep-track-of-newly-created-bridges.patch Magnifier (1.07 KB) Sylvain Baubeau, 08/22/2012 12:11 AM

History

#1 Updated by Ruben S. Montero over 8 years ago

  • Assignee set to Jaime Melis
  • Target version set to Release 3.8

#2 Updated by Ruben S. Montero over 8 years ago

  • Status changed from New to Assigned

#3 Updated by Jaime Melis over 8 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100
  • Resolution set to fixed

Very good catch Sylvain! thanks for the patch, I applied it as is.

Also available in: Atom PDF