Creating a load balancer doesn't validate a minimum number of ips when the subnet is specified

Bug #2039430 reported by Quentin GROLLEAU
6
This bug affects 1 person
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-8fd5-4731-aa69-f4c96e364730
+------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
| Field | Value |
+------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
| id | 0072ced1-8fd5-4731-aa69-f4c96e364730 |
| name | None |
| network_id | 0072ced1-8fd5-4731-aa69-f4c96e364730 |
| network_name | Test_Octavia_minimum |
| project_id | ba9d9c29dda84eaf8d96f3c95647d748 |
| subnet_ip_availability | cidr='10.0.0.0/28', ip_version='4', subnet_id='44730f99-f265-4205-80f7-54da3fe4f159', subnet_name='private_subnet', total_ips='13', used_ips='14' |
| tenant_id | ba9d9c29dda84eaf8d96f3c95647d748 |
| total_ips | 13 |
| used_ips | 14 |
+------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------+
 ❯ openstack loadbalancer create --vip-subnet-id 44730f99-f265-4205-80f7-54da3fe4f159 --name LB_port_test_minimum

Provider 'amphora' reports error: No more IP addresses available on network 0072ced1-8fd5-4731-aa69-f4c96e364730.
Neutron server returns request_ids: ['req-fac2ab96-a057-4a61-9a87-77f9da0f8c97'] (HTTP 500) (Request-ID: req-faf25c71-c05f-41f5-954b-7497c89697c8)

Instead, shouldn't we return a 400 error like when we specify the network :

❯ openstack loadbalancer create --vip-subnet-id 44730f99-f265-4205-80f7-54da3fe4f159 --name LB_port_test_minimum
Validation failure: Subnet(s) in the supplied network do not contain enough available IPs. (HTTP 400) (Request-ID: req-d13d0ee0-553d-42cb-8b1b-7fc4ffb84f3e)

Revision history for this message
Gregory Thiemonge (gthiemonge) wrote :

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/860d2f6aadfba9cef2c695d072dd48e29a7e85c8/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

Changed in octavia:
importance: Undecided → Medium
status: New → Confirmed
Changed in octavia:
assignee: nobody → Quentin GROLLEAU (quentin.grolleau)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to octavia (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/octavia/+/898803

Changed in octavia:
status: Confirmed → In Progress
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.