diff --git a/ironic/nova/compute/manager.py b/ironic/nova/compute/manager.py index 0e36bf054b..c2bf47a3fe 100644 --- a/ironic/nova/compute/manager.py +++ b/ironic/nova/compute/manager.py @@ -81,13 +81,15 @@ class ClusteredComputeManager(manager.ComputeManager): pass @lockutils.synchronized(CCM_SEMAPHORE, 'ironic-') - def _update_resources(self): - """Update our resources + def _update_resources(self, node_uuid): + """Update the specified node resource - Updates the resources while protecting against a race on + Updates the resources for instance while protecting against a race on self._resource_tracker_dict. + :param node_uuid: UUID of the Ironic node to update resources for. """ - self.update_available_resource(nova.context.get_admin_context()) + self.update_available_resource_for_node( + nova.context.get_admin_context(), node_uuid) def terminate_instance(self, context, instance, bdms, reservations): """Terminate an instance on a node. @@ -100,4 +102,4 @@ class ClusteredComputeManager(manager.ComputeManager): instance, bdms, reservations) - self._update_resources() + self._update_resources(instance.node) diff --git a/releasenotes/notes/node-deletion-update-resources-53862e48ab658f77.yaml b/releasenotes/notes/node-deletion-update-resources-53862e48ab658f77.yaml new file mode 100644 index 0000000000..5f523588dc --- /dev/null +++ b/releasenotes/notes/node-deletion-update-resources-53862e48ab658f77.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - Fixed performance issue for 'ironic.nova.compute.ClusteredComputeManager' + when during Nova instance termination resources were updated for all + Nova hypervisors.