Deleting an HA router with interfaces attached leaves the DB in an inconsistent state
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Fix Released
|
Medium
|
Yoni Shafrir |
Bug Description
Steps to reproduce:
Create HA router (Observe that HA ports were created)
Attach an interface
Delete router
Result:
The deletion fails because the router has an interface attached, however all of its HA ports were deleted, leaving the system in an inconsistent state. Any L3 agents that attempt to configure this HA router will fail because it doesn't have HA ports.
Expected behavior:
Deletion validations should occur before deleting any resources. The deletion should fail and the router should continue to exist properly, with HA ports and all.
Reason:
As per https:/
When deleting a router, the call first reaches the L3 HA DB mixin, which deletes HA-specific resources first, in its own commit. It then calls to the super class, which will eventually try to delete the router object itself. If any deletion validation fails, the router object itself is not deleted, but the HA ports and their VRID allocations were already deleted and the transaction was commited.
Changed in neutron: | |
assignee: | nobody → Yoni (yshafrir) |
Changed in neutron: | |
importance: | Undecided → Medium |
status: | New → Confirmed |
Changed in neutron: | |
milestone: | none → kilo-3 |
status: | Fix Committed → Fix Released |
Changed in neutron: | |
milestone: | kilo-3 → 2015.1.0 |
Once system is in this state, l3-agent will be blocked when trying to update routers with an error like this:
2014-12-15 10:35:41.271 6046 ERROR neutron. agent.l3_ agent [-] 'NoneType' object has no attribute 'config' agent.l3_ agent Traceback (most recent call last): agent.l3_ agent File "/usr/lib/ python2. 7/site- packages/ neutron/ common/ utils.py" , line 341, in call agent.l3_ agent return func(*args, **kwargs) agent.l3_ agent File "/usr/lib/ python2. 7/site- packages/ neutron/ agent/l3_ agent.py" , line 899, in process_router agent.l3_ agent self.internal_ network_ added(ri, p) agent.l3_ agent File "/usr/lib/ python2. 7/site- packages/ neutron/ agent/l3_ agent.py" , line 1526, in internal_ network_ added agent.l3_ agent self._add_vip(ri, internal_cidr, interface_name) agent.l3_ agent File "/usr/lib/ python2. 7/site- packages/ neutron/ agent/l3_ ha_agent. py", line 169, in _add_vip agent.l3_ agent instance = ri.keepalived_ manager. config. get_instance( ri.ha_vr_ id) agent.l3_ agent AttributeError: 'NoneType' object has no attribute 'config' agent.l3_ agent
2014-12-15 10:35:41.271 6046 TRACE neutron.
2014-12-15 10:35:41.271 6046 TRACE neutron.
2014-12-15 10:35:41.271 6046 TRACE neutron.
2014-12-15 10:35:41.271 6046 TRACE neutron.
2014-12-15 10:35:41.271 6046 TRACE neutron.
2014-12-15 10:35:41.271 6046 TRACE neutron.
2014-12-15 10:35:41.271 6046 TRACE neutron.
2014-12-15 10:35:41.271 6046 TRACE neutron.
2014-12-15 10:35:41.271 6046 TRACE neutron.
2014-12-15 10:35:41.271 6046 TRACE neutron.
2014-12-15 10:35:41.271 6046 TRACE neutron.