Comment 7 for bug 1843211

Revision history for this message
yangjianfeng (yangjianfeng) wrote :

Hello Rodolfo:
Maybe I didn’t make it clear, you are right. if I remove the allocation pools in the subnet. the port shouldn't create successfully. Because of the subnet can't allocate IP, so the number of assignable IPs should be 0. But, the "openstack ip availability show" command tells me that the network's number of total IPs is 256, the number of used IPs is 3. So, I can't accurately calculate the number of available IPs from the return result of the command line. Obviously,this is unreasonable.

So, I think we should make some adjustments to this API[1]. We should add a 'available_ips' field that represents the number of assignable IPs directly. The 'total_ips' only represents the number of IPs for subnet CIDR.

[1] https://docs.openstack.org/api-ref/network/v2/index.html?#network-ip-availability-and-usage-stats