Tenant cannot delete network when dhcp-agent is running

Bug #1028174 reported by Hisaharu Ishii
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Critical
Mark McClain

Bug Description

dhcp-agent owns port on network and IP address on subnet.
There is no API for tenant to release port and IP adress owned by dhcp-agent.
When tenant requests to delete network or subnet, NetworkInUse or SubnetInUse exeptions must be caused.

Changed in quantum:
assignee: nobody → Mark McClain (markmcclain)
status: New → Confirmed
Revision history for this message
Nachi Ueno (nati-ueno) wrote :

Hi Mark

IMO, a port for DHCP server should be created manually.
Because current DHCP agent creates port automatically, we can't delete network.

How do you think?

dan wendlandt (danwent)
Changed in quantum:
importance: Undecided → Critical
milestone: none → folsom-3
Revision history for this message
Nachi Ueno (nati-ueno) wrote :
Revision history for this message
dan wendlandt (danwent) wrote :

Its pretty important that we deal with this soon. I can see a couple of possibilities:

1) remove check that prevents us from deleting a network when ports are on it.
2) keep the check, but make sure that dhcp-agent tears down the port it creates on the network when there are no other ports on the network (and hence no need for a dhcp server).
3) keep the check, but have some way for DHCP ports to be marked as 'internal' or 'system' ports that should be ignored by the check.

We have a somewhat similar issue with ports created by routers in my L3 + floating IP patch, though in this case at least the tenant does have the ability to delete the port without it being automatically created again.

Revision history for this message
Mark McClain (markmcclain) wrote :

I did some work on this bug during lunch.

The DHCP agent listens for notifications and releases the port|fixed_ip when <network|subnet>_delete_start is broadcast. I also tweaked the base plugin to wait 2 seconds before proceeding. This should give the agents time to clean-up properly.

Revision history for this message
Nachi Ueno (nati-ueno) wrote :

Hi Mark

Now port has device_owner.
How about his spec?

1) When we delete network, it will be notified to the dhcp server.
quantum server will delete port.

2) When dhcp-agent get notify, it will cleanup port in local

Revision history for this message
dan wendlandt (danwent) wrote :

If we don't get this in today, its a must have for RC1

Changed in quantum:
milestone: folsom-3 → folsom-rc1
Revision history for this message
Akihiro Motoki (amotoki) wrote :

I confirmed that subnet can be deleted even when dhcp server is running
after Mark's patch "Convert DHCP from polling to RPC" (commit 96827953beba575a12acde5377adba95de00690a) is merged
with devstack (with https://review.openstack.org/#/c/11278/).

Revision history for this message
Ian Wells (ijw-ubuntu) wrote :

This even happens if there are no subnets assigned to the network.

Revision history for this message
Mark McClain (markmcclain) wrote :

@ijw-ubuntu

I've tried to reproduce this bug with an empty network using both bridging and OVS, but cannot. Which plugin are you running?
Can you provide some steps to reproduce?

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

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

Changed in quantum:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to quantum (master)

Reviewed: https://review.openstack.org/11996
Committed: http://github.com/openstack/quantum/commit/88e2551c69739d76a1802838adaae0d244aa5333
Submitter: Jenkins
Branch: master

commit 88e2551c69739d76a1802838adaae0d244aa5333
Author: Mark McClain <email address hidden>
Date: Mon Aug 27 12:04:21 2012 -0400

    fix bug where network owned resources block delete

    bug 1028174

    This patch fixes a bug in delete_network and delete_subnet where the InUse
    exception was being thrown for resources owned by the network and not
    the tenant. This patch force deletes network resources if they are the
    only blocker to deleting the parent resource.

    Change-Id: I822cc4a92cb05cdef88679bb628fad4e5063cddd

Changed in quantum:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in quantum:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in quantum:
milestone: folsom-rc1 → 2012.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.