Skip to content

Load Balancer uses wrong attribute for flavor. #1743

@kmbulebu

Description

@kmbulebu

When creating a load balancer, the request will fail if a flavor is specified. Checking the code against the api documentation for Octavia and Neutron, I see that flavor is being used in gophercloud, where the API requires an attribute named flavor_id. I suspect this wasn't discovered as this is a fairly obscure feature.

Debug output from Terraform:

Error: Error creating LoadBalancer: Bad request with: [POST https://openstack-test.bbtnet.com:9696/v2.0/lbaas/loadbalancers], error message: {"NeutronError": {"message": "Unrecognized attribute(s) 'flavor'", "type": "HTTPBadRequest", "detail": ""}}

Octavia Source: https://github.com/openstack/octavia/blob/master/octavia/api/v2/types/load_balancer.py#L55
Octavia API Ref: https://docs.openstack.org/api-ref/load-balancer/v2/?expanded=create-a-load-balancer-detail#create-a-load-balancer

Neutron LBaaSv2 Source: https://review.opendev.org/gitweb?p=openstack/neutron-lbaas.git;a=blob;f=neutron_lbaas/services/loadbalancer/data_models.py;h=d44cc8dd5d543af9ffacb7bc1954f332083fdc67;hb=refs/heads/stable/rocky#l724
Neutron LBaaSv2 API Ref: https://docs.openstack.org/api-ref/network/v2/#load-balancer-as-a-service-2-0-deprecated (docs page currently broken)

I will submit a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions