cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bhais...@apache.org
Subject [18/50] [abbrv] git commit: updated refs/heads/saml2 to ba68616
Date Sun, 24 Aug 2014 14:04:38 GMT
map XS 6.5 betas to the same resource, that all XS 6.5 betas will use the same resource and
guest os list


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

Branch: refs/heads/saml2
Commit: b7f5e95c8f17cf42d35705872b4210db8c2def72
Parents: 73d53e5
Author: Anthony Xu <anthony.xu@citrix.com>
Authored: Thu Aug 21 16:57:19 2014 -0700
Committer: Anthony Xu <anthony.xu@citrix.com>
Committed: Thu Aug 21 16:57:19 2014 -0700

----------------------------------------------------------------------
 .../discoverer/XcpServerDiscoverer.java         |  21 +-
 .../xenserver/resource/CitrixHelper.java        |  18 +-
 .../xenserver/resource/CitrixResourceBase.java  |   8 +-
 setup/db/db/schema-441to450.sql                 | 342 +++++++++----------
 4 files changed, 199 insertions(+), 190 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b7f5e95c/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/discoverer/XcpServerDiscoverer.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/discoverer/XcpServerDiscoverer.java
b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/discoverer/XcpServerDiscoverer.java
index 0450e3b..2fcd62b 100755
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/discoverer/XcpServerDiscoverer.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/discoverer/XcpServerDiscoverer.java
@@ -43,6 +43,7 @@ import com.cloud.host.HostVO;
 import com.cloud.host.Status;
 import com.cloud.hypervisor.Hypervisor;
 import com.cloud.hypervisor.Hypervisor.HypervisorType;
+import com.cloud.hypervisor.xenserver.resource.CitrixHelper;
 import com.cloud.hypervisor.xenserver.resource.CitrixResourceBase;
 import com.cloud.hypervisor.xenserver.resource.XcpOssResource;
 import com.cloud.hypervisor.xenserver.resource.XcpServerResource;
@@ -79,6 +80,7 @@ import com.xensource.xenapi.Session;
 import com.xensource.xenapi.Types.SessionAuthenticationFailed;
 import com.xensource.xenapi.Types.UuidInvalid;
 import com.xensource.xenapi.Types.XenAPIException;
+
 import org.apache.cloudstack.hypervisor.xenserver.XenserverConfigs;
 import org.apache.log4j.Logger;
 import org.apache.xmlrpc.XmlRpcException;
@@ -87,6 +89,7 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 import javax.persistence.EntityExistsException;
+
 import java.net.InetAddress;
 import java.net.URI;
 import java.net.UnknownHostException;
@@ -284,10 +287,7 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer,
L
                 Host.Record record = entry.getValue();
                 String hostAddr = record.address;
 
