The ironic.dhcp.base Module

Abstract base class for dhcp providers.

class ironic.dhcp.base.BaseDHCP[source]

Bases: object

Base class for DHCP provider APIs.

get_ip_addresses(task)[source]

Get IP addresses for all ports in task.

Parameters:task – a TaskManager instance.
Returns:List of IP addresses associated with task.ports
update_dhcp_opts(task, options, vifs=None)[source]

Send or update the DHCP BOOT options for this node.

Parameters:
  • task – A TaskManager instance.
  • options

    this will be a list of dicts, e.g.

    [{'opt_name': 'bootfile-name',
      'opt_value': 'pxelinux.0'},
     {'opt_name': 'server-ip-address',
      'opt_value': '123.123.123.456'},
     {'opt_name': 'tftp-server',
      'opt_value': '123.123.123.123'}]
    
    param vifs:a dict of Neutron port dicts to update DHCP options on. The keys should be Ironic port UUIDs, and the values should be Neutron port UUIDs If the value is None, will get the list of ports from the Ironic port objects.
Raises:

FailedToUpdateDHCPOptOnPort

update_port_address(port_id, address, token=None)[source]

Update a port’s MAC address.

Parameters:
  • port_id – port id.
  • address – new MAC address.
  • token – An optional authenticaiton token.
Raises:

FailedToUpdateMacOnPort

update_port_dhcp_opts(port_id, dhcp_options, token=None)[source]

Update one or more DHCP options on the specified port.

Parameters:
  • port_id – designate which port these attributes will be applied to.
  • dhcp_options

    this will be a list of dicts, e.g.

    [{'opt_name': 'bootfile-name',
      'opt_value': 'pxelinux.0'},
     {'opt_name': 'server-ip-address',
      'opt_value': '123.123.123.456'},
     {'opt_name': 'tftp-server',
      'opt_value': '123.123.123.123'}]
    
  • token – An optional authenticaiton token.
Raises:

FailedToUpdateDHCPOptOnPort

This Page