cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From edi...@apache.org
Subject git commit: updated refs/heads/master to f486d36
Date Mon, 29 Jul 2013 23:59:08 GMT
Updated Branches:
  refs/heads/master ccec275e0 -> f486d36f8


CLOUDSTACK-3908: fix extract path


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

Branch: refs/heads/master
Commit: f486d36f8833a8a65f2a30c0952dced052d077ea
Parents: ccec275
Author: Edison Su <sudison@gmail.com>
Authored: Mon Jul 29 16:57:23 2013 -0700
Committer: Edison Su <sudison@gmail.com>
Committed: Mon Jul 29 16:58:51 2013 -0700

----------------------------------------------------------------------
 .../manager/VmwareStorageManagerImpl.java       |  4 +-
 .../template/HypervisorTemplateAdapter.java     | 65 --------------------
 2 files changed, 2 insertions(+), 67 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f486d36f/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
index 69d7fdb..f6f0cc1 100644
--- a/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
+++ b/plugins/hypervisors/vmware/src/com/cloud/hypervisor/vmware/manager/VmwareStorageManagerImpl.java
@@ -140,12 +140,12 @@ public class VmwareStorageManagerImpl implements VmwareStorageManager
{
             if (templateName.endsWith(".ova")) {
                 if(new File(templateName).exists())  {
                     s_logger.debug("OVA files exists. succeed. ");
-                    return templateName;
+                    return installPath;
                 } else {
                     if (new File(templateName + ".meta").exists()) {
                         ovafileName = getOVAFromMetafile(templateName + ".meta");
                         s_logger.debug("OVA file in meta file is " + ovafileName);
-                        return installPath;
+                        return ovafileName;
                     }  else {
                         String msg = "Unable to find ova meta or ova file to prepare template
(vmware)";
                         s_logger.error(msg);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f486d36f/server/src/com/cloud/template/HypervisorTemplateAdapter.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/template/HypervisorTemplateAdapter.java b/server/src/com/cloud/template/HypervisorTemplateAdapter.java
index 4b3cade..dd6cc68 100755
--- a/server/src/com/cloud/template/HypervisorTemplateAdapter.java
+++ b/server/src/com/cloud/template/HypervisorTemplateAdapter.java
@@ -342,69 +342,4 @@ public class HypervisorTemplateAdapter extends TemplateAdapterBase {
 
         return profile;
     }
-
-    @Override
-    public TemplateProfile prepareExtractTemplate(ExtractTemplateCmd extractcmd) {
-        TemplateProfile profile = super.prepareExtractTemplate(extractcmd);
-        VMTemplateVO template = profile.getTemplate();
-        Long zoneId = profile.getZoneId();
-        Long templateId = template.getId();
-
-        // Simply return profile if non-ESX hypervisor.
-        if (template.getHypervisorType() == HypervisorType.VMware) {
-            PrepareOVAPackingCommand cmd = null;
-            String zoneName="";
-            List<DataStore> imageStores = null;
-
-            if (!template.isCrossZones()) {
-                if (zoneId == null) {
-                    throw new CloudRuntimeException("ZoneId cannot be null for a template
that is not available across zones");
-                }
-                // Else get the list of image stores in this zone's scope.
-                DataCenterVO zone = _dcDao.findById(zoneId);
-                zoneName = zone.getName();
-                imageStores = this.storeMgr.getImageStoresByScope(new ZoneScope(profile.getZoneId()));
-            } else {
-                // template is available across zones. Get a list of all image stores.
-                imageStores = this.storeMgr.listImageStores();
-            }
-
-            if (imageStores == null || imageStores.size() == 0) {
-                throw new CloudRuntimeException("Unable to find an image store zone when
trying to download template " + profile.getTemplate());
-            }
-
-            s_logger.debug("Attempting to mark template host refs for template: " + template.getName()
+ " as destroyed in zone: " + zoneName);
-
-            // Make sure the template is downloaded to all the necessary secondary storage
hosts
-
-            for (DataStore store : imageStores) {
-                long storeId = store.getId();
-                List<TemplateDataStoreVO> templateStoreVOs = _tmpltStoreDao.listByTemplateStore(templateId,
storeId);
-                for (TemplateDataStoreVO templateStoreVO : templateStoreVOs) {
-                    if (templateStoreVO.getDownloadState() == Status.DOWNLOAD_IN_PROGRESS)
{
-                        String errorMsg = "Please specify a template that is not currently
being downloaded.";
-                        s_logger.debug("Template: " + template.getName() + " is currently
being downloaded to secondary storage host: " + store.getName() + ".");
-                        throw new CloudRuntimeException(errorMsg);
-                    }
-                    String installPath = templateStoreVO.getInstallPath();
-                    if (installPath != null) {
-                        EndPoint ep = _epSelector.select(store);
-                        if (ep == null) {
-                            s_logger.warn("prepareOVAPacking (hyervisorTemplateAdapter):
There is no secondary storage VM for secondary storage host " + store.getName());
-                            throw new CloudRuntimeException("PrepareExtractTemplate: can't
locate ssvm for SecStorage Host.");
-                        }
-                        cmd = new PrepareOVAPackingCommand(store.getUri(), installPath);
-                        cmd.setContextParam("hypervisor", HypervisorType.VMware.toString());
-                        Answer answer = ep.sendMessage(cmd);
-
-                        if (answer == null || !answer.getResult()) {
-                            s_logger.debug("Failed to create OVA for template " + templateStoreVO
+ " due to " + ((answer == null) ? "answer is null" : answer.getDetails()));
-                            throw new CloudRuntimeException("PrepareExtractTemplate: Failed
to create OVA for template extraction. ");
-                        }
-                    }
-                }
-            }
-        }
-        return profile;
-    }
 }


Mime
View raw message