ML2 plugin and drivers do not delete dhcp port upon deletion of network

Bug #1230330 reported by Sukhdev Kapur
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Robert Kukura

Bug Description

When all VM instances on a given network are deleted, followed by deletion of the network, the dhcp port is not deleted.

Here are steps to reproduce this bug:

- Create a network.
- Launch a VM
- ML2 driver gets a call to create_port_precommit(), create_port_postcommit().
  This is called twice - once with device-id of Instance (VM) - compute:none
  Second time the same calls are invoked - with device-id network:dhcp
- Delete the VM
- ML2 driver gets a call to delete_port_precommit() and delete_port_postcommit()
  This only gets called once with device-id of Instance (VM) - compute:none
  There is no delete port call for dhcp - this makes sense, as the network still exists.
- Delete the network as well.
- Now at this point, no network, no VMs
  delete_port_pre/postcommit call dhcp port is never invoked. Hence, one will end up with a port with a vlan configured on it.

During this exercise, I examine the neutron ports DB. I notice that both ports (dhcp as well port connecting to instance) are created and deleted from the DB as expected. So, this means that things north of ML2 plugin seem to be OK.

-Sukhdev

Changed in neutron:
assignee: nobody → Sukhdev Kapur (sukhdev-8)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/48546

Changed in neutron:
status: New → In Progress
Kyle Mestery (mestery)
Changed in neutron:
milestone: none → havana-rc1
importance: Undecided → High
Robert Kukura (rkukura)
Changed in neutron:
assignee: Sukhdev Kapur (sukhdev-8) → Robert Kukura (rkukura)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: master
Review: https://review.openstack.org/48765

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/48765
Committed: http://github.com/openstack/neutron/commit/19804bb5c5ad8ba10fbda1bf213f698d97c137e7
Submitter: Jenkins
Branch: master

commit 19804bb5c5ad8ba10fbda1bf213f698d97c137e7
Author: Bob Kukura <email address hidden>
Date: Fri Sep 27 17:54:45 2013 -0400

    Fix auto-deletion of ports and subnets in ML2

    When a network is deleted, certain ports and any subnets referencing
    it are auto-deleted. The implementation of
    NeutronDBPluginV2.delete_network() does this at the DB level, so ML2's
    mechanism drivers were not being called.

    Ml2Plugin.delete_network() is changed to not use the base class's
    method, and to auto-delete ports and subnets by calling its own
    delete_port() and delete_subnet() methods outside of the
    transaction. A loop avoids race conditions with ports or subnets being
    asynchronously added to the network.

    Closes-Bug: 1230330
    Change-Id: Icf21400c9938eec29d70da8497b9ef92642131e2

Changed in neutron:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in neutron:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in neutron:
milestone: havana-rc1 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.