Skip to content

Commit 99ead34

Browse files
committed
Fix S3 system vm start issues caused by recent storage refactor work.
1 parent 2ff791b commit 99ead34

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

core/src/com/cloud/storage/resource/StorageSubsystemCommandHandlerBase.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
*/
1919
package com.cloud.storage.resource;
2020

21+
import org.apache.log4j.Logger;
22+
2123
import org.apache.cloudstack.storage.command.AttachCommand;
2224
import org.apache.cloudstack.storage.command.CopyCommand;
2325
import org.apache.cloudstack.storage.command.CreateObjectAnswer;
@@ -26,7 +28,6 @@
2628
import org.apache.cloudstack.storage.command.DettachCommand;
2729
import org.apache.cloudstack.storage.command.IntroduceObjectCmd;
2830
import org.apache.cloudstack.storage.command.StorageSubSystemCommand;
29-
import org.apache.log4j.Logger;
3031

3132
import com.cloud.agent.api.Answer;
3233
import 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) {

0 commit comments

Comments
 (0)