Incorrect reference to 802.1ad in network_data.json schema

Bug #1925388 reported by Sean Myers
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Invalid
Undecided
Unassigned
OpenStack Compute (nova)
Fix Released
Low
Balazs Gibizer

Bug Description

This affects multiple projects, including nova and ironic, and can (currently, at least) be seen in multiple references to "802.1ad" across multiple projects:

https://codesearch.opendev.org/?q=802%5C.1ad&i=nope&files=&excludeFiles=&repos=

I'm not sure how, or if it's even appropriate for these projects, to file the bug in multiple places, so I'm filing it where I perceive the error originates, in nova's definition of the network_data.json schema.

802.1ad is a nested VLAN specification, not a bonding mode specification. When referencing VLANs in the above codesearch results, it is used correctly. However, when seen in the context of bonding interfaces, "802.1ad" is not a valid bond mode. It should instead, be "802.3ad" (s/1/3/), indicating the LACP bonding mode.

This can be confirmed a number of ways, including searching for the correct string across projects. This can also be seen by comparing the enum of valid bond modes in the schema to the actual output of the "bonding" kernel module info.

schema enum in what I believe is the corresponding version tag to wallaby:

https://opendev.org/openstack/nova/src/tag/23.0.0/doc/api_schemas/network_data.json#L177

output of `modinfo bonding | grep mode:`

  parm: mode:Mode of operation; 0 for balance-rr, 1 for active-backup, 2 for balance-xor, 3 for broadcast, 4 for 802.3ad, 5 for balance-tlb, 6 for balance-alb (charp)

Note that the list of modes in the schema enum is almost exactly the same as the list of modes mentioned in the bonding kernel driver info, with the exception of the 802.1ad vs. 802.3ad difference. The list given by the kernel driver is correct.

In terms of expected vs. actual results, my expected result was that using a "bond_mode" of "802.3ad" when setting up a bond link in my network_data.json would not trigger a validation error when validating my JSON against the schema, since "802.3ad" is otherwise a valid bond mode. However, due to this error, it does trigger a validation error:

  Message: Value "802.3ad" is not defined in enum.
  Schema path: http://openstack.org/nova/network_data.json#/definitions/bond/properties/bond_mode/enum

I have not yet attempted to use this network_data.json configuration, so I don't yet know if specifying "802.1ad" results in the correct bonding mode being used anyway. This bug appears to have existed since the introduction of the schema: https://specs.openstack.org/openstack/nova-specs/specs/liberty/implemented/metadata-service-network-info.html

Tags: metadata
Changed in nova:
status: New → Confirmed
importance: Undecided → Low
tags: added: metadata
Revision history for this message
Balazs Gibizer (balazs-gibizer) wrote :

As far as I see nova only generates the DNS services to the network_data.json [1]. I can spin up a patch and fix the schema but would be nice to involve those into the review who actually knows about these parts of the metadata.

[1] https://github.com/openstack/nova/blob/50fdbc752a9ca9c31488140ef2997ed59d861a41/nova/virt/netutils.py#L212

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/nova/+/788790

Changed in nova:
status: Confirmed → In Progress
Changed in nova:
assignee: nobody → Balazs Gibizer (balazs-gibizer)
Revision history for this message
Balazs Gibizer (balazs-gibizer) wrote :

@Sean: never mind I've just learned from the other Sean (Mooney) that there is a configuration option to inject the extra metadata [1]

[1] https://docs.openstack.org/nova/latest/configuration/config.html#DEFAULT.injected_network_template

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.opendev.org/c/openstack/nova/+/788790
Committed: https://opendev.org/openstack/nova/commit/0b05b838a47f4c05ecf8443ec48a6d6b2670f579
Submitter: "Zuul (22348)"
Branch: master

commit 0b05b838a47f4c05ecf8443ec48a6d6b2670f579
Author: Balazs Gibizer <email address hidden>
Date: Thu Apr 29 17:42:59 2021 +0200

    Fix bond_mode enum 802.1ad -> 802.3ad

    This seems to me a clerical error made a long time ago in the spec [1].
    The 802.1ad values does not seems to be a valid bonding mode but 802.3ad
    does.

    This patch fixes the schema in the nova doc. No test are changed as nova
    does not generate this part of the network metadata.

    [1] https://specs.openstack.org/openstack/nova-specs/specs/kilo/approved/metadata-service-network-info.html#rest-api-impact

    Change-Id: I0055d13b055e34372a8186008ba75be68aa2edf9
    Closes-Bug: #1925388

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 24.0.0.0rc1

This issue was fixed in the openstack/nova 24.0.0.0rc1 release candidate.

Changed in ironic:
status: New → Invalid
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.