Public bug reported: The repro steps is as follows: 1.Create at least two ha router. 2.Delete one ha router.
Then the ha network is not deleted, but the segment of this ha network is deleted. [root@cdpm01 ~]# neutron net-show 5edf9be2-2a07-4350-98dd-9d3c12a9b9dd neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead. +---------------------------+----------------------------------------------------+ | Field | Value | +---------------------------+----------------------------------------------------+ | admin_state_up | True | | availability_zone_hints | | | availability_zones | nova | | created_at | 2017-11-17T01:40:44Z | | description | | | id | 5edf9be2-2a07-4350-98dd-9d3c12a9b9dd | | ipv4_address_scope | | | ipv6_address_scope | | | mtu | 1450 | | name | HA network tenant a2794be2207a45b5be5b2423bfa08c2c | | port_security_enabled | True | | project_id | | | provider:network_type | | | provider:physical_network | | | provider:segmentation_id | | | qos_policy_id | | | revision_number | 5 | | router:external | False | | shared | False | | status | ACTIVE | | subnets | a356ecf7-c4a0-4596-b742-d1521a2aa38f | | tags | | | tenant_id | | | updated_at | 2017-11-17T09:26:25Z | +---------------------------+----------------------------------------------------+ The reason: 1.When a ha router is deleted, neutron attempted to delete the ha network. 2.When deleting a network, the event:events.BEFORE_DELETE for resources.NETWORK is send[[1]] and _delete_segments_for_network is invoked to delete the segment[2]. 3.After sending the event:events.BEFORE_DELETE for resources.NETWORK, the ha network is checked to be in use[3], so it is not deleted Mybe we should check if the network is in use before sending the event:events.BEFORE_DELETE for resources.NETWORK? [1]https://github.com/openstack/neutron/blob/master/neutron/db/db_base_plugin_v2.py#L433 [2]https://github.com/openstack/neutron/blob/master/neutron/services/segments/db.py#L315 [3]https://github.com/openstack/neutron/blob/master/neutron/db/db_base_plugin_v2.py#L435 ** Affects: neutron Importance: Undecided Assignee: sunzuohua (zuohuasun) Status: New ** Changed in: neutron Assignee: (unassigned) => sunzuohua (zuohuasun) -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to neutron. https://bugs.launchpad.net/bugs/1733054 Title: Segment of ha network is deleted when a ha router is removed Status in neutron: New Bug description: The repro steps is as follows: 1.Create at least two ha router. 2.Delete one ha router. Then the ha network is not deleted, but the segment of this ha network is deleted. [root@cdpm01 ~]# neutron net-show 5edf9be2-2a07-4350-98dd-9d3c12a9b9dd neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead. +---------------------------+----------------------------------------------------+ | Field | Value | +---------------------------+----------------------------------------------------+ | admin_state_up | True | | availability_zone_hints | | | availability_zones | nova | | created_at | 2017-11-17T01:40:44Z | | description | | | id | 5edf9be2-2a07-4350-98dd-9d3c12a9b9dd | | ipv4_address_scope | | | ipv6_address_scope | | | mtu | 1450 | | name | HA network tenant a2794be2207a45b5be5b2423bfa08c2c | | port_security_enabled | True | | project_id | | | provider:network_type | | | provider:physical_network | | | provider:segmentation_id | | | qos_policy_id | | | revision_number | 5 | | router:external | False | | shared | False | | status | ACTIVE | | subnets | a356ecf7-c4a0-4596-b742-d1521a2aa38f | | tags | | | tenant_id | | | updated_at | 2017-11-17T09:26:25Z | +---------------------------+----------------------------------------------------+ The reason: 1.When a ha router is deleted, neutron attempted to delete the ha network. 2.When deleting a network, the event:events.BEFORE_DELETE for resources.NETWORK is send[[1]] and _delete_segments_for_network is invoked to delete the segment[2]. 3.After sending the event:events.BEFORE_DELETE for resources.NETWORK, the ha network is checked to be in use[3], so it is not deleted Mybe we should check if the network is in use before sending the event:events.BEFORE_DELETE for resources.NETWORK? [1]https://github.com/openstack/neutron/blob/master/neutron/db/db_base_plugin_v2.py#L433 [2]https://github.com/openstack/neutron/blob/master/neutron/services/segments/db.py#L315 [3]https://github.com/openstack/neutron/blob/master/neutron/db/db_base_plugin_v2.py#L435 To manage notifications about this bug go to: https://bugs.launchpad.net/neutron/+bug/1733054/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

