Updated Branches: refs/heads/master 2ff791b0b -> 99ead3419
Fix S3 system vm start issues caused by recent storage refactor work. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/99ead341 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/99ead341 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/99ead341 Branch: refs/heads/master Commit: 99ead3419c80fc7135a95f34ced7650eda3572fd Parents: 2ff791b Author: Min Chen <[email protected]> Authored: Sat Nov 2 22:30:10 2013 -0700 Committer: Min Chen <[email protected]> Committed: Sat Nov 2 22:30:10 2013 -0700 ---------------------------------------------------------------------- .../storage/resource/StorageSubsystemCommandHandlerBase.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/99ead341/core/src/com/cloud/storage/resource/StorageSubsystemCommandHandlerBase.java ---------------------------------------------------------------------- diff --git a/core/src/com/cloud/storage/resource/StorageSubsystemCommandHandlerBase.java b/core/src/com/cloud/storage/resource/StorageSubsystemCommandHandlerBase.java index b43722a..4efeafd 100644 --- a/core/src/com/cloud/storage/resource/StorageSubsystemCommandHandlerBase.java +++ b/core/src/com/cloud/storage/resource/StorageSubsystemCommandHandlerBase.java @@ -18,6 +18,8 @@ */ package com.cloud.storage.resource; +import org.apache.log4j.Logger; + import org.apache.cloudstack.storage.command.AttachCommand; import org.apache.cloudstack.storage.command.CopyCommand; import org.apache.cloudstack.storage.command.CreateObjectAnswer; @@ -26,7 +28,6 @@ import org.apache.cloudstack.storage.command.DeleteCommand; import org.apache.cloudstack.storage.command.DettachCommand; import org.apache.cloudstack.storage.command.IntroduceObjectCmd; import org.apache.cloudstack.storage.command.StorageSubSystemCommand; -import org.apache.log4j.Logger; import com.cloud.agent.api.Answer; import com.cloud.agent.api.Command; @@ -67,7 +68,9 @@ public class StorageSubsystemCommandHandlerBase implements StorageSubsystemComma DataStoreTO srcDataStore = srcData.getDataStore(); DataStoreTO destDataStore = destData.getDataStore(); - if (srcData.getObjectType() == DataObjectType.TEMPLATE && srcData.getDataStore().getRole() == DataStoreRole.Image && destData.getDataStore().getRole() == DataStoreRole.Primary) { + if (srcData.getObjectType() == DataObjectType.TEMPLATE + && (srcData.getDataStore().getRole() == DataStoreRole.Image || srcData.getDataStore().getRole() == DataStoreRole.ImageCache) + && destData.getDataStore().getRole() == DataStoreRole.Primary) { //copy template to primary storage return processor.copyTemplateToPrimaryStorage(cmd); } else if (srcData.getObjectType() == DataObjectType.TEMPLATE && srcDataStore.getRole() == DataStoreRole.Primary && destDataStore.getRole() == DataStoreRole.Primary) {
