Fix for NFS3 primary storage pool is failing to come out of maintenan…#71
Fix for NFS3 primary storage pool is failing to come out of maintenan…#71sandeeplocharla wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the KVM storage pool deletion flow to properly handle the deleteStoragePool(uuid, details) code path (notably for libvirt-backed pools), which previously could fall back to the StorageAdaptor default implementation and skip actual deletion.
Changes:
- Added a
LibvirtStorageAdaptor#deleteStoragePool(String, Map<String,String>)override to route to the existing libvirt deletion logic. - Adjusted
KVMStoragePoolManager#deleteStoragePool(type, uuid, details)ordering around deletion vs HA monitor removal.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/LibvirtStorageAdaptor.java | Adds an overload so deletion with details actually invokes libvirt pool removal logic. |
| plugins/hypervisors/kvm/src/main/java/com/cloud/hypervisor/kvm/storage/KVMStoragePoolManager.java | Changes when the adaptor delete call is executed relative to HA monitor removal for NFS pools. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| StorageAdaptor adaptor = getStorageAdaptor(type); | ||
| boolean deleteStatus = adaptor.deleteStoragePool(uuid, details); | ||
| if (type == StoragePoolType.NetworkFilesystem) { | ||
| _haMonitor.removeStoragePool(uuid); | ||
| } |
There was a problem hiding this comment.
can you validate this behaviour?
|
|
||
| public boolean deleteStoragePool(StoragePoolType type, String uuid, Map<String, String> details) { | ||
| StorageAdaptor adaptor = getStorageAdaptor(type); | ||
| boolean deleteStatus = adaptor.deleteStoragePool(uuid, details); |
There was a problem hiding this comment.
please add brief comment about this change
|
|
||
| public boolean deleteStoragePool(StoragePoolType type, String uuid, Map<String, String> details) { | ||
| StorageAdaptor adaptor = getStorageAdaptor(type); | ||
| boolean deleteStatus = adaptor.deleteStoragePool(uuid, details); |
6601541 to
be2f24e
Compare
| // 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. So, we need to remove the pool from HA monitor before deleting the pool. | ||
| boolean deleteStatus = adaptor.deleteStoragePool(uuid, details); | ||
| if (type == StoragePoolType.NetworkFilesystem) { | ||
| _haMonitor.removeStoragePool(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 |
There was a problem hiding this comment.
Would it be applicable to all vendors?
| StorageAdaptor adaptor = getStorageAdaptor(type); | ||
| boolean deleteStatus = adaptor.deleteStoragePool(uuid, details); | ||
| if (type == StoragePoolType.NetworkFilesystem) { | ||
| _haMonitor.removeStoragePool(uuid); | ||
| } |
There was a problem hiding this comment.
can you validate this behaviour?
Fix for NFS3 primary storage pool is failing to come out of maintenance mode
Description
This PR has the following:
deleteStoragePoolmethod leading to only just the change in the DB. This was leading to error in case ofCancel Maintenanceas the pool already exists with the host.Enable Maintenancecall comes, it was first removing the nfs mount, which was causing the libvirtd to error out duringDestroy Poolcall as the mount wasn't available.Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Previously:So, clearly though the nfs mount was removed, the libvirtd still has the pool details with it.
Now: