Thank you for your response. To illustrate my intentions to bypass the dirty BDM entry according to the condition that connection_info is NULL, I drafted a patch below just now:
When bdm.connection_info is NULL (means it's dirty data), we will bypass _driver_detach_volume() and terminate_connection() and just invoke bdm.destroy() to delete this dirty data. So:
1, If there are N (N > 1) BDMs with the same instance_uuid and volume_id, we can run 'nova detach' operation N times to delete N dirty BDMs.
2, Because above logic is just added in detach operation, so it will not affect all newly created BDMs would meet this criteria.
If you guys think I'm on the right road, I can spend time to test above patch and continue to submit the code review. Hope to hear from you. thanks.
Hi Lee,
Thank you for your response. To illustrate my intentions to bypass the dirty BDM entry according to the condition that connection_info is NULL, I drafted a patch below just now:
diff --git a/nova/ compute/ manager. py b/nova/ compute/ manager. py compute/ manager. py compute/ manager. py manager. Manager) :
wr_ req, wr_bytes,
instance,
update_ totals= True) detach_ volume( context, instance, bdm) get_volume_ connector( instance) api.terminate_ connection( context, volume_id, connector) info: detach_ volume( context, instance, bdm) get_volume_ connector( instance) api.terminate_ connection( context, volume_id, connector)
index d6efd18..efbb225 100644
--- a/nova/
+++ b/nova/
@@ -4937,10 +4937,10 @@ class ComputeManager(
-
- self._driver_
- connector = self.driver.
- self.volume_
+ if bdm.connection_
+ self._driver_
+ connector = self.driver.
+ self.volume_
if destroy_bdm:
bdm. destroy( )
When bdm.connection_info is NULL (means it's dirty data), we will bypass _driver_ detach_ volume( ) and terminate_ connection( ) and just invoke bdm.destroy() to delete this dirty data. So:
1, If there are N (N > 1) BDMs with the same instance_uuid and volume_id, we can run 'nova detach' operation N times to delete N dirty BDMs.
2, Because above logic is just added in detach operation, so it will not affect all newly created BDMs would meet this criteria.
If you guys think I'm on the right road, I can spend time to test above patch and continue to submit the code review. Hope to hear from you. thanks.