ML2 plugin deletes port even if associated with multiple subnets on subnet deletion
Bug #1246737 reported by
Oleg Bondarev
This bug affects 2 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
neutron |
Fix Released
|
Medium
|
Oleg Bondarev | ||
Havana |
Won't Fix
|
Undecided
|
padkrish |
Bug Description
On subnet deletion ml2 plugin deletes all the ports associated with this subnet and does not check if a port is associated with other subnets.
Steps to reproduce:
1) create a network with two subnets
2) create dhcp port for the network, port is associated with both subnets
3) delete one of the subnets
4) dhcp port is getting deleted
Though new dhcp port is created shortly I think it's not ok to delete existing dhcp port.
Changed in neutron: | |
status: | New → Confirmed |
tags: | added: havana-backport-potential |
summary: |
- ML2 plugin deletes port even if associated with multiple subnetrs on + ML2 plugin deletes port even if associated with multiple subnets on subnet deletion |
Changed in neutron: | |
milestone: | none → juno-rc1 |
Changed in neutron: | |
status: | Fix Committed → Fix Released |
Changed in neutron: | |
milestone: | juno-rc1 → 2014.2 |
tags: | removed: havana-backport-potential |
tags: |
added: icehouse-backport-potential removed: icehouse-backport-potentioal |
To post a comment you must log in.
In NeutronDbPlugin V2.delete_ subnet( ), there is a statement "allocated. delete( )" that I had erroneously interpreted as deleting the port at the DB level - probably mislead by the "# remove network owned ports" comment. I therefore changed Ml2Plugin. delete_ subnet( ) to not call the base class and to instead use its own delete_port() method so that MechanismDrivers would be called for the auto-deleted port.
But, as Oleg discovered, the base class's "allocated. delete( )" statement is actually just deleting the IPAllocation record, not the port itself. This is in effect removing the subnet's IP from the port's fixed_ips attribute. Therefore, instead of calling delete_port(), the Ml2Plugin. delete_ subnet( ) method should be calling update_port() for each allocation to remove the IP from the port and call the MechanismDrivers.