sandeeplocharla commented on code in PR #13897:
URL: https://github.com/apache/cloudstack/pull/13897#discussion_r4339004030


##########
plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java:
##########
@@ -457,10 +457,12 @@ public synchronized boolean 
deleteStoragePool(StoragePoolType type, String uuid)
 
     public boolean deleteStoragePool(StoragePoolType type, String uuid, 
Map<String, String> details) {
         StorageAdaptor adaptor = getStorageAdaptor(type);
+        // For NetworkFilesystem, libvirt will take care of unmounting the nfs 
mount. If nfs mount has been removed before libvirt's pool
+        // delete, libvirt will throw an error.
+        boolean deleteStatus = adaptor.deleteStoragePool(uuid, details);

Review Comment:
   Yeah, this looks good. I'll do the below:
   1. Revert the `deleteStoragePool(uuid, details)` [LibvirtStorageAdaptor] 
override added and the sequence change in `deleteStoragePool` 
[KVMStoragePoolManager.java].
   2. Implement `unregisterStoragePool(uuid)` [KVMHAMonitor.java] to only 
unregister the pool from the HA map.
   3. Update `public boolean deleteStoragePool(StoragePoolType type, String 
uuid, Map<String, String> details)` method to `public boolean 
deleteStoragePool(StoragePoolType type, String uuid, Map<String, String> 
details) {
       StorageAdaptor adaptor = getStorageAdaptor(type);
       boolean deleteStatus;
       if (type == StoragePoolType.NetworkFilesystem) {
           _haMonitor.unregisterStoragePool(uuid);
           deleteStatus = adaptor.deleteStoragePool(uuid);
       } else {
           deleteStatus = adaptor.deleteStoragePool(uuid, details);
       }
       synchronized (_storagePools) {
           _storagePools.remove(uuid);
       }
       return deleteStatus;
   }`



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to