Backup edge put enhance
When we try to collect one edge to backup edge pool, we need to first update edge at the backend and then fresh vnic binding db info. If all above ops are executed successfully, we can finally collect it to edge pool. Change-Id: I7ae90c2c802aa2584b470a7e15c2624618e15c88
This commit is contained in:
parent
4fb4141d49
commit
03d16f3006
@ -650,7 +650,6 @@ class EdgeManager(object):
|
||||
backup_num = len(backup_router_bindings)
|
||||
# collect the edge to pool if pool not full
|
||||
if backup_num < edge_pool_range['maximum_pooled_edges']:
|
||||
LOG.debug("Collect edge: %s to pool", binding['edge_id'])
|
||||
nsxv_db.delete_nsxv_router_binding(
|
||||
context.session, router_id)
|
||||
backup_router_id = (vcns_const.BACKUP_ROUTER_PREFIX +
|
||||
@ -660,7 +659,7 @@ class EdgeManager(object):
|
||||
backup_router_id,
|
||||
binding['edge_id'],
|
||||
None,
|
||||
plugin_const.ACTIVE,
|
||||
plugin_const.PENDING_UPDATE,
|
||||
appliance_size=binding['appliance_size'],
|
||||
edge_type=binding['edge_type'])
|
||||
# change edge's name at backend
|
||||
@ -676,6 +675,12 @@ class EdgeManager(object):
|
||||
if not dist and binding['edge_id']:
|
||||
nsxv_db.init_edge_vnic_binding(
|
||||
context.session, binding['edge_id'])
|
||||
|
||||
if task.status == task_const.TaskStatus.COMPLETED:
|
||||
nsxv_db.update_nsxv_router_binding(
|
||||
context.session, backup_router_id,
|
||||
status=plugin_const.ACTIVE)
|
||||
LOG.debug("Collect edge: %s to pool", binding['edge_id'])
|
||||
else:
|
||||
nsxv_db.update_nsxv_router_binding(
|
||||
context.session, router_id,
|
||||
|
Loading…
x
Reference in New Issue
Block a user