NSXv: Backup pool locking
Backup pool management should be fully protceted by locking. Change-Id: I8a8c4bddb5684801596aae4adba50b53932786fe
This commit is contained in:
parent
2376d72d94
commit
f9e7b86b96
@ -662,7 +662,7 @@ class EdgeManager(object):
|
||||
edge_type=edge_type,
|
||||
availability_zone=availability_zone)
|
||||
|
||||
with locking.LockManager.get_lock('nsx-edge-request'):
|
||||
with locking.LockManager.get_lock('nsx-edge-backup-pool'):
|
||||
self._clean_all_error_edge_bindings(
|
||||
context, availability_zone=availability_zone)
|
||||
available_router_binding = self._get_available_router_binding(
|
||||
@ -736,7 +736,9 @@ class EdgeManager(object):
|
||||
|
||||
def _free_edge_appliance(self, context, router_id):
|
||||
"""Try to collect one edge to pool."""
|
||||
binding = nsxv_db.get_nsxv_router_binding(context.session, router_id)
|
||||
with locking.LockManager.get_lock('nsx-edge-backup-pool'):
|
||||
binding = nsxv_db.get_nsxv_router_binding(context.session,
|
||||
router_id)
|
||||
if not binding:
|
||||
LOG.warning("router binding for router: %s "
|
||||
"not found", router_id)
|
||||
@ -772,13 +774,13 @@ class EdgeManager(object):
|
||||
status=constants.PENDING_DELETE)
|
||||
# delete edge
|
||||
self._get_worker_pool().spawn_n(
|
||||
self.nsxv_manager.delete_edge, q_context.get_admin_context(),
|
||||
self.nsxv_manager.delete_edge,
|
||||
q_context.get_admin_context(),
|
||||
router_id, edge_id, dist=dist)
|
||||
return
|
||||
|
||||
availability_zone = self._availability_zones.get_availability_zone(
|
||||
availability_zone_name)
|
||||
with locking.LockManager.get_lock('nsx-edge-request'):
|
||||
self._clean_all_error_edge_bindings(
|
||||
context, availability_zone=availability_zone)
|
||||
backup_router_bindings = self._get_backup_edge_bindings(
|
||||
@ -811,7 +813,8 @@ class EdgeManager(object):
|
||||
status=constants.PENDING_DELETE)
|
||||
# delete edge
|
||||
self._get_worker_pool().spawn_n(
|
||||
self.nsxv_manager.delete_edge, q_context.get_admin_context(),
|
||||
self.nsxv_manager.delete_edge,
|
||||
q_context.get_admin_context(),
|
||||
router_id, edge_id, dist=dist)
|
||||
|
||||
def _allocate_dhcp_edge_appliance(self, context, resource_id,
|
||||
|
Loading…
x
Reference in New Issue
Block a user