Automatic VLAN ID not work for vCenter Port Group

Hello,

I am working on OpenNebula + vCenter network. It is seems Automatic VLAN ID not work for vCenter Port Group (In oned.conf, VLAN_IDS is for 802.1Q and Open vSwitch driver. However, AUTOMATIC_VLAN_ID should support vcenter driver)

Versions of the related components and OS (frontend, hypervisors, VMs):

OpenNebula 5.4.0, vCenter 6.5

Steps to reproduce:

  1. Edit /etc/one/oned.conf
    VLAN_IDS = [
    START = "1100"
    RESERVED = “0, 1, 4095”
    ]
  2. Create Virtual Network (select network mode as vCenter; VLAN ID select Automatic VLAN ID)

Current results:

  1. vSwitch can be created on ESXi host
  2. Port group can be created, but no VLAN ID

Expected results:
Refer to below link, attribute AUTOMATIC_VLAN_ID supported in vcenter driver:
https://docs.opennebula.org/5.4/operation/references/vnet_template.html

I assume VLAN ID is generated (1100-4094) for the port group.

I find the below hook file is used to create vswitch / port group on ESXi hosts under vCenter Server:

  • /var/lib/one/remotes/hooks/vcenter/create_vcenter_net.rb

The following line set VLAN ID which obtain from template or set to 0:

  • vlan_id = template[“VLAN_ID”] || template[“AUTOMATIC_VLAN_ID”] || 0

If I create network with specific VLAN ID, it works. That means no problem for template[“VLAN_ID”] .
If I select Automatic VLAN I, the output will be 0 (no VLAN ID). I believe vlan_id is set to 0 instead of template[“AUTOMATIC_VLAN_ID”].

I had edit the hook as below but it will result into error:

vlan_id = template[“AUTOMATIC_VLAN_ID”]

VCENTER_NET_ERROR : A port group with name TestPG could not be created. Reason: InvalidRequest: Required property vlanId is missing from data object of type HostPortGroupSpec while parsing serialized DataObject of type vim.host.PortGroup.Specification at line 1, column 265 while parsing call information for method AddPortGroup at line 1, column 177 while parsing SOAP body at line 1, column 167 while parsing SOAP envelope at line 1, column 0 while parsing HTTP request for method addPortGroup on object of type vim.host.NetworkSystem at line 1, column 0

It is seems have problem on template[“AUTOMATIC_VLAN_ID”] .

Does anyone success to generate VLAN ID with vCenter managed network? Thanks!

Hi Kin,

digging into the code it seems that this functionality is broken.
Sorry about that im going to check this and we will have fixed the vcenter automatic_vlan_id for the next release.

Thanks.

Hi Semedi,

Thank you for your reply :slight_smile: Hope the problem can be fixed soon

I’ve also waiting for this fix :slight_smile: