os-fixed-ips api does not take care deleted ip address

Bug #1152958 reported by Zhi Yan Liu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Zhi Yan Liu

Bug Description

1. Instance info:
lzy@host:~$ nova list
+--------------------------------------+------+--------+-----------------+
| ID | Name | Status | Networks |
+--------------------------------------+------+--------+-----------------+
| 3a312912-e342-4fdf-af96-5a35df41e706 | xxx | ACTIVE | private=9.9.0.3 |
+--------------------------------------+------+--------+-----------------+

2. fixed ip info query request:
curl -i "http://10.10.0.1:8774/v2/948a39350b1a4973a484844f4ccd5cb7/os-fixed-ips/9.9.0.3.x" -X GET -H "X-Auth-Project-Id: admin" -H "User-Agent: python-novaclient" -H "Accept: application/json" -H "X-Auth-Token: fedda46d59694bb8b25e4b93d13d6198"

3. HTTP response:
HTTP/1.1 404 Not Found
Content-Length: 79
Content-Type: application/json; charset=UTF-8
X-Compute-Request-Id: req-d0d3eaf3-22c3-41c2-ad20-5eaa5b7d3c65
Date: Sat, 09 Mar 2013 11:26:33 GMT

{"itemNotFound": {"message": "Fixed IP 9.9.0.3 has been deleted", "code": 404}}

4. Deleted fixed ip address in db:
mysql> select * from fixed_ips where address = '9.9.0.3';
+---------------------+---------------------+---------------------+---------+----+---------+------------+-----------+--------+----------+----------------------+------+--------------------------------------+
| created_at | updated_at | deleted_at | deleted | id | address | network_id | allocated | leased | reserved | virtual_interface_id | host | instance_uuid |
+---------------------+---------------------+---------------------+---------+----+---------+------------+-----------+--------+----------+----------------------+------+--------------------------------------+
| 2012-11-27 08:45:43 | 2012-11-27 08:47:26 | 2012-11-27 09:37:43 | 1 | 4 | 9.9.0.3 | 1 | 0 | 0 | 0 | 1 | NULL | NULL |
| 2012-11-27 09:38:38 | 2013-03-05 01:32:47 | NULL | 0 | 36 | 9.9.0.3 | 2 | 1 | 1 | 0 | 10 | NULL | 3a312912-e342-4fdf-af96-5a35df41e706 |
+---------------------+---------------------+---------------------+---------+----+---------+------------+-----------+--------+----------+----------------------+------+--------------------------------------+
2 rows in set (0.00 sec)

5. Except fixed ip info result:
HTTP/1.1 200 OK
X-Compute-Request-Id: req-2b32430a-b0a7-4a6b-9076-76bc69311551
Content-Type: application/json
Content-Length: 113
Date: Sat, 09 Mar 2013 11:28:01 GMT

{"fixed_ip": {"cidr": "9.9.0.0/24", "hostname": "lzy", "host": "dev-compute-ibm-folsom-1", "address": "9.9.0.3"}}

6. Analisys
The defect in os-fixed-ips api extension, it not take care the ips which marked 'deleted'.

Zhi Yan Liu (lzy-dev)
Changed in nova:
assignee: nobody → Zhi Yan Liu (lzy-dev)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
milestone: none → grizzly-rc1
importance: Undecided → High
Zhi Yan Liu (lzy-dev)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/23993
Committed: http://github.com/openstack/nova/commit/c8f7e66cc3253f86b88cd97b794f4654fab1bcb9
Submitter: Jenkins
Branch: master

commit c8f7e66cc3253f86b88cd97b794f4654fab1bcb9
Author: Zhi Yan Liu <email address hidden>
Date: Tue Mar 12 12:37:30 2013 +0800

    Skip deleted fixed ip address for os-fixed-ips extension

    Return the correct fixed ip address info when the address record(s)
    marked 'deleted' in db.

    Fixes bug 1152958

    Change-Id: I58ba47427753a81cd43eb618cff199c45f83322c
    Signed-off-by: Zhi Yan Liu <email address hidden>

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