Enrich integration with ironic networking features

Registered by Harald Jensås

Networking in Ironic, and in neutron, has made some advances. With support for routed networks and physical network awareness triplo-common's mechanism to register nodes should be updated to enable integration with these features.

The proposed change is to the node element in node_json.

The "mac" array should be deprecated, replaced with a "ports" array containing a list of dicts holding a richer data set matching the properties of ports in the Bare Metal service api.

New additonal data is physical_network and local_link_information.
The mac key is replaced by address to match the Bare Metal service api.

address: (mandatory)
    Replaces mac, holds the physical address of the port.
physical_network: (mandatory)
    This maps to the physical_network attribuite of baremetal ports.
    This is required for physical network awareness in the Bare Metal service, e.g routed networks.
local_link_connection: (optional)
    This maps to local_link_information attribute of baremetal ports.
    This enables automatic configuration of switches via neutron plug-ins. e.g ML2 vendor plugins.

Example:
{
    "nodes": [
        {
            "pm_type": "ipmi",
            "ports": [
                {"address": "52:54:00:87:c8:2f",
                 "physical_network": "ctlplane",
                 "local_link_connection": {
                     "switch_info": "switch",
                     "port_id": "gi1/0/11",
                     "switch_id": "a6:18:66:33:cb:48"}
                }
            ],
            "pm_user": "admin",
            "pm_password": "password",
            "pm_addr": "172.16.103.254",
            "pm_port": "6230",
            "name": "foo-node-01"
        }
    ]
}

Implementation is fairly straightforward in tripleo-common, something like below + updating validations and new tests.

Pseudo code: tripleo_common/utils/nodes.py

if node.get("ports", []):
    for port in ports:
        client.port.create(address=port['address'],
                                   physical_network=port['physical_network'],
                                   local_link_information=port.get('local_link_information', {}),
                                   node_uuid=ironic_node.uuid)
else:
    for mac in node.get("mac", []):
        client.port.create(address=mac, physical_network=CTLPLANE_NETWORK,
                                   node_uuid=ironic_node.uuid)

Blueprint information

Status:
Complete
Approver:
Alex Schultz
Priority:
Medium
Drafter:
Harald Jensås
Direction:
Approved
Assignee:
Harald Jensås
Definition:
Approved
Series goal:
Accepted for rocky
Implementation:
Implemented
Milestone target:
milestone icon rocky-2
Started by
Harald Jensås
Completed by
Emilien Macchi

Related branches

Sprints

Whiteboard

Gerrit topic: https://review.openstack.org/#q,topic:bp/enrich-ironic-networking-integration,n,z

Addressed by: https://review.openstack.org/556490
    Enrich integration with ironic networking features

Addressed by: https://review.openstack.org/560868
    Docs: Enrich integration with ironic networking features

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.