File tree Expand file tree Collapse file tree
core/src/com/cloud/storage/resource Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818 */
1919package com .cloud .storage .resource ;
2020
21+ import org .apache .log4j .Logger ;
22+
2123import org .apache .cloudstack .storage .command .AttachCommand ;
2224import org .apache .cloudstack .storage .command .CopyCommand ;
2325import org .apache .cloudstack .storage .command .CreateObjectAnswer ;
2628import org .apache .cloudstack .storage .command .DettachCommand ;
2729import org .apache .cloudstack .storage .command .IntroduceObjectCmd ;
2830import org .apache .cloudstack .storage .command .StorageSubSystemCommand ;
29- import org .apache .log4j .Logger ;
3031
3132import com .cloud .agent .api .Answer ;
3233import com .cloud .agent .api .Command ;
@@ -67,7 +68,9 @@ protected Answer execute(CopyCommand cmd) {
6768 DataStoreTO srcDataStore = srcData .getDataStore ();
6869 DataStoreTO destDataStore = destData .getDataStore ();
6970
70- if (srcData .getObjectType () == DataObjectType .TEMPLATE && srcData .getDataStore ().getRole () == DataStoreRole .Image && destData .getDataStore ().getRole () == DataStoreRole .Primary ) {
71+ if (srcData .getObjectType () == DataObjectType .TEMPLATE
72+ && (srcData .getDataStore ().getRole () == DataStoreRole .Image || srcData .getDataStore ().getRole () == DataStoreRole .ImageCache )
73+ && destData .getDataStore ().getRole () == DataStoreRole .Primary ) {
7174 //copy template to primary storage
7275 return processor .copyTemplateToPrimaryStorage (cmd );
7376 } else if (srcData .getObjectType () == DataObjectType .TEMPLATE && srcDataStore .getRole () == DataStoreRole .Primary && destDataStore .getRole () == DataStoreRole .Primary ) {
You can’t perform that action at this time.
0 commit comments