ironic.common.neutron.
PHYSNET_PARAM_NAME
= 'provider:physical_network'¶Name of the neutron network API physical network parameter.
ironic.common.neutron.
SEGMENTS_PARAM_NAME
= 'segments'¶Name of the neutron network API segments parameter.
ironic.common.neutron.
add_ports_to_network
(task, network_uuid, security_groups=None)[source]¶Create neutron ports to boot the ramdisk.
Create neutron ports for each pxe_enabled port on task.node to boot the ramdisk.
Parameters: |
|
---|---|
Raises: | NetworkError |
Returns: | a dictionary in the form {port.uuid: neutron_port[‘id’]} |
ironic.common.neutron.
get_local_group_information
(task, portgroup)[source]¶Extract the portgroup information.
The information is returned in the form of:
{
'id': portgroup.uuid,
'name': portgroup.name,
'bond_mode': portgroup.mode,
'bond_properties': {
'bond_propertyA': 'valueA',
'bond_propertyB': 'valueB',
}
}
Parameters: |
|
---|---|
Returns: | port group information as a dict |
ironic.common.neutron.
get_node_portmap
(task)[source]¶Extract the switch port information for the node.
The information is returned in the form of:
{
port.uuid: {
'switch_id': 'abc',
'port_id': 'Po0/1',
'other_llc_key': 'val'
}
}
Parameters: | task – a task containing the Node object. |
---|---|
Returns: | port information as a dict |
ironic.common.neutron.
get_physnets_by_port_uuid
(client, port_uuid)[source]¶Return the set of physical networks associated with a neutron port.
Query the network to which the port is attached and return the set of physical networks associated with the segments in that network.
Parameters: |
|
---|---|
Returns: | A set of physical networks. |
Raises: | NetworkError if the network query fails. |
Raises: | InvalidParameterValue for missing network. |
ironic.common.neutron.
is_smartnic_port
(port_data)[source]¶Check that the port is Smart NIC port
Parameters: | port_data – an instance of ironic.objects.port.Port or port data as dict. |
---|---|
Returns: | A boolean to indicate port as Smart NIC port. |
ironic.common.neutron.
remove_neutron_ports
(task, params)[source]¶Deletes the neutron ports matched by params.
Parameters: |
|
---|---|
Raises: | NetworkError |
ironic.common.neutron.
remove_ports_from_network
(task, network_uuid)[source]¶Deletes the neutron ports created for booting the ramdisk.
Parameters: |
|
---|---|
Raises: | NetworkError |
ironic.common.neutron.
rollback_ports
(task, network_uuid)[source]¶Attempts to delete any ports created by cleaning/provisioning
Purposefully will not raise any exceptions so error handling can continue.
Parameters: |
|
---|
ironic.common.neutron.
unbind_neutron_port
(port_id, client=None, context=None)[source]¶Unbind a neutron port
Remove a neutron port’s binding profile and host ID so that it returns to an unbound state.
Parameters: |
|
---|---|
Raises: | NetworkError |
ironic.common.neutron.
update_port_address
(port_id, address, context=None)[source]¶Update a port’s mac address.
Parameters: |
|
---|---|
Raises: | FailedToUpdateMacOnPort |
ironic.common.neutron.
validate_network
(uuid_or_name, net_type=u'network', context=None)[source]¶Check that the given network is present.
Parameters: |
|
---|---|
Returns: | network UUID |
Raises: | MissingParameterValue if uuid_or_name is empty |
Raises: | NetworkError on failure to contact Neutron |
Raises: | InvalidParameterValue for missing or duplicated network |
ironic.common.neutron.
validate_port_info
(node, port)[source]¶Check that port contains enough information for deploy.
Neutron network interface requires that local_link_information field is filled before we can use this port.
Parameters: |
|
---|---|
Returns: | True if port info is valid, False otherwise. |
ironic.common.neutron.
wait_for_host_agent
(*args, **kw)[source]¶Wait for neutron agent to become target state
Parameters: |
|
---|---|
Returns: | boolean indicates the agent state matches param value target_state_up. |
Raises: | exception.Invalid if ‘target_state’ is not valid. |
Raises: | exception.NetworkError if host status didn’t match the required status after max retry attempts. |
ironic.common.neutron.
wait_for_port_status
(*args, **kw)[source]¶Wait for port status to be the desired status
Parameters: |
|
---|---|
Returns: | boolean indicates that the port status matches the required value passed by param status. |
Raises: | InvalidParameterValue if the port does not exist. |
Raises: | exception.NetworkError if port status didn’t match the required status after max retry attempts. |
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.