-                String prodVersion = record.softwareVersion.get("product_version");
-                if (prodVersion == null) {
-                    prodVersion = record.softwareVersion.get("platform_version");
-                }
+                String prodVersion = CitrixHelper.getProductVersion(record);
                 String xenVersion = record.softwareVersion.get("xen");
                 String hostOS = record.softwareVersion.get("product_brand");
                 if (hostOS == null) {
@@ -409,7 +409,7 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer,
L
             return new XenServer600Resource();
         else if (prodBrand.equals("XenServer") && prodVersion.equals("6.1.0"))
             return new XenServer610Resource();
-        else if (prodBrand.equals("XenServer") && prodVersion.equals("6.4.94"))
+        else if (prodBrand.equals("XenServer") && prodVersion.equals("6.5.0"))
             return new Xenserver625Resource();
         else if (prodBrand.equals("XenServer") && prodVersion.equals("6.2.0")) {
             if (hotfix != null && hotfix.equals(XenserverConfigs.XSHotFix62ESP1004))
{
@@ -429,12 +429,14 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer,
L
             return new XcpOssResource();
         }
         String msg =
-                "Only support XCP 1.0.0, 1.1.0, 1.4.x, 1.5 beta, 1.6.x; XenServer 5.6,  XenServer
5.6 FP1, XenServer 5.6 SP2, Xenserver 6.0, 6.0.2, 6.1.0, 6.2.0 but this one is " +
+                "Only support XCP 1.0.0, 1.1.0, 1.4.x, 1.5 beta, 1.6.x; XenServer 5.6,  XenServer
5.6 FP1, XenServer 5.6 SP2, Xenserver 6.0, 6.0.2, 6.1.0, 6.2.0, 6.5.0 but this one is " +
                         prodBrand + " " + prodVersion;
         s_logger.warn(msg);
         throw new RuntimeException(msg);
     }
 
+
+
     protected CitrixResourceBase createServerResource(long dcId, Long podId, Host.Record
record, String hotfix) {
         String prodBrand = record.softwareVersion.get("product_brand");
         if (prodBrand == null) {
@@ -442,13 +444,8 @@ public class XcpServerDiscoverer extends DiscovererBase implements Discoverer,
L
         } else {
             prodBrand = prodBrand.trim();
         }
+        String prodVersion = CitrixHelper.getProductVersion(record);
 
-        String prodVersion = record.softwareVersion.get("product_version");
-        if (prodVersion == null) {
-            prodVersion = record.softwareVersion.get("platform_version").trim();
-        } else {
-            prodVersion = prodVersion.trim();
-        }
         String prodVersionTextShort = record.softwareVersion.get("product_version_text_short");
         return createServerResource(prodBrand, prodVersion, prodVersionTextShort, hotfix);
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b7f5e95c/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixHelper.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixHelper.java
b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixHelper.java
index e1891e9..5bc8036 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixHelper.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixHelper.java
@@ -21,6 +21,8 @@ import java.util.HashMap;
 
 import org.apache.log4j.Logger;
 
+import com.xensource.xenapi.Host;
+
 /**
  * Reduce bloat inside CitrixResourceBase
  *
@@ -229,5 +231,19 @@ public class CitrixHelper {
         return recommendedMaxMinMemory.getMin();
     }
 
-
+    public static String getProductVersion(Host.Record record) {
+        String prodVersion = record.softwareVersion.get("product_version");
+        if (prodVersion == null) {
+            prodVersion = record.softwareVersion.get("platform_version").trim();
+        } else {
+            prodVersion = prodVersion.trim();
+            String[] items = prodVersion.split("\\.");
+            if (Integer.parseInt(items[0]) > 6) {
+                prodVersion = "6.5.0";
+            } else if (Integer.parseInt(items[0]) == 6 && Integer.parseInt(items[1])
>= 4) {
+                prodVersion = "6.5.0";
+            }
+        }
+        return prodVersion;
+    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b7f5e95c/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
index 807d150..e391b3e 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/CitrixResourceBase.java
@@ -4239,12 +4239,7 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
                 break;
             }
             Host.Record hr = myself.getRecord(conn);
-            _host.productVersion = hr.softwareVersion.get("product_version");
-            if (_host.productVersion == null) {
-                _host.productVersion = hr.softwareVersion.get("platform_version");
-            } else {
-                _host.productVersion = _host.productVersion.trim();
-            }
+            _host.productVersion = CitrixHelper.getProductVersion(hr);
 
             XsLocalNetwork privateNic = getManagementNetwork(conn);
             _privateNetworkName = privateNic.getNetworkRecord(conn).nameLabel;
@@ -4300,6 +4295,7 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
                 }
             }
 
+            s_logger.info("XenServer Version is " + _host.productVersion + " for host " +
_host.ip);
             s_logger.info("Private Network is " + _privateNetworkName + " for host " + _host.ip);
             s_logger.info("Guest Network is " + _guestNetworkName + " for host " + _host.ip);
             s_logger.info("Public Network is " + _publicNetworkName + " for host " + _host.ip);


Mime
View raw message