Bug #4989

Open vSwitch: VLAN_ID is not generated automatically when missing

Added by EOLE Team almost 4 years ago. Updated about 3 years ago.

Status:ClosedStart date:01/20/2017
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Drivers - Network
Target version:-
Resolution: Pull request:
Affected Versions:OpenNebula 4.12

Description

Hello,

I'm following the thread on the forum.

According to the documentation, when the VLAN_ID is missing it will be automatically generated.

This does not work and here are the steps to reproduce:

  1. Create a network template:
    oneadmin@one:~# cat > vnet.tmpl <<EOF
    NAME="test-vnet" 
    VN_MAD="ovswitch" 
    BRIDGE="vswitch" 
    EOF
    
  2. Create the network:
    oneadmin@one:~# onevnet create -c 0 vnet.tmpl
    ID: 8
    

Here is the resulting vnet XML:

oneadmin@one:~# onevnet show -x test-vnet
<VNET>
  <ID>8</ID>
  <UID>0</UID>
  <GID>0</GID>
  <UNAME>oneadmin</UNAME>
  <GNAME>oneadmin</GNAME>
  <NAME>test-vnet</NAME>
  <PERMISSIONS>
    <OWNER_U>1</OWNER_U>
    <OWNER_M>1</OWNER_M>
    <OWNER_A>0</OWNER_A>
    <GROUP_U>0</GROUP_U>
    <GROUP_M>0</GROUP_M>
    <GROUP_A>0</GROUP_A>
    <OTHER_U>0</OTHER_U>
    <OTHER_M>0</OTHER_M>
    <OTHER_A>0</OTHER_A>
  </PERMISSIONS>
  <CLUSTERS>
    <ID>0</ID>
  </CLUSTERS>
  <BRIDGE><![CDATA[vswitch]]></BRIDGE>
  <PARENT_NETWORK_ID/>
  <VN_MAD><![CDATA[ovswitch]]></VN_MAD>
  <PHYDEV/>
  <VLAN_ID/>
  <VLAN_ID_AUTOMATIC>0</VLAN_ID_AUTOMATIC>
  <USED_LEASES>0</USED_LEASES>
  <VROUTERS/>
  <TEMPLATE>
    <BRIDGE><![CDATA[vswitch]]></BRIDGE>
    <PHYDEV><![CDATA[]]></PHYDEV>
    <SECURITY_GROUPS><![CDATA[0]]></SECURITY_GROUPS>
    <VN_MAD><![CDATA[ovswitch]]></VN_MAD>
  </TEMPLATE>
  <AR_POOL/>
</VNET>

The VLAN_ID is null and VLAN_ID_AUTOMATIC is 0.

Miguel Ángel Alvarez Cabrerizo give me the solution to use AUTOMATIC_VLAN_ID="YES"

  1. Delete the network
    oneadmin@one:~# onevnet delete test-vnet
    
  2. Update the network template:
    oneadmin@one:~# cat >> vnet.tmpl <<EOF
    AUTOMATIC_VLAN_ID="YES" 
    EOF
    
  3. Create the network:
    oneadmin@one:~# onevnet create -c 0 vnet.tmpl
    ID: 9
    

Here is the resulting vnet XML:

<VNET>
  <ID>9</ID>
  <UID>0</UID>
  <GID>0</GID>
  <UNAME>oneadmin</UNAME>
  <GNAME>oneadmin</GNAME>
  <NAME>test-vnet</NAME>
  <PERMISSIONS>
    <OWNER_U>1</OWNER_U>
    <OWNER_M>1</OWNER_M>
    <OWNER_A>0</OWNER_A>
    <GROUP_U>0</GROUP_U>
    <GROUP_M>0</GROUP_M>
    <GROUP_A>0</GROUP_A>
    <OTHER_U>0</OTHER_U>
    <OTHER_M>0</OTHER_M>
    <OTHER_A>0</OTHER_A>
  </PERMISSIONS>
  <CLUSTERS>
    <ID>0</ID>
  </CLUSTERS>
  <BRIDGE><![CDATA[vswitch]]></BRIDGE>
  <PARENT_NETWORK_ID/>
  <VN_MAD><![CDATA[ovswitch]]></VN_MAD>
  <PHYDEV/>
  <VLAN_ID><![CDATA[11]]></VLAN_ID>
  <VLAN_ID_AUTOMATIC>1</VLAN_ID_AUTOMATIC>
  <USED_LEASES>0</USED_LEASES>
  <VROUTERS/>
  <TEMPLATE>
    <BRIDGE><![CDATA[vswitch]]></BRIDGE>
    <PHYDEV><![CDATA[]]></PHYDEV>
    <SECURITY_GROUPS><![CDATA[0]]></SECURITY_GROUPS>
    <VN_MAD><![CDATA[ovswitch]]></VN_MAD>
  </TEMPLATE>
  <AR_POOL/>
</VNET>

So either the documentation is wrong or the code does not work as expected.

Regards.

NB: the AUTOMATIC_VLAN_ID attribute is not documented in Virtual Network Definition
NB2: is there a way to update the already created networks to fix them or should I write a fixture to directly update the database?

History

#1 Updated by Miguel Ángel Álvarez Cabrerizo almost 4 years ago

Hi!
I've just created a PR to include information about AUTOMATIC_VLAN_ID (master and one-5.2) for the Virtual Networks Definition and Open vSwitch Networks.

Cheers!

#2 Updated by Javi Fontan about 3 years ago

  • Status changed from Pending to Closed
  • Affected Versions OpenNebula 4.12 added

You can not change a network from manual VLAN ID selection to automatic or the other direction. You can change the VLAN ID with onevnet update if it's manually selected.

Closing the issue as documentation is already updated.

Also available in: Atom PDF