network-ip-availabilities api return data is incorrect

Bug #1838487 reported by ZhouHeng
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
In Progress
Undecided
ZhouHeng

Bug Description

This bug tracker is for errors with the documentation, use the following as a template and remove or add fields as you see fit. Convert [ ] into [x] to check boxes:

- [ ] This doc is inaccurate in this way: ______
- [ ] This is a doc addition request.
- [ ] I have a fix to the document that I can paste below including example: input and output.

If you have a troubleshooting or support issue, use the following resources:

 - Ask OpenStack: http://ask.openstack.org
 - The mailing list: http://lists.openstack.org
 - IRC: 'openstack' channel on Freenode

-----------------------------------
Release: on 2019-07-29 13:09:43
SHA: aaae83acaac5f58918ff53613b4de20bbfe30d81
Source: https://opendev.org/openstack/neutron-lib/src/api-ref/source/v2/index.rst
URL: https://docs.openstack.org/api-ref/network/v2/index.html

Tags: api
Revision history for this message
ZhouHeng (zhouhenglc) wrote :

First I create a network and a subnet. network_id=0c557c5f-acf6-44c4-8c1c-cc12672d4d4f
second I update subnet with allocation_pools=[]

then I call api /v2.0/network-ip-availabilities/0c557c5f-acf6-44c4-8c1c-cc12672d4d4f
api return:
{"network_ip_availability": {"used_ips": 1, "subnet_ip_availability": [{"used_ips": 1, "subnet_id": "a5b694f7-7054-4ecc-8447-8e9a7a15c5f0", "subnet_name": "ZhNet-Subnet", "ip_version": 4, "cidr": "192.168.120.0/24", "total_ips": 256}], "network_id": "0c557c5f-acf6-44c4-8c1c-cc12672d4d4f", "tenant_id": "2fb75a1bedac449d904f71fbea5cd1d2", "total_ips": 256, "project_id": "2fb75a1bedac449d904f71fbea5cd1d2", "network_name": "ZhNet"}}
this result tell me: I have 256 available IPs in subnet. but I couldn't create a port successfully in this network.

Revision history for this message
ZhouHeng (zhouhenglc) wrote :

The total number of IPs should be = the number of unions of address pool IP and used IP.
Because address pools are allowed to be deleted. There are also addresses outside the address pool, such as router addresses.

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

Fix proposed to branch: master
Review: https://review.opendev.org/674723

Changed in neutron:
assignee: nobody → ZhouHeng (zhouhenglc)
status: New → In Progress
tags: added: api
removed: api-ref
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on neutron (master)

Change abandoned by Slawek Kaplonski (<email address hidden>) on branch: master
Review: https://review.opendev.org/674723
Reason: This review is > 4 weeks without comment, and failed Jenkins the last time it was checked. We are abandoning this for now. Feel free to reactivate the review by pressing the restore button and leaving a 'recheck' comment to get fresh test results.

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.