mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
storage: Secondary storage allow store deletion after successful data migration (#4615)
Co-authored-by: Pearl Dsilva <pearl.dsilva@shapeblue.com>
This commit is contained in:
parent
5a3ae159ca
commit
a896760a40
@ -522,6 +522,7 @@ public class TemplateJoinDaoImpl extends GenericDaoBaseWithTagInformation<Templa
|
||||
sc.setParameters("store_id", storeId);
|
||||
sc.setParameters("type", TemplateType.USER);
|
||||
sc.setParameters("templateState", VirtualMachineTemplate.State.Active);
|
||||
sc.setParameters("public", Boolean.FALSE);
|
||||
return searchIncludingRemoved(sc, null, null, false);
|
||||
}
|
||||
|
||||
|
||||
@ -247,7 +247,7 @@ public class HypervisorTemplateAdapter extends TemplateAdapterBase {
|
||||
|
||||
private void createTemplateWithinZone(Long zId, TemplateProfile profile, VMTemplateVO template) {
|
||||
// find all eligible image stores for this zone scope
|
||||
List<DataStore> imageStores = storeMgr.getImageStoresByScope(new ZoneScope(zId));
|
||||
List<DataStore> imageStores = storeMgr.getImageStoresByScopeExcludingReadOnly(new ZoneScope(zId));
|
||||
if (imageStores == null || imageStores.size() == 0) {
|
||||
throw new CloudRuntimeException("Unable to find image store to download template " + profile.getTemplate());
|
||||
}
|
||||
@ -314,7 +314,7 @@ public class HypervisorTemplateAdapter extends TemplateAdapterBase {
|
||||
zoneId = profile.getZoneIdList().get(0);
|
||||
|
||||
// find all eligible image stores for this zone scope
|
||||
List<DataStore> imageStores = storeMgr.getImageStoresByScope(new ZoneScope(zoneId));
|
||||
List<DataStore> imageStores = storeMgr.getImageStoresByScopeExcludingReadOnly(new ZoneScope(zoneId));
|
||||
if (imageStores == null || imageStores.size() == 0) {
|
||||
throw new CloudRuntimeException("Unable to find image store to download template " + profile.getTemplate());
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user