[Solved] Error starting vm with 802.1Q network

Hi, I have created a 802.1Q interface as follows:

VIRTUAL NETWORK 13 INFORMATION
ID : 13
NAME : public
USER : oneadmin
GROUP : oneadmin
CLUSTERS : 0,100
BRIDGE : public
VN_MAD : 802.1Q
PHYSICAL DEVICE: eth0
USED LEASES : 1

PERMISSIONS
OWNER : um-
GROUP : —
OTHER : —

VIRTUAL NETWORK TEMPLATE
BRIDGE=“public”
DESCRIPTION=“Public network for vdi”
PHYDEV=“eth0”
SECURITY_GROUPS=“0”
VN_MAD=“802.1Q”

ADDRESS RANGE POOL
AR 0
SIZE : 256
LEASES : 1

RANGE FIRST LAST
MAC 02:00:c0:a8:02:00 02:00:c0:a8:02:ff
IP 192.168.2.0 192.168.2.255

LEASES
AR OWNER MAC IP IP6_GLOBAL
0 V:12 02:00:c0:a8:02:03 192.168.2.3 -

But in logs I get the following error:

Fri Dec 2 23:33:06 2016 [Z0][VMM][D]: Message received: LOG I 11 Command execution fail: /var/tmp/one/vnm/802.1Q/pre PFZNPjxJRD4xMTwvSUQ+PERFUEx…
Fri Dec 2 23:33:06 2016 [Z0][VMM][D]: Message received: LOG E 11 pre: Command "sudo ip link add link public name public. type vlan id " failed.
Fri Dec 2 23:33:06 2016 [Z0][VMM][D]: Message received: LOG E 11 pre: Command line is not complete. Try option “help”
Fri Dec 2 23:33:06 2016 [Z0][VMM][D]: Message received: LOG E 11 Command line is not complete. Try option “help”
Fri Dec 2 23:33:06 2016 [Z0][VMM][D]: Message received: LOG E 11
Fri Dec 2 23:33:06 2016 [Z0][VMM][D]: Message received: LOG I 11 ExitCode: 255
Fri Dec 2 23:33:06 2016 [Z0][VMM][D]: Message received: LOG I 11 Failed to execute network driver operation: pre.
Fri Dec 2 23:33:06 2016 [Z0][VMM][D]: Message received: DEPLOY FAILURE 11 802.1Q: Command line is not complete. Try option “help”

Any help will be welcome.

Thanks a lot.

Hi oscar!
:thinking: the log says that the following command failed:

sudo ip link add link public name public. type vlan id

That means that “public.” is trying to be used as the VLAN identifier and that’s why the ip link command fails, a VLAN id should use a number not a string. VLAN_ID is not mandatory for 802.1Q but you can use it to specify what VLAN you want to use. Could you run the following command as the oneadmin user?:

onevm show 11 -x

Only to check where is that “public.” coming from?

Happy weekend!

Hi Miguel Angel,

As you’ll can see, I have note set any vlan-id.

I have pasted the configuration of the vnet here (fedora paste):

https://da.gd/skrL

And the configuration of the vm here (fedora paste):

https://da.gd/8VBe6

Nice weekend! Feliz finde!

Morning!
looking your pastebins, I think it’s a problem with the docs or it’s a bug for vnets being created in the CLI.

Though VLAN_ID is not mandatory for 802.1Q according to docs, the VLAN ID should be generated if not defined. Your vnet template has these values once you create the vnet, so there’s no VLAN_ID to use (not your fault!).

<VLAN_ID/>
<VLAN_ID_AUTOMATIC>0</VLAN_ID_AUTOMATIC>

I’ve been following the code and the driver will try to add a subinterface in the PHYDEV (phydev.vlan_id). In your case public is the PHYDEV and you have no VLAN_ID so that’s where the “public.” comes from and why the ip link command fails.

I’ll discuss this issue, in the mean time could you please try the following?:

  • Set AUTOMATIC_VLAN_ID = “YES” in your vnet configuration file and create this network again, if you run onevnet show vnet_id -x afterwards you should find that a VLAN_ID has been autogenerated
  • Or specify a VLAN_ID like 1 for the default VLAN or any VLAN_ID that you want to use for 802.1Q

That way ip link will have the VLAN_ID that needs so desperately :smile: before running the VM.

Thanks for your feedback!

P.S: I’ll update or edit this post with any further info I found

Hi Miguel Angel,

Before trying your workarround I’d like to be sure I’m doing thinks right:

This is my network configuration:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master public state UP qlen 1000
    link/ether 00:0c:29:19:16:7c brd ff:ff:ff:ff:ff:ff
    inet6 fe80::20c:29ff:fe19:167c/64 scope link
       valid_lft forever preferred_lft forever
3: eno33554984: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master interconnect state UP qlen 1000
    link/ether 00:0c:29:19:16:86 brd ff:ff:ff:ff:ff:ff
    inet6 fe80::20c:29ff:fe19:1686/64 scope link
       valid_lft forever preferred_lft forever
4: public: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
    link/ether 00:0c:29:19:16:7c brd ff:ff:ff:ff:ff:ff
    inet 192.168.2.11/24 brd 192.168.2.255 scope global public
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe19:167c/64 scope link
       valid_lft forever preferred_lft forever
5: interconnect: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP
    link/ether 00:0c:29:19:16:86 brd ff:ff:ff:ff:ff:ff
    inet 192.168.100.11/24 brd 192.168.100.255 scope global interconnect
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe19:1686/64 scope link
       valid_lft forever preferred_lft forever
6: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN
    link/ether 52:54:00:38:33:d3 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
7: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN qlen 500
    link/ether 52:54:00:38:33:d3 brd ff:ff:ff:ff:ff:ff

I have created manually the public bridge and interconnect bridge.

In my configuration:
BRIDGE may be public ?
PHYDEV may be “public” or “eno16777736” ?

Thanks a lot.

Hi oscar,
according to docs, as you already have a bridge called public with the eno16777736 added to it, you would create the 802.1Q vnet using onevnet from a file like this:

NAME = “yourvnetname”
VN_MAD = “802.1Q”
PHYDEV = “eno16777736”
VLAN_ID = 1 # either set the VLAN_ID or set AUTOMATIC_VLAN_ID = “YES”
BRIDGE = “public”

That would create the eno16777736.VLAN_ID subinterface. If you had no public bridge, OpenNebula would create the public bridge for you connecting the PHYDEV interface. That should work fine.

Cheers!

Hi,

It looks has worked perfectly:

10: eno16777736.1@eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master public state UP
    link/ether 00:0c:29:19:16:7c brd ff:ff:ff:ff:ff:ff
    inet6 fe80::20c:29ff:fe19:167c/64 scope link
       valid_lft forever preferred_lft forever

Thanks a lot!