cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject [1/2] git commit: updated refs/heads/4.6 to 2c4ea50
Date Sun, 06 Dec 2015 19:35:02 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/4.6 f66e78279 -> 2c4ea503f


CLOUDSTACK-9025: Fixed can't create usable template from snapshot in Xenserver and Vmware

Fix also reverts below commit as below solution making assumption about hypervisor which are
not applicable
in case of XenServer and VmWare

Revert "CLOUDSTACK-8964: Can't create template or volume from snapshot"

This reverts commit ccf5d75cfbe769b34c021ab3653ed318cae25933.


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

Branch: refs/heads/4.6
Commit: f8790c3b9e8220666662bcdce88f62f57884bfc4
Parents: 9a21873
Author: Anshul Gangwar <anshul.gangwar@citrix.com>
Authored: Fri Dec 4 14:50:01 2015 +0530
Committer: Anshul Gangwar <anshul.gangwar@citrix.com>
Committed: Fri Dec 4 14:56:40 2015 +0530

----------------------------------------------------------------------
 .../src/com/cloud/hypervisor/XenServerGuru.java          | 11 ++++++++---
 .../com/cloud/hypervisor/HypervisorGuruManagerImpl.java  |  5 +----
 2 files changed, 9 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f8790c3b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/XenServerGuru.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/XenServerGuru.java b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/XenServerGuru.java
index 9567f31..28bcf0d 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/XenServerGuru.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/XenServerGuru.java
@@ -185,7 +185,8 @@ public class XenServerGuru extends HypervisorGuruBase implements HypervisorGuru,
             DataTO srcData = cpyCommand.getSrcTO();
             DataTO destData = cpyCommand.getDestTO();
 
-            if (srcData.getObjectType() == DataObjectType.SNAPSHOT && destData.getObjectType()
== DataObjectType.TEMPLATE) {
+            if (srcData.getHypervisorType() == HypervisorType.XenServer && srcData.getObjectType()
== DataObjectType.SNAPSHOT &&
+                    destData.getObjectType() == DataObjectType.TEMPLATE) {
                 DataStoreTO srcStore = srcData.getDataStore();
                 DataStoreTO destStore = destData.getDataStore();
                 if (srcStore instanceof NfsTO && destStore instanceof NfsTO) {
@@ -193,9 +194,13 @@ public class XenServerGuru extends HypervisorGuruBase implements HypervisorGuru,
                     EndPoint ep = endPointSelector.selectHypervisorHost(new ZoneScope(host.getDataCenterId()));
                     host = hostDao.findById(ep.getId());
                     hostDao.loadDetails(host);
+                    String hypervisorVersion = host.getHypervisorVersion();
                     String snapshotHotFixVersion = host.getDetail(XenserverConfigs.XS620HotFix);
-                    if (snapshotHotFixVersion != null && snapshotHotFixVersion.equalsIgnoreCase(XenserverConfigs.XSHotFix62ESP1004))
{
-                        return new Pair<Boolean, Long>(Boolean.TRUE, new Long(ep.getId()));
+                    if (hypervisorVersion != null && !hypervisorVersion.equalsIgnoreCase("6.1.0"))
{
+                        if (!(hypervisorVersion.equalsIgnoreCase("6.2.0") &&
+                                !(snapshotHotFixVersion != null && snapshotHotFixVersion.equalsIgnoreCase(XenserverConfigs.XSHotFix62ESP1004))))
{
+                            return new Pair<Boolean, Long>(Boolean.TRUE, new Long(ep.getId()));
+                        }
                     }
                 }
             }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/f8790c3b/server/src/com/cloud/hypervisor/HypervisorGuruManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/hypervisor/HypervisorGuruManagerImpl.java b/server/src/com/cloud/hypervisor/HypervisorGuruManagerImpl.java
index 4dcd703..ade1b96 100644
--- a/server/src/com/cloud/hypervisor/HypervisorGuruManagerImpl.java
+++ b/server/src/com/cloud/hypervisor/HypervisorGuruManagerImpl.java
@@ -28,7 +28,6 @@ import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.agent.api.Command;
-import com.cloud.host.HostVO;
 import com.cloud.host.dao.HostDao;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.utils.Pair;
@@ -75,9 +74,7 @@ public class HypervisorGuruManagerImpl extends ManagerBase implements Hypervisor
 
     @Override
     public long getGuruProcessedCommandTargetHost(long hostId, Command cmd) {
-        HostVO host = _hostDao.findById(hostId);
-        HypervisorGuru guru = getGuru(host.getHypervisorType());
-        if (guru != null) {
+        for (HypervisorGuru guru : _hvGuruList) {
             Pair<Boolean, Long> result = guru.getCommandHostDelegation(hostId, cmd);
             if (result.first()) {
                 return result.second();


Mime
View raw message