Creating a load balancer doesn't validate a minimum number of ips when the subnet is specified
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
octavia |
In Progress
|
Medium
|
Quentin GROLLEAU |
Bug Description
When a customer is creating a loadbalancer specifying the subnet_id, no check on the minimal numbers of ips is done. May be we can add one like when network_id is specify ?
Reproducer :
❯ openstack ip availability show 0072ced1-
+------
| Field | Value |
+------
| id | 0072ced1-
| name | None |
| network_id | 0072ced1-
| network_name | Test_Octavia_
| project_id | ba9d9c29dda84ea
| subnet_
| tenant_id | ba9d9c29dda84ea
| total_ips | 13 |
| used_ips | 14 |
+------
❯ openstack loadbalancer create --vip-subnet-id 44730f99-
Provider 'amphora' reports error: No more IP addresses available on network 0072ced1-
Neutron server returns request_ids: ['req-fac2ab96-
Instead, shouldn't we return a 400 error like when we specify the network :
❯ openstack loadbalancer create --vip-subnet-id 44730f99-
Validation failure: Subnet(s) in the supplied network do not contain enough available IPs. (HTTP 400) (Request-ID: req-d13d0ee0-
Changed in octavia: | |
assignee: | nobody → Quentin GROLLEAU (quentin.grolleau) |
Thanks for reporting it, yes, we could check that there are enough IP addresses on vip_subnet_id
Additional note:
there's another issue in https:/ /opendev. org/openstack/ octavia/ src/commit/ 860d2f6aadfba9c ef2c695d072dd48 e29a7e85c8/ octavia/ api/v2/ controllers/ load_balancer. py#L151- L161
we get the number of required IP addresses based on CONF.controller _worker. loadbalancer_ topology but the default topology may be overridden by a flavor, we need to fix that too