Enable dhcp agent HA by default in neutron (enable dhcp HA)

This section describes how to use the agent management (alias agent) and scheduler (alias agent_scheduler) extensions for DHCP agents scalability and HA.

  • First of all we need to set dhcp-agents-per-network=2 in neutron-api juju charm configuration (this is the number of dhcp agents to be deployed per network):

    juju config neutron-api dhcp-agents-per-network=2
    
  • On the neutron gateway nodes check that the option in the /etc/neutron/neutron.conf file:

    dhcp_agents_per_network = 2
    

This can be done with the following command:

$ juju run --application nova-compute-ct1-cl1 'sudo printf "#   GARR for live migration\n    CheckHostIP no\n    StrictHostKeyChecking no\n    UserKnownHostsFile /dev/null\n" >> /etc/ssh/ssh_config'

Exisisting network: HA dhcp agents

Admin role is required to use the agent management and scheduler extensions. Ensure you run the following commands under a project with an admin role.:

$ neutron agent-list | grep -i dhcp
$ neutron net-list-on-dhcp-agent <dhcp_id_1>
$ neutron net-list-on-dhcp-agent <dhcp_id_2>

this will return all the networks on the corrensponding dhcp agent. Then you should enable a second dhcp agent for the needed network:

$ neutron dhcp-agent-network-add <dhcp_id_1> <net_name_with_agent_on_dhcp_id_2>

check that each network has 2 dhcp agents:

 $ neutron dhcp-agent-list-hosting-net <net_name>
i.e
 $ neutron dhcp-agent-list-hosting-net default
 neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
 +--------------------------------------+------------+----------------+-------+
 | id                                   | host       | admin_state_up | alive |
 +--------------------------------------+------------+----------------+-------+
 | 4650c661-180a-4ea5-8bf1-b549feeb241f | pa1-r2-s08 | True           | :-)   |
 | 66d6affb-3161-4606-8c15-434cf3f647c5 | pa1-r1-s13 | True           | :-)   |
 +--------------------------------------+------------+----------------+-------+