provider/openstack: Fix create/delete statuses in load balancing resources for openstack provider. #5557
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When trying to create a complete load balancer in Openstack, I would often run into the following error:
* openstack_lb_member_v1.lb_member.1: unexpected state 'PENDING_CREATE', wanted target '[ACTIVE]'
After digging around in the code, I saw that the
Pending
status was different for the various LB resources (member, monitor, pool, and vip). Based on the source code for neutron lbaas, I found that the statuses should be as follows:Create resource - 'PENDING_CREATE' - https://github.com/openstack/neutron-lbaas/blob/master/neutron_lbaas/db/loadbalancer/loadbalancer_db.py - lines 379, 593, 659, and 728.
Delete resource - 'PENDING_DELETE' - https://github.com/openstack/neutron-lbaas/blob/master/neutron_lbaas/services/loadbalancer/plugin.py - lines 167, 250, 277, and 341.
After making this change, and re-compiling the openstack provider, I have not seen the error after multiple deployments.
Note: the create resource for vip (resource_openstack_lb_vip_v1.go) already has the Pending status set to 'PENDING_CREATE'.