winterhazel commented on code in PR #13023:
URL: https://github.com/apache/cloudstack/pull/13023#discussion_r3336395919
##########
engine/storage/image/src/main/java/org/apache/cloudstack/storage/image/TemplateServiceImpl.java:
##########
@@ -295,10 +298,14 @@ public void handleSysTemplateDownload(HypervisorType
hostHyper, Long dcId) {
}
protected boolean shouldDownloadTemplateToStore(VMTemplateVO template,
DataStore store) {
+ if (_storeMgr.isRemovedOrReadonly(store)) {
+ return false;
Review Comment:
We could have a log here
##########
engine/storage/src/main/java/org/apache/cloudstack/storage/image/BaseImageStoreDriverImpl.java:
##########
@@ -175,10 +178,13 @@ public void createAsync(DataStore dataStore, DataObject
data, AsyncCompletionCal
AsyncCallbackDispatcher<BaseImageStoreDriverImpl, DownloadAnswer>
caller = AsyncCallbackDispatcher.create(this);
caller.setContext(context);
if (data.getType() == DataObjectType.TEMPLATE) {
-
caller.setCallback(caller.getTarget().createTemplateAsyncCallback(null, null));
- if (logger.isDebugEnabled()) {
- logger.debug("Downloading template to data store {}",
dataStore);
+ if (dataStoreManager.isRemovedOrReadonly(dataStore)) {
Review Comment:
Doesn't it make more sense to filter out the removed/read-only secondary
storages in the methods responsible for choosing a secondary storage for
migration/template creation from volume instead of here in `createAsync`?
--
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]