osops-tools-contrib/neutron
Jared King 82ad72f239 add net_blame.sh, which finds the top instances on a net node
Change-Id: I18eee0818ff1e142013c932ca1ef2f2998599035
2017-01-17 10:05:33 -05:00
..
README.md l3-agent-evacuate.py: evacuate a network node 2016-12-23 10:18:28 +01:00
count_routers_on_host.sh A script to count the number of routers by host 2016-01-14 11:52:55 -07:00
dhcp_agents_balancer.py Add cold stop, cold start, cold restart to dhcp_agents_balancer.py 2017-01-05 16:05:49 +01:00
get_floating_pools.sh Add script get_floating_pools.sh to neutron directory 2015-12-19 15:54:36 +01:00
l3-agent-evacuate.py l3-agent-evacuate.py: evacuate a network node 2016-12-23 10:18:28 +01:00
net_blame.sh add net_blame.sh, which finds the top instances on a net node 2017-01-17 10:05:33 -05:00
orphaned_ports.py neutron/orphaned_ports.py: initial commit 2015-11-19 14:44:41 -08:00

README.md

Neutron folder

this folder contains scripts that are related to Neutron

L3 Agent Evacuate

Migrate away the OpenStack routers from a L3 Agent

./l3-agent-evacuate.py --help
usage: l3-agent-evacuate.py [-h] [-f FROM_L3AGENT] [-t TO_L3AGENT] [-r ROUTER]
                            [-l LIMIT] [-v]

Evacuate a neutron l3-agent

optional arguments:
  -h, --help            show this help message and exit
  -f FROM_L3AGENT, --from-l3agent FROM_L3AGENT
                        l3agent uuid
  -t TO_L3AGENT, --to-l3agent TO_L3AGENT
                        l3agent uuid
  -r ROUTER, --router ROUTER
                        specific router
  -l LIMIT, --limit LIMIT
                        max number of routers to migrate
  -v, --verbose         verbose

First of all we should have clear in mind that when we create a router in Openstack, that router is just a network namespace on one of the network nodes, with name qrouter-. For each namespace there is a qr (downstream) and a qg (upstream) interface. In some situations an operation might want to migrate away all the routers from a network node, to be able for example to reboot the node without impacting the user traffic. The neutron component responsible for creating the namespaces and cabling them with openvswitch is the l3 agent. You can check the uuid of the l3 agents currently running with:

openstack network agent list

When you are running multiple l3 agents, if you create a new router Openstack will schedule the namespace to be created on one of the available network nodes. Given a specific router, with this command you can find out on which network node the namespace has been created:

neutron l3-agent-list-hosting-router <router_uuid>

To list instead all the routers scheduled on a specific network node neutron router-list-on-l3-agent <l3agent-uuid> Using the neutron commands l3-agent-router-add and l3-agent-router-remove is then possible to move a router from a l3 agent to another one.

The tool l3-agent-evacuate.py will create a list of all the routers present on the from-agent and will move 1 router every 10 seconds to the to-agent. It is better to add a 10 seconds delay because Openvswitch has to make a lot of operations when the namespace is created, and moving many routers at once will cause openvswitch to blow up with unpredictable behavior.

The script has also a --router option if you want to migrate a specific router, or a --limit option if you want to migrate just a few routers.

While migrating the routers, you can check (especially on the target l3-agent) the openvswitch operations going on in /var/log/syslog.