This Page

The quantum.agent.dhcp_agent Module

class quantum.agent.dhcp_agent.DeviceManager(conf, plugin)

Bases: object

OPTS = [<oslo.config.cfg.StrOpt object at 0x2f6d8d0>]
destroy(network, device_name)

Destroy the device used for the network’s DHCP on this host.

get_device_id(network)

Return a unique DHCP device ID for this host on the network.

get_interface_name(network, port=None)

Return interface(device) name for use by the DHCP process.

setup(network, reuse_existing=False)

Create and initialize a device for network’s DHCP on this host.

update(network)

Update device settings for the network’s DHCP on this host.

class quantum.agent.dhcp_agent.DhcpAgent(host=None)

Bases: quantum.manager.Manager

OPTS = [<oslo.config.cfg.IntOpt object at 0x2f66b10>, <oslo.config.cfg.StrOpt object at 0x2f6d190>, <oslo.config.cfg.BoolOpt object at 0x2f6d810>, <oslo.config.cfg.BoolOpt object at 0x2f6d850>, <oslo.config.cfg.BoolOpt object at 0x2f6d890>]
after_start()
call_driver(action, network)

Invoke an action on a DHCP driver instance.

disable_dhcp_helper(network_id)

Disable DHCP for a network known to the agent.

disable_isolated_metadata_proxy(network)
enable_dhcp_helper(network_id)

Enable DHCP for a network that meets enabling criteria.

enable_isolated_metadata_proxy(network)
network_create_end(*args, **kwargs)

Handle the network.create.end notification event.

network_delete_end(*args, **kwargs)

Handle the network.delete.end notification event.

network_update_end(*args, **kwargs)

Handle the network.update.end notification event.

periodic_resync()

Spawn a thread to periodically resync the dhcp state.

port_create_end(*args, **kwargs)

Handle the port.update.end notification event.

port_delete_end(*args, **kwargs)

Handle the port.delete.end notification event.

port_update_end(*args, **kwargs)

Handle the port.update.end notification event.

refresh_dhcp_helper(network_id)

Refresh or disable DHCP for a network depending on the current state of the network.

run()

Activate the DHCP agent.

subnet_create_end(*args, **kwargs)

Handle the subnet.update.end notification event.

subnet_delete_end(*args, **kwargs)

Handle the subnet.delete.end notification event.

subnet_update_end(*args, **kwargs)

Handle the subnet.update.end notification event.

sync_state()

Sync the local DHCP state with Quantum.

update_lease(network_id, ip_address, time_remaining)
class quantum.agent.dhcp_agent.DhcpAgentWithStateReport(host=None)

Bases: quantum.agent.dhcp_agent.DhcpAgent

after_start()
agent_updated(context, payload)

Handle the agent_updated notification event.

class quantum.agent.dhcp_agent.DhcpLeaseRelay(lease_update_callback)

Bases: object

UNIX domain socket server for processing lease updates.

Network namespace isolation prevents the DHCP process from notifying Quantum directly. This class works around the limitation by using the domain socket to pass the information. This class handles message. receiving and then calls the callback method.

OPTS = [<oslo.config.cfg.StrOpt object at 0x2f6d910>]
start()

Spawn a green thread to run the lease relay unix socket server.

class quantum.agent.dhcp_agent.DhcpPluginApi(topic, context)

Bases: quantum.openstack.common.rpc.proxy.RpcProxy

Agent side of the dhcp rpc API.

API version history:
1.0 - Initial version.
BASE_RPC_API_VERSION = '1.0'
get_active_networks()

Make a remote process call to retrieve the active networks.

get_dhcp_port(network_id, device_id)

Make a remote process call to create the dhcp port.

get_network_info(network_id)

Make a remote process call to retrieve network info.

release_dhcp_port(network_id, device_id)

Make a remote process call to release the dhcp port.

release_port_fixed_ip(network_id, device_id, subnet_id)

Make a remote process call to release a fixed_ip on the port.

update_lease_expiration(network_id, ip_address, lease_remaining)

Make a remote process call to update the ip lease expiration.

class quantum.agent.dhcp_agent.DictModel(d)

Bases: object

Convert dict into an object that provides attribute access to values.

class quantum.agent.dhcp_agent.NetworkCache

Bases: object

Agent cache of the current network state.

get_network_by_id(network_id)
get_network_by_port_id(port_id)
get_network_by_subnet_id(subnet_id)
get_network_ids()
get_port_by_id(port_id)
get_state()
put(network)
put_port(port)
remove(network)
remove_port(port)
quantum.agent.dhcp_agent.main()