mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-15 10:02:27 +01:00
CLOUDSTACK-4402: [deleteStoragePool] There is no way to delete Primary storage if the last host with which it was associated is already removed.
This commit is contained in:
parent
5eda091530
commit
46c6b91832
@ -464,8 +464,6 @@ public class CloudStackPrimaryDataStoreLifeCycleImpl implements PrimaryDataStore
|
||||
HypervisorType hType = null;
|
||||
if (hostPoolRecords.size() > 0) {
|
||||
hType = getHypervisorType(hostPoolRecords.get(0).getHostId());
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Remove the SR associated with the Xenserver
|
||||
@ -486,7 +484,7 @@ public class CloudStackPrimaryDataStoreLifeCycleImpl implements PrimaryDataStore
|
||||
}
|
||||
}
|
||||
|
||||
if (!deleteFlag) {
|
||||
if (!hostPoolRecords.isEmpty() && !deleteFlag) {
|
||||
throw new CloudRuntimeException("Failed to delete storage pool on host");
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user