Activity log for bug #1104337

Date Who What changed Old value New value Message
2013-01-24 18:45:03 Terry Wilson bug added bug
2013-01-24 18:45:03 Terry Wilson attachment added Delete ports marked as AUTO_DELETE_PORT_OWNERS when deleting subnet https://bugs.launchpad.net/bugs/1104337/+attachment/3498829/+files/delete_auto_del_ports_when_deleting_subnet.patch.txt
2013-01-24 19:01:59 Terry Wilson description When adding a subnet to a router via router-interface-add, it is possible to delete the subnet without removing the interface. This leaves a port behind that cannot be deleted because it is part of a router, and a router that cannot be deleted because it has an active port. It is possible to delete the port via running a network-delete, but one shouldn't have to delete the entire network just to fix the issue. I'm attaching a patch that deletes ports marked as AUTO_DELETE_PORT_OWNERS when deleting the subnet (the same thing that happens if we cascade deleting by deleting a network) instead of just deleting the IPAllocation. Example of issue: [terry@f17-devstack1 quantum]$ quantum net-create net1 Created a new network: +---------------------------+--------------------------------------+ | Field | Value | +---------------------------+--------------------------------------+ | admin_state_up | True | | id | ee4e9eae-f51d-442d-84c0-d81b6e1ba69e | | name | net1 | | provider:network_type | vlan | | provider:physical_network | physnet1 | | provider:segmentation_id | 1 | | router:external | False | | shared | False | | status | ACTIVE | | subnets | | | tenant_id | 2e3986dd9ea643f4949223283299ddec | +---------------------------+--------------------------------------+ [terry@f17-devstack1 quantum]$ quantum subnet-create net1 10.10.10.0/24 --name subnet1 Created a new subnet: +------------------+------------------------------------------------+ | Field | Value | +------------------+------------------------------------------------+ | allocation_pools | {"start": "10.10.10.2", "end": "10.10.10.254"} | | cidr | 10.10.10.0/24 | | dns_nameservers | | | enable_dhcp | True | | gateway_ip | 10.10.10.1 | | host_routes | | | id | 02eb6689-04b0-4617-8bf9-10fddc2fa591 | | ip_version | 4 | | name | subnet1 | | network_id | ee4e9eae-f51d-442d-84c0-d81b6e1ba69e | | tenant_id | 2e3986dd9ea643f4949223283299ddec | +------------------+------------------------------------------------+ [terry@f17-devstack1 quantum]$ quantum router-create router1 Created a new router: +-----------------------+--------------------------------------+ | Field | Value | +-----------------------+--------------------------------------+ | admin_state_up | True | | external_gateway_info | | | id | f13fca0d-6ba9-4b9d-a842-e34dedbede2b | | name | router1 | | status | ACTIVE | | tenant_id | 2e3986dd9ea643f4949223283299ddec | +-----------------------+--------------------------------------+ [terry@f17-devstack1 quantum]$ quantum router-interface-add router1 subnet1 Added interface to router router1 [terry@f17-devstack1 quantum]$ quantum port-list +--------------------------------------+------+-------------------+-----------------------------------------------------------------------------------+ | id | name | mac_address | fixed_ips | +--------------------------------------+------+-------------------+-----------------------------------------------------------------------------------+ | 2486674a-8ce7-42ae-8b36-1a41d4a54606 | | fa:16:3e:7d:fe:66 | {"subnet_id": "02eb6689-04b0-4617-8bf9-10fddc2fa591", "ip_address": "10.10.10.1"} | +--------------------------------------+------+-------------------+-----------------------------------------------------------------------------------+ [terry@f17-devstack1 quantum]$ quantum subnet-delete subnet1 Deleted subnet: subnet1 [terry@f17-devstack1 quantum]$ quantum port-list +--------------------------------------+------+-------------------+-----------+ | id | name | mac_address | fixed_ips | +--------------------------------------+------+-------------------+-----------+ | 2486674a-8ce7-42ae-8b36-1a41d4a54606 | | fa:16:3e:7d:fe:66 | | +--------------------------------------+------+-------------------+-----------+ [terry@f17-devstack1 quantum]$ quantum port-delete 2486674a-8ce7-42ae-8b36-1a41d4a54606 Port 2486674a-8ce7-42ae-8b36-1a41d4a54606 has owner network:router_interface and therefore cannot be deleted directly via the port API. [terry@f17-devstack1 quantum]$ quantum router-delete router1 Router f13fca0d-6ba9-4b9d-a842-e34dedbede2b still has active ports [terry@f17-devstack1 quantum]$ quantum router-interface-delete 02eb6689-04b0-4617-8bf9-10fddc2fa591 usage: quantum router-interface-delete [-h] [--request-format {json,xml}] router-id subnet-id quantum router-interface-delete: error: too few arguments [terry@f17-devstack1 quantum]$ quantum router-interface-delete router1 02eb6689-04b0-4617-8bf9-10fddc2fa591 Unable to find subnet with name '02eb6689-04b0-4617-8bf9-10fddc2fa591' When adding a subnet to a router via router-interface-add, it is possible to delete the subnet without removing the interface. This leaves a port behind that cannot be deleted because it is part of a router, and a router that cannot be deleted because it has an active port. It is possible to delete the port via running a network-delete, but one shouldn't have to delete the entire network just to fix the issue. I'm attaching a patch that deletes ports marked as AUTO_DELETE_PORT_OWNERS when deleting the subnet (the same thing that happens if we cascade deleting by deleting a network) instead of just deleting the IPAllocation. Example of issue: [terry@f17-devstack1 quantum]$ quantum net-create net1 Created a new network: +---------------------------+--------------------------------------+ | Field | Value | +---------------------------+--------------------------------------+ | admin_state_up | True | | id | ee4e9eae-f51d-442d-84c0-d81b6e1ba69e | | name | net1 | | provider:network_type | vlan | | provider:physical_network | physnet1 | | provider:segmentation_id | 1 | | router:external | False | | shared | False | | status | ACTIVE | | subnets | | | tenant_id | 2e3986dd9ea643f4949223283299ddec | +---------------------------+--------------------------------------+ [terry@f17-devstack1 quantum]$ quantum subnet-create net1 10.10.10.0/24 --name subnet1 Created a new subnet: +------------------+------------------------------------------------+ | Field | Value | +------------------+------------------------------------------------+ | allocation_pools | {"start": "10.10.10.2", "end": "10.10.10.254"} | | cidr | 10.10.10.0/24 | | dns_nameservers | | | enable_dhcp | True | | gateway_ip | 10.10.10.1 | | host_routes | | | id | 02eb6689-04b0-4617-8bf9-10fddc2fa591 | | ip_version | 4 | | name | subnet1 | | network_id | ee4e9eae-f51d-442d-84c0-d81b6e1ba69e | | tenant_id | 2e3986dd9ea643f4949223283299ddec | +------------------+------------------------------------------------+ [terry@f17-devstack1 quantum]$ quantum router-create router1 Created a new router: +-----------------------+--------------------------------------+ | Field | Value | +-----------------------+--------------------------------------+ | admin_state_up | True | | external_gateway_info | | | id | f13fca0d-6ba9-4b9d-a842-e34dedbede2b | | name | router1 | | status | ACTIVE | | tenant_id | 2e3986dd9ea643f4949223283299ddec | +-----------------------+--------------------------------------+ [terry@f17-devstack1 quantum]$ quantum router-interface-add router1 subnet1 Added interface to router router1 [terry@f17-devstack1 quantum]$ quantum port-list +--------------------------------------+------+-------------------+-----------------------------------------------------------------------------------+ | id | name | mac_address | fixed_ips | +--------------------------------------+------+-------------------+-----------------------------------------------------------------------------------+ | 2486674a-8ce7-42ae-8b36-1a41d4a54606 | | fa:16:3e:7d:fe:66 | {"subnet_id": "02eb6689-04b0-4617-8bf9-10fddc2fa591", "ip_address": "10.10.10.1"} | +--------------------------------------+------+-------------------+-----------------------------------------------------------------------------------+ [terry@f17-devstack1 quantum]$ quantum subnet-delete subnet1 Deleted subnet: subnet1 [terry@f17-devstack1 quantum]$ quantum port-list +--------------------------------------+------+-------------------+-----------+ | id | name | mac_address | fixed_ips | +--------------------------------------+------+-------------------+-----------+ | 2486674a-8ce7-42ae-8b36-1a41d4a54606 | | fa:16:3e:7d:fe:66 | | +--------------------------------------+------+-------------------+-----------+ [terry@f17-devstack1 quantum]$ quantum port-delete 2486674a-8ce7-42ae-8b36-1a41d4a54606 Port 2486674a-8ce7-42ae-8b36-1a41d4a54606 has owner network:router_interface and therefore cannot be deleted directly via the port API. [terry@f17-devstack1 quantum]$ quantum router-delete router1 Router f13fca0d-6ba9-4b9d-a842-e34dedbede2b still has active ports [terry@f17-devstack1 quantum]$ quantum router-interface-delete router1 02eb6689-04b0-4617-8bf9-10fddc2fa591 Unable to find subnet with name '02eb6689-04b0-4617-8bf9-10fddc2fa591'
2013-01-24 19:23:55 OpenStack Infra quantum: status New In Progress
2013-01-24 19:23:55 OpenStack Infra quantum: assignee Terry Wilson (otherwiseguy)
2013-01-30 16:42:39 Mark McClain tags database router subnet db l3-ipam-dhcp
2013-02-19 17:23:33 dan wendlandt tags db l3-ipam-dhcp db folsom-backport-potential l3-ipam-dhcp
2013-02-19 17:23:40 dan wendlandt quantum: milestone grizzly-3
2013-02-19 17:23:46 dan wendlandt quantum: importance Undecided High
2013-02-20 03:06:23 dan wendlandt quantum: milestone grizzly-3 grizzly-rc1
2013-03-04 17:23:39 OpenStack Infra quantum: assignee Terry Wilson (otherwiseguy) Salvatore Orlando (salvatore-orlando)
2013-03-05 07:03:33 OpenStack Infra quantum: status In Progress Fix Committed
2013-03-05 14:57:28 Alan Pevec nominated for series quantum/folsom
2013-03-05 14:57:28 Alan Pevec bug task added quantum/folsom
2013-03-05 14:57:35 Alan Pevec quantum/folsom: importance Undecided High
2013-03-05 14:57:46 Alan Pevec quantum/folsom: status New In Progress
2013-03-05 14:58:04 Alan Pevec quantum/folsom: assignee Gary Kotton (garyk)
2013-03-05 17:52:22 OpenStack Infra quantum/folsom: status In Progress Fix Committed
2013-03-13 08:48:49 Thierry Carrez quantum: status Fix Committed Fix Released
2013-04-04 10:23:47 Thierry Carrez quantum: milestone grizzly-rc1 2013.1
2013-04-07 22:29:59 Alan Pevec quantum/folsom: milestone 2012.2.4
2013-04-07 22:30:20 Alan Pevec tags db folsom-backport-potential l3-ipam-dhcp db l3-ipam-dhcp
2013-04-11 19:23:50 Alan Pevec quantum/folsom: status Fix Committed Fix Released