cannot delete a port when it is allocated an IP

Bug #1020847 reported by yong sheng gong
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Undecided
Gary Kotton

Bug Description

[root@robinlinux ~]# quantumv2 delete_port 653a6fc5-cc6d-415c-91ef-eede67ee9b6d
ERROR: cliff.app Dependency rule tried to blank-out primary key column 'ipallocations.port_id' on instance '<IPAllocation at 0x244a9d0>'

But we have no way to clear the IPs of the port.

quantum client now has no way to compose the empty value to do it.

Revision history for this message
yong sheng gong (gongysh) wrote :

It should be targeted on quantum-client project, but I don't know how to set it.

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

the client shouldn't have to clear the IPs before being able to delete a port. So is this a server issue?

btw, you should be able to remove all IPs on a port by doing a put on the port with fixed_ips = []

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

btw, garyk clarified this for me, as to why it is a client problem.

are you saying that the user has no way of clearing IPs using a CLI command, or that the client code itself is unable to clear the IPs? Deleting a port in the API should automatically delete the corresponding allocations on the port.

according to ttx, we're going to start using separate launchpad projects for client libraries, so I would try and target it to this project: https://launchpad.net/python-quantumclient

If you aren't able to, I may need to increase your permissions.

Revision history for this message
yong sheng gong (gongysh) wrote :

I am wondering if we should do it on the server side. When deleting port on server side, we first delete the ip allocation, then delete the port in db.

Revision history for this message
Gary Kotton (garyk) wrote :

Can you please provide the sequence of cli commands so that this can be reproduced.
Thanks
Gary

Revision history for this message
Gary Kotton (garyk) wrote :

If a port has an IP defined on it then the port should be able to be deleted. This is not related to the client.

Revision history for this message
Gary Kotton (garyk) wrote :

(quantumv2) create_port --tenant-id 287647c85ef34182b1c4000fe28f947e c6cdcdf8-b598-4019-8e7f-dabf47e0d7bc
Created a new port:
+----------------+---------------------------------------------------------------------------------------+
| Field | Value |
+----------------+---------------------------------------------------------------------------------------+
| admin_state_up | True |
| device_id | |
| fixed_ips | [{u'subnet_id': u'76f024a1-549a-4970-9a11-36294d6f7f0a', u'ip_address': u'10.0.0.3'}] |
| id | 5bf05aa7-a07a-4479-82a1-f97a57e153d5 |
| mac_address | fa:16:3e:6c:78:8a |
| network_id | c6cdcdf8-b598-4019-8e7f-dabf47e0d7bc |
| status | ACTIVE |
| tenant_id | 287647c85ef34182b1c4000fe28f947e |
+----------------+---------------------------------------------------------------------------------------+
(quantumv2)
(quantumv2)
(quantumv2)
(quantumv2)
(quantumv2) delete_port 5bf05aa7-a07a-4479-82a1-f97a57e153d5
Deleted port: 5bf05aa7-a07a-4479-82a1-f97a57e153d5
(quantumv2)

Revision history for this message
Gary Kotton (garyk) wrote :

Problem happens only with fixed ip configured -
quantumv2 --fixed-ip ip_address=10.0.1.1 create_port xxx

Revision history for this message
yong sheng gong (gongysh) wrote :

It seemingly failed only when the port is assigned a reserved IP.

Revision history for this message
yong sheng gong (gongysh) wrote :

I do it:
quantumv2 create_port --fixed-ip ip_address=10.0.1.1 netid

Changed in quantum:
assignee: nobody → Gary Kotton (garyk)
status: New → In Progress
Revision history for this message
Gary Kotton (garyk) wrote :

When using https://review.openstack.org/#/c/9312/ the following happens:
(quantumv2) delete_port 3c4c60bf-a5f4-44c4-a255-b0f5382ec7b6
ERROR: cliff.app Invalid input for operation: No allocation pool found for ip address:10.0.0.70.

Gary Kotton (garyk)
Changed in quantum:
milestone: none → folsom-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to quantum (master)

Reviewed: https://review.openstack.org/9312
Committed: http://github.com/openstack/quantum/commit/ae65b07b4c67889ccf28a02a25f2d723c759e80e
Submitter: Jenkins
Branch: master

commit ae65b07b4c67889ccf28a02a25f2d723c759e80e
Author: Gary Kotton <email address hidden>
Date: Wed Jul 4 06:54:10 2012 -0400

    Address problems with foreign keys with subnet and network deletion

    This also fixes bug 1020879 and bug 1020847

    Change-Id: Ib68f9357ed65f35e56d17577b83fabe8f96388cf

Changed in quantum:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to quantum (milestone-proposed)

Fix proposed to branch: milestone-proposed
Review: https://review.openstack.org/9341

Changed in quantum:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to quantum (milestone-proposed)

Reviewed: https://review.openstack.org/9341
Committed: http://github.com/openstack/quantum/commit/36e64afd4494d7c73bccb230ba1c4a97752b5751
Submitter: Jenkins
Branch: milestone-proposed

commit 36e64afd4494d7c73bccb230ba1c4a97752b5751
Author: Gary Kotton <email address hidden>
Date: Wed Jul 4 06:54:10 2012 -0400

    Address problems with foreign keys with subnet and network deletion

    This also fixes bug 1020879 and bug 1020847

    Change-Id: Ib68f9357ed65f35e56d17577b83fabe8f96388cf

Thierry Carrez (ttx)
Changed in quantum:
milestone: folsom-2 → 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.