Ensure LB with error status is only recreated after deleted

As soon as a load balancer creation is triggered its status is
"PENDING_CREATE" and the creation of the other LB resources
are consequently triggered. If in the meantime the LB transitioned
to "ERROR" status the creation of the resources will be retried
all the time due to timeout on provisioning the LB, causing a
controller restart and new LB creation, whithout the previous one
deleted.
This commit ensures the LB with ERRORs status is removed and retried
when waiting for it to be provisioned.

Closes-bug: 1861313

Change-Id: I5e47a436bb4d11a5b07923480b008d14d7780566
This commit is contained in:
Maysa Macedo 2020-01-29 16:35:21 +00:00
parent 381af76bf8
commit d49fd12f7c
1 changed files with 5 additions and 0 deletions

View File

@ -837,6 +837,11 @@ class LBaaSv2Driver(base.LBaaSDriver):
LOG.debug("Provisioning complete for %(lb)s", {
'lb': loadbalancer})
return
elif status == 'ERROR':
LOG.debug("Releasing loadbalancer %s with error status",
loadbalancer.id)
self.release_loadbalancer(loadbalancer)
break
else:
LOG.debug("Provisioning status %(status)s for %(lb)s, "
"%(rem).3gs remaining until timeout",