Comment 4 for bug 1585907

Revision history for this message
Akihiro Motoki (amotoki) wrote :

The bug reported looks valid.

'total_ips' is calculated based on the size of allocation_pools, but when 'used_ips' is calculated IP address allocated out of allocation_pools are included.

This can be reproduced like this.
A created port consumes IP address out of the allocation pool, but used_ips increases.

$ neutron net-create net1
$ neutron subnet-create --name subnet1 --allocation-pool start=10.1.1.11,end=10.1.1.19 net1 10.1.1.0/24
$ neutron port-create --fixed-ip ip_address=10.1.1.99 net1
$ neutron net-ip-availability-show net1
+------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+
| network_id | 4e3a85fb-b456-498a-bbc5-37b12b8c53da |
| network_name | net1 |
| subnet_ip_availability | {"used_ips": 2, "subnet_id": "1dca8b81-fb51-447d-9c58-e11d1adc90bd", "subnet_name": "subnet1", "ip_version": 4, "cidr": "10.1.1.0/24", "total_ips": 9} |
| tenant_id | 3b91ad8c9c624303aa38334f8fc5349e |
| total_ips | 9 |
| used_ips | 2 |
+------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------+