Expose trunk details in metadata and configdrive

Bug #1693535 reported by Baodong (Robert) Li
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Opinion
Wishlist
Baodong (Robert) Li

Bug Description

Vlan trunking has been supported since Mitaka. Refer to https://wiki.openstack.org/wiki/Neutron/TrunkPort. However, for guest instances with trunk ports, vlan subinterfaces are not automatically configured. This bug attempts to address this by exposing trunk details in metadata and configdrive, with which cloud-init will configure vlan subinterfaces.

Changed in nova:
assignee: nobody → Baodong (Robert) Li (baoli)
Revision history for this message
Jay Pipes (jaypipes) wrote :

Hi Robert,

How about simply extending the 'nic' device type in the existing device metadata?

http://specs.openstack.org/openstack/nova-specs/specs/ocata/approved/virt-device-tagged-attach-detach.html

Best,

-jay

Revision history for this message
sean mooney (sean-k-mooney) wrote :

while this would be nice to have, im not really sure its a bug since automatically creating subports in the guess was considered out of scope of this feature as it is not always wanted.

having the info available in the metadata is a good idea but creating subports automatically will break vnf that expect to process the vlans themselves and not expect vlan subports to be created.

as such i think the auto creation should not be enabled by default and only be done if the tenant expressly asks for it.

Revision history for this message
Matt Riedemann (mriedem) wrote :

This is not a bug. If you want to add this it will require a blueprint.

Changed in nova:
status: New → Opinion
importance: Undecided → Wishlist
Revision history for this message
Baodong (Robert) Li (baoli) wrote :

@jaypipes:

Thanks for the link. I took a look at it, and it doesn't seem to me that it's intended for this purpose. To configure trunk port and its sub interfaces require clear identification of parent-subport relationship that tagging won't be able to adequately support.

A simple idea is to populate the network_data.json file in the configdrive based on the trunk_details in trunk ports. For example, the following network_data.json file contains one trunk port with three sub interfaces.

network_data.json file

services": [],
"networks": [
    {
        "network_id": "9f1c0636-ba1f-42fd-a741-a2d0194704b5",
        "link": "tapad7e2436-35",
        "type": "ipv4_dhcp",
        "id": "network0"
    },
    {
          "network_id": "ea077fad-e52a-4fa1-952f-06110e436d7d",
          "link": "tap143d8632-e3",
          "type": "ipv4_dhcp",
          "id": "network1"
    },
    {
        "network_id": "bbd6f034-a600-46c1-b22f-0502697e179e",
        "link": "tap4bc16b9c-e2",
        "type": "ipv4_dhcp",
        "id": "network2"
    },
    {
        "network_id": "0597cc43-7a2f-4ac0-847e-d9639d83fb6e",
        "link": "tap9189504d-42",
        "type": "ipv4_dhcp",
        "id": "network3"
    }
],
"links": [
    { // trunk
        "ethernet_mac_address": "fa:16:3e:54:2e:51",
        "mtu": 1500,
        "type": "ovs",
        "id": "tapad7e2436-35",
        "vif_id": "ad7e2436-3583-4ae3-844b-06e6b0adaf04"
    },
    { // sub interface
        "vif_id": "143d8632-e320-4fdb-aa07-bf2767085efd",
        "mtu": 1500,
        "vlan_link": "tapad7e2436-35",
        "vlan_id": 3279,
        "type": "vlan",
        "id": "tap143d8632-e3",
        "vlan_mac_address": "fa:16:3e:8e:b4:99"
    },
    { // sub interface
        "vif_id": "4bc16b9c-e2b6-4c09-ba98-e94160cce12d",
        "mtu": 1500,
        "vlan_link":"tapad7e2436-35",
        "vlan_id": 3274,
        "type": "vlan",
        "id": "tap4bc16b9c-e2",
        "vlan_mac_address": "fa:16:3e:a4:93:98"
    },
    { // sub interface
        "vif_id": "9189504d-4251-46ea-a676-2573b4e14580",
        "mtu": 1500,
        "vlan_link": "tapad7e2436-35",
        "vlan_id": 3272,
        "type": "vlan",
        "id": "tap9189504d-42",
        "vlan_mac_address": "fa:16:3e:72:d5:33"
    }
]
}

The network_data.json file is currently supported by cloud-init (and glean).

Revision history for this message
Baodong (Robert) Li (baoli) wrote :

@sean-k-mooney:

Thanks for the comment.

I was thinking about that. Shall a config option be introduced to enable/disable the auto generation of trunk sub interfaces in the config drive?

Revision history for this message
Baodong (Robert) Li (baoli) wrote :

@mriedem:

sure. I can add a blueprint.

Revision history for this message
Baodong (Robert) Li (baoli) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.