ironic.drivers.modules.network.ironic_networking module

Ironic Networking Network Interface

This is a network interface designed for standalone Ironic deployments that require minimal network configuration. It implements all required NetworkInterface methods but performs no actual operations, making it suitable for environments where external network configuration is handled separately or not required.

class ironic.drivers.modules.network.ironic_networking.IronicNetworking(*args, **kwargs)[source]

Bases: NetworkInterface

Ironic Networking network interface.

This network interface is designed for standalone Ironic deployments where configuration of switch ports should be handled by Ironic.

Port Configuration: This interface validates and processes ports that have an ‘extra’ property containing a ‘switchport’ sub-property. The switchport configuration must conform to the SWITCHPORT_SCHEMA defined in ironic_networking_schemas.py.

Expected switchport configuration format: - mode: ‘access’, ‘trunk’, or ‘hybrid’ - native_vlan: VLAN ID (required) - allowed_vlans: List of VLAN IDs (required for trunk/hybrid modes only) - lag_name: Optional LAG name

Portgroup Configuration: This interface validates and processes portgroups that have an ‘extra’ property containing a ‘lag’ sub-property. The lag configuration must conform to the LAG_SCHEMA defined in ironic_networking_schemas.py.

add_cleaning_network(task)[source]

Add the cleaning network to a node.

This method configures the cleaning network for each port on the node by applying the port’s switchport configuration with the cleaning network VLAN/segment ID override if set.

Parameters:

task – A TaskManager instance.

Returns:

Empty dictionary as no ports are configured.

add_inspection_network(task)[source]

Add the inspection network to the node.

This method configures the inspection network for each port on the node by applying the port’s switchport configuration with the inspection network VLAN/segment ID override if set.

Parameters:

task – A TaskManager instance.

Returns:

Empty dictionary as no ports are configured.

add_provisioning_network(task)[source]

Add the provisioning network to a node.

This method configures the provisioning network for each port on the node by applying the port’s switchport configuration with the provisioning network VLAN/segment ID override if set.

Parameters:

task – A TaskManager instance.

add_rescuing_network(task)[source]

Add the rescuing network to the node.

This method configures the rescuing network for each port on the node by applying the port’s switchport configuration with the rescuing network VLAN/segment ID override if set.

Parameters:

task – A TaskManager instance.

Returns:

Empty dictionary as no ports are configured.

add_servicing_network(task)[source]

Add the servicing network to the node.

This method configures the servicing network for each port on the node by applying the port’s switchport configuration with the servicing network VLAN/segment ID override if set.

Parameters:

task – A TaskManager instance.

Returns:

Empty dictionary as no ports are configured.

configure_tenant_networks(task)[source]

Configure tenant networks for a node.

This method configures tenant network connectivity for each port on the node by applying the port’s switchport configuration with any tenant network overrides.

Parameters:

task – A TaskManager instance.

get_current_vif(task, p_obj)[source]

Return the currently used VIF associated with port or portgroup.

In the ironic networking interface, no VIFs are managed, so this always returns None.

Parameters:
  • task – A TaskManager instance.

  • p_obj – Ironic port or portgroup object.

Returns:

None as no VIFs are managed by this interface.

get_node_network_data(task)[source]

Return network configuration for node NICs.

This method returns network configuration data for the node. It first checks if static network data is configured on the node itself. If present, that takes precedence. Otherwise, it builds network data from the ports and portgroups attached to the node.

The network data is returned in Nova network metadata layout (network_data.json) format.

For the ironic-networking interface, this generates: - Physical links (type: “phy”) for each port with a MAC address - VLAN interfaces (type: “vlan”) for ports with allowed_vlans

configured in their switchport settings

Parameters:

task – A TaskManager instance.

Returns:

a dict holding network configuration information adhering to Nova network metadata layout (network_data.json).

need_power_on(task)[source]

Check if node must be powered on before applying network changes.

Switch operations can be performed without powering on the node.

Parameters:

task – A TaskManager instance.

Returns:

False as no power state changes are needed.

port_changed(task, port_obj)[source]

Handle any actions required when a port changes.

In the ironic networking interface, this method processes ports that have switchport configuration in their ‘extra’ field and calls the networking service API accordingly based on the node’s current provision state and what network should be active.

Parameters:
  • task – A TaskManager instance.

  • port_obj – A changed Port object.

portgroup_changed(task, portgroup_obj)[source]

Handle any actions required when a portgroup changes.

In the ironic networking interface, portgroup changes are not currently supported and will be logged but no action will be taken.

Parameters:
  • task – A TaskManager instance.

  • portgroup_obj – A changed Portgroup object.

remove_cleaning_network(task)[source]

Remove the cleaning network from a node.

This method resets the cleaning network configuration for each port on the node by restoring the port’s default switchport configuration.

Parameters:

task – A TaskManager instance.

remove_inspection_network(task)[source]

Remove the inspection network from a node.

This method resets the inspection network configuration for each port on the node by restoring the port’s default switchport configuration.

Parameters:

task – A TaskManager instance.

remove_provisioning_network(task)[source]

Remove the provisioning network from a node.

This method resets the provisioning network configuration for each port on the node by restoring the port’s default switchport configuration.

Parameters:

task – A TaskManager instance.

remove_rescuing_network(task)[source]

Remove the rescuing network from a node.

This method resets the rescuing network configuration for each port on the node by restoring the port’s default switchport configuration.

Parameters:

task – A TaskManager instance.

remove_servicing_network(task)[source]

Remove the servicing network from a node.

This method resets the servicing network configuration for each port on the node by restoring the port’s default switchport configuration.

Parameters:

task – A TaskManager instance.

unconfigure_tenant_networks(task)[source]

Unconfigure tenant networks for a node.

This method removes tenant network configuration for each port on the node by restoring the port’s default switchport configuration.

Parameters:

task – A TaskManager instance.

validate(task)[source]

Validate the network interface configuration.

For the ironic networking interface, this validates any ports that have switchport configuration in their ‘extra’ field and any portgroups that have LAG configuration in their ‘extra’ field.

Parameters:

task – A TaskManager instance.

Raises:

InvalidParameterValue if switchport or lag configuration is invalid.

validate_inspection(task)[source]

Validate that the node has required properties for inspection.

This method validates that at least one port has the required network configuration for inspection operations.

Parameters:

task – A TaskManager instance with the node being checked.

Raises:

InvalidParameterValue if unable to parse network configuration

validate_rescue(task)[source]

Validate the network interface for rescue operation.

This method validates that at least one port has the required network configuration for rescue operations.

Parameters:

task – A TaskManager instance.

Raises:

InvalidParameterValue if unable to parse network configuration

vif_attach(task, vif_info)[source]

Attach a virtual network interface to a node.

In the ironic networking interface, VIF attachment is a no-op. This allows the operation to complete successfully without performing any actual network configuration.

Parameters:
  • task – A TaskManager instance.

  • vif_info – A dictionary of information about a VIF. It must have an ‘id’ key, whose value is a unique identifier for that VIF.

vif_detach(task, vif_id)[source]

Detach a virtual network interface from a node.

In the ironic networking interface, VIF detachment is a no-op. This allows the operation to complete successfully without performing any actual network configuration.

Parameters:
  • task – A TaskManager instance.

  • vif_id – A VIF ID to detach.

vif_list(task)[source]

List attached VIF IDs for a node.

In the ironic networking interface, no VIFs are ever attached, so this always returns an empty list.

Parameters:

task – A TaskManager instance.

Returns:

Empty list as no VIFs are managed by this interface.