cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gir...@apache.org
Subject [44/50] git commit: updated refs/heads/marvin to df58f51
Date Wed, 29 Jan 2014 08:54:19 GMT
CLOUDSTACK-5971:Templates created from a snapshots can't be copied to
other zones.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/a26c8117
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/a26c8117
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/a26c8117

Branch: refs/heads/marvin
Commit: a26c81178b4db78ad4936fb90a41444fc71eea83
Parents: bd2acd1
Author: Min Chen <min.chen@citrix.com>
Authored: Tue Jan 28 13:09:57 2014 -0800
Committer: Min Chen <min.chen@citrix.com>
Committed: Tue Jan 28 14:49:58 2014 -0800

----------------------------------------------------------------------
 .../apache/cloudstack/storage/image/TemplateServiceImpl.java | 8 ++++++++
 1 file changed, 8 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/a26c8117/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java
b/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java
index 2c82914..a8dec09 100644
--- a/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java
+++ b/engine/storage/image/src/org/apache/cloudstack/storage/image/TemplateServiceImpl.java
@@ -75,6 +75,7 @@ import com.cloud.dc.dao.DataCenterDao;
 import com.cloud.exception.ResourceAllocationException;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.storage.DataStoreRole;
+import com.cloud.storage.Storage.ImageFormat;
 import com.cloud.storage.Storage.TemplateType;
 import com.cloud.storage.StoragePool;
 import com.cloud.storage.VMTemplateStorageResourceAssoc;
@@ -721,6 +722,13 @@ public class TemplateServiceImpl implements TemplateService {
 
     @Override
     public AsyncCallFuture<TemplateApiResult> copyTemplate(TemplateInfo srcTemplate,
DataStore destStore) {
+        // for vmware template, we need to check if ova packing is needed, since template
created from snapshot does not have .ova file
+        // we invoke createEntityExtractURL to trigger ova packing. Ideally, we can directly
use extractURL to pass to following createTemplate. 
+        // Need to understand what is the background to use two different urls for copy and
extract.
+        if (srcTemplate.getFormat() == ImageFormat.OVA){
+            ImageStoreEntity tmpltStore = (ImageStoreEntity)srcTemplate.getDataStore();
+            tmpltStore.createEntityExtractUrl(srcTemplate.getInstallPath(), srcTemplate.getFormat(),
srcTemplate);
+        }
         // generate a URL from source template ssvm to download to destination data store
         String url = generateCopyUrl(srcTemplate);
         if (url == null) {


Mime
View raw message