Implement action for rebalancing L3 agents in HA environment
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Neutron Gateway Charm |
New
|
Undecided
|
Unassigned |
Bug Description
After cycling all other partners on a neutron-gateway HA configuration, all L3 agents appear stuck on the remaining partner. This condition is undesirable as the HA becomes completely unbalanced.
It would be helpful to automatically detect/rectify this condition or offer an action to rebalance the L3 agents after maintenance activities.
Our current workaround is the following script (for a 2 gateway HA):
UNIT="neutron-
HOSTNAME=$(juju run -u $UNIT -- hostname)
L3AGENT=$(openstack network agent list --host $HOSTNAME --agent-type l3 -cID -fvalue)
HAROUTERS=
HALEN=$
HASEL=$(( HALEN / 2 ));
for (( i=0; i<${HASEL}; i++ )); do
neutron l3-agent-
done;
# wait a while here
for (( i=0; i<${HASEL}; i++ )); do
neutron l3-agent-router-add $L3AGENT ${HAROUTERS[$i]};
done;