cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From anthon...@apache.org
Subject [1/3] clean up XenServer resource code
Date Tue, 19 Aug 2014 00:35:18 GMT
Repository: cloudstack
Updated Branches:
  refs/heads/master 097b2d711 -> 81c5e184b


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/81c5e184/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 387c80b..807d150 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
@@ -1268,14 +1268,36 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
         return vbd;
     }
 
-    public long getStaticMax(String os, boolean b, long dynamicMinRam, long dynamicMaxRam)
{
-        return dynamicMaxRam;
+
+    private long getStaticMax(String os, boolean b, long dynamicMinRam, long dynamicMaxRam){
+        long recommendedValue = CitrixHelper.getXenServerStaticMax(os, b);
+        if(recommendedValue == 0){
+            s_logger.warn("No recommended value found for dynamic max, setting static max
and dynamic max equal");
+            return dynamicMaxRam;
+        }
+        long staticMax = Math.min(recommendedValue, 4l * dynamicMinRam);  // XS constraint
for stability
+        if (dynamicMaxRam > staticMax){ // XS contraint that dynamic max <= static
max
+            s_logger.warn("dynamixMax " + dynamicMaxRam + " cant be greater than static max
" + staticMax + ", can lead to stability issues. Setting static max as much as dynamic max
");
+            return dynamicMaxRam;
+        }
+        return staticMax;
     }
 
-    public long getStaticMin(String os, boolean b, long dynamicMinRam, long dynamicMaxRam)
{
+
+    private long getStaticMin(String os, boolean b, long dynamicMinRam, long dynamicMaxRam)
{
+        long recommendedValue = CitrixHelper.getXenServerStaticMin(os, b);
+        if (recommendedValue == 0) {
+            s_logger.warn("No recommended value found for dynamic min");
+            return dynamicMinRam;
+        }
+
+        if (dynamicMinRam < recommendedValue) {   // XS contraint that dynamic min >
static min
+            s_logger.warn("Vm is set to dynamixMin " + dynamicMinRam + " less than the recommended
static min " + recommendedValue + ", could lead to stability issues");
+        }
         return dynamicMinRam;
     }
 
+
     protected HashMap<String, HashMap<String, VgpuTypesInfo>> getGPUGroupDetails(Connection
conn) throws XenAPIException, XmlRpcException {
         return null;
     }
@@ -1286,6 +1308,9 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
     protected VM createVmFromTemplate(Connection conn, VirtualMachineTO vmSpec, Host host)
throws XenAPIException, XmlRpcException {
         String guestOsTypeName = getGuestOsType(vmSpec.getOs(), vmSpec.getPlatformEmulator(),
vmSpec.getBootloader() == BootloaderType.CD);
         Set<VM> templates = VM.getByNameLabel(conn, guestOsTypeName);
+        if ( templates == null || templates.isEmpty()) {
+            throw new CloudRuntimeException("Cannot find template " + guestOsTypeName + "
on XenServer host");
+        }
         assert templates.size() == 1 : "Should only have 1 template but found " + templates.size();
         VM template = templates.iterator().next();
 
@@ -6971,9 +6996,13 @@ public abstract class CitrixResourceBase implements ServerResource,
HypervisorRe
         }
     }
 
-    /*Override by subclass*/
+
     protected String getGuestOsType(String stdType, String platformEmulator, boolean bootFromCD)
{
-        return stdType;
+        if (platformEmulator == null) {
+            s_logger.debug("no guest OS type, start it as HVM guest");
+            platformEmulator = "Other install media";
+        }
+        return platformEmulator;
     }
 
     private Answer execute(NetworkRulesSystemVmCommand cmd) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/81c5e184/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XcpOssResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XcpOssResource.java
b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XcpOssResource.java
index 1c49a5b..1a6de1f 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XcpOssResource.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XcpOssResource.java
@@ -119,11 +119,7 @@ public class XcpOssResource extends CitrixResourceBase {
         } else if (stdType.equalsIgnoreCase("CentOS 5.6 (64-bit)")) {
             return "CentOS 5 (64-bit)";
         } else {
-            if (platformEmulator == null || platformEmulator.isEmpty()) {
-                s_logger.debug("Can't find the guest os: " + stdType + " mapping into XCP's
guestOS type, start it as HVM guest");
-                platformEmulator = "Other install media";
-            }
-            return platformEmulator;
+            return super.getGuestOsType(stdType, platformEmulator, bootFromCD);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/81c5e184/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XcpServer16Resource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XcpServer16Resource.java
b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XcpServer16Resource.java
deleted file mode 100644
index 3fcbcc4..0000000
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XcpServer16Resource.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package com.cloud.hypervisor.xenserver.resource;
-
-import org.apache.log4j.Logger;
-
-public class XcpServer16Resource extends XcpServerResource {
-    private final static Logger s_logger = Logger.getLogger(XcpServer16Resource.class);
-
-    public XcpServer16Resource() {
-        super();
-    }
-
-    @Override
-    protected String getGuestOsType(String stdType, String platformEmulator, boolean bootFromCD)
{
-        if (platformEmulator == null) {
-            s_logger.debug("Can't find the guest os: " + stdType + " mapping into XCP's guestOS
type, start it as HVM guest");
-            platformEmulator = "Other install media";
-        }
-        return platformEmulator;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/81c5e184/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XcpServerResource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XcpServerResource.java
b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XcpServerResource.java
index b4cc59b..782a530 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XcpServerResource.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XcpServerResource.java
@@ -70,15 +70,6 @@ public class XcpServerResource extends CitrixResourceBase {
         return files;
     }
 
-    @Override
-    protected String getGuestOsType(String stdType, String platformEmulator, boolean bootFromCD)
{
-        if (platformEmulator == null) {
-            s_logger.debug("Can't find the guest os: " + stdType + " mapping into XCP's guestOS
type, start it as HVM guest");
-            platformEmulator = "Other install media";
-        }
-        return platformEmulator;
-    }
-
     protected NetworkUsageAnswer execute(NetworkUsageCommand cmd) {
         try {
             Connection conn = getConnection();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/81c5e184/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer56FP1Resource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer56FP1Resource.java
b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer56FP1Resource.java
index 1a04f1f..a119f48 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer56FP1Resource.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer56FP1Resource.java
@@ -52,20 +52,6 @@ public class XenServer56FP1Resource extends XenServer56Resource {
     }
 
     @Override
-    protected String getGuestOsType(String stdType, String platformEmulator, boolean bootFromCD)
{
-        if (platformEmulator == null) {
-            if (!bootFromCD) {
-                s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer
5.6 FP1 guestOS type, start it as HVM guest");
-                platformEmulator = "Other install media";
-            } else {
-                String msg = "XenServer 5.6 FP1 DOES NOT support Guest OS type " + stdType;
-                s_logger.warn(msg);
-            }
-        }
-        return platformEmulator;
-    }
-
-    @Override
     protected List<File> getPatchFiles() {
         List<File> files = new ArrayList<File>();
         String patch = "scripts/vm/hypervisor/xenserver/xenserver56fp1/patch";
@@ -124,37 +110,6 @@ public class XenServer56FP1Resource extends XenServer56Resource {
         }
     }
 
-    @Override
-    public long getStaticMax(String os, boolean b, long dynamicMinRam, long dynamicMaxRam)
{
-        long recommendedValue = CitrixHelper.getXenServer56FP1StaticMax(os, b);
-        if (recommendedValue == 0) {
-            s_logger.warn("No recommended value found for dynamic max, setting static max
and dynamic max equal");
-            return dynamicMaxRam;
-        }
-
-        long staticMax = Math.min(recommendedValue, 4l * dynamicMinRam);  // XS constraint
for stability
-        if (dynamicMaxRam > staticMax) { // XS contraint that dynamic max <= static
max
-            s_logger.warn("dynamixMax " + dynamicMaxRam + " cant be greater than static max
" + staticMax +
-                ", can lead to stability issues. Setting static max as much as dynamic max
");
-            return dynamicMaxRam;
-        }
-        return staticMax;
-    }
-
-    @Override
-    public long getStaticMin(String os, boolean b, long dynamicMinRam, long dynamicMaxRam)
{
-        long recommendedValue = CitrixHelper.getXenServer56FP1StaticMin(os, b);
-        if (recommendedValue == 0) {
-            s_logger.warn("No recommended value found for dynamic min");
-            return dynamicMinRam;
-        }
-
-        if (dynamicMinRam < recommendedValue) {   // XS contraint that dynamic min >
static min
-            s_logger.warn("Vm is set to dynamixMin " + dynamicMinRam + " less than the recommended
static min " + recommendedValue + ", could lead to stability issues.");
-        }
-        return dynamicMinRam;
-    }
-
     /**
      * When Dynamic Memory Control (DMC) is enabled -
      * xenserver allows scaling the guest memory while the guest is running

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/81c5e184/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer56Resource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer56Resource.java
b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer56Resource.java
index 6f3537d..eec972e 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer56Resource.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer56Resource.java
@@ -65,19 +65,6 @@ public class XenServer56Resource extends CitrixResourceBase {
         }
     }
 
-    @Override
-    protected String getGuestOsType(String stdType, String platformEmulator, boolean bootFromCD)
{
-        if (platformEmulator == null) {
-            if (!bootFromCD) {
-                s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer
5.6 guestOS type, start it as HVM guest");
-                platformEmulator = "Other install media";
-            } else {
-                String msg = "XenServer 5.6 doesn't support Guest OS type " + stdType;
-                s_logger.warn(msg);
-            }
-        }
-        return platformEmulator;
-    }
 
     @Override
     protected List<File> getPatchFiles() {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/81c5e184/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer56SP2Resource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer56SP2Resource.java
b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer56SP2Resource.java
index 563f9c3..c0d6f00 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer56SP2Resource.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer56SP2Resource.java
@@ -39,20 +39,6 @@ public class XenServer56SP2Resource extends XenServer56FP1Resource {
     }
 
     @Override
-    protected String getGuestOsType(String stdType, String platformEmulator, boolean bootFromCD)
{
-        if (platformEmulator == null) {
-            if (!bootFromCD) {
-                s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer
5.6 SP2 guestOS type, start it as HVM guest");
-                platformEmulator = "Other install media";
-            } else {
-                String msg = "XenServer 5.6 SP2 DOES NOT support Guest OS type " + stdType;
-                s_logger.warn(msg);
-            }
-        }
-        return platformEmulator;
-    }
-
-    @Override
     protected List<File> getPatchFiles() {
         List<File> files = new ArrayList<File>();
         String patch = "scripts/vm/hypervisor/xenserver/xenserver56fp1/patch";
@@ -64,35 +50,4 @@ public class XenServer56SP2Resource extends XenServer56FP1Resource {
         files.add(file);
         return files;
     }
-
-    @Override
-    public long getStaticMax(String os, boolean b, long dynamicMinRam, long dynamicMaxRam)
{
-        long recommendedValue = CitrixHelper.getXenServer56SP2StaticMax(os, b);
-        if (recommendedValue == 0) {
-            s_logger.warn("No recommended value found for dynamic max, setting static max
and dynamic max equal");
-            return dynamicMaxRam;
-        }
-        long staticMax = Math.min(recommendedValue, 4l * dynamicMinRam);  // XS constraint
for stability
-        if (dynamicMaxRam > staticMax) { // XS contraint that dynamic max <= static
max
-            s_logger.warn("dynamixMax " + dynamicMaxRam + " cant be greater than static max
" + staticMax +
-                ", can lead to stability issues. Setting static max as much as dynamic max
");
-            return dynamicMaxRam;
-        }
-        return staticMax;
-    }
-
-    @Override
-    public long getStaticMin(String os, boolean b, long dynamicMinRam, long dynamicMaxRam)
{
-        long recommendedValue = CitrixHelper.getXenServer56SP2StaticMin(os, b);
-        if (recommendedValue == 0) {
-            s_logger.warn("No recommended value found for dynamic min");
-            return dynamicMinRam;
-        }
-
-        if (dynamicMinRam < recommendedValue) {   // XS contraint that dynamic min >
static min
-            s_logger.warn("Vm is set to dynamixMin " + dynamicMinRam + " less than the recommended
static min " + recommendedValue + ", could lead to stability issues");
-        }
-        return dynamicMinRam;
-    }
-
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/81c5e184/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer600Resource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer600Resource.java
b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer600Resource.java
index 4d7fc8b..037ded3 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer600Resource.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer600Resource.java
@@ -37,50 +37,6 @@ public class XenServer600Resource extends XenServer56SP2Resource {
     }
 
     @Override
-    protected String getGuestOsType(String stdType, String platformEmulator, boolean bootFromCD)
{
-        if (platformEmulator == null) {
-            if (!bootFromCD) {
-                s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer
6.0.0 guestOS type, start it as HVM guest");
-                platformEmulator = "Other install media";
-            } else {
-                String msg = "XenServer 6.0.0 DOES NOT support Guest OS type " + stdType;
-                s_logger.warn(msg);
-            }
-        }
-        return platformEmulator;
-    }
-
-    @Override
-    public long getStaticMax(String os, boolean b, long dynamicMinRam, long dynamicMaxRam)
{
-        long recommendedValue = CitrixHelper.getXenServer600StaticMax(os, b);
-        if (recommendedValue == 0) {
-            s_logger.warn("No recommended value found for dynamic max, setting static max
and dynamic max equal");
-            return dynamicMaxRam;
-        }
-        long staticMax = Math.min(recommendedValue, 4l * dynamicMinRam);  // XS constraint
for stability
-        if (dynamicMaxRam > staticMax) { // XS contraint that dynamic max <= static
max
-            s_logger.warn("dynamixMax " + dynamicMaxRam + " cant be greater than static max
" + staticMax +
-                ", can lead to stability issues. Setting static max as much as dynamic max
");
-            return dynamicMaxRam;
-        }
-        return staticMax;
-    }
-
-    @Override
-    public long getStaticMin(String os, boolean b, long dynamicMinRam, long dynamicMaxRam)
{
-        long recommendedValue = CitrixHelper.getXenServer600StaticMin(os, b);
-        if (recommendedValue == 0) {
-            s_logger.warn("No recommended value found for dynamic min");
-            return dynamicMinRam;
-        }
-
-        if (dynamicMinRam < recommendedValue) {   // XS contraint that dynamic min >
static min
-            s_logger.warn("Vm is set to dynamixMin " + dynamicMinRam + " less than the recommended
static min " + recommendedValue + ", could lead to stability issues");
-        }
-        return dynamicMinRam;
-    }
-
-    @Override
     protected List<File> getPatchFiles() {
         List<File> files = new ArrayList<File>();
         String patch = "scripts/vm/hypervisor/xenserver/xenserver60/patch";

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/81c5e184/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer602Resource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer602Resource.java
b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer602Resource.java
deleted file mode 100644
index 042599a..0000000
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer602Resource.java
+++ /dev/null
@@ -1,75 +0,0 @@
-// Licensed to the Apache Software Foundation (ASF) under one
-// or more contributor license agreements.  See the NOTICE file
-// distributed with this work for additional information
-// regarding copyright ownership.  The ASF licenses this file
-// to you under the Apache License, Version 2.0 (the
-// "License"); you may not use this file except in compliance
-// with the License.  You may obtain a copy of the License at
-//
-//   http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing,
-// software distributed under the License is distributed on an
-// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-// KIND, either express or implied.  See the License for the
-// specific language governing permissions and limitations
-// under the License.
-package com.cloud.hypervisor.xenserver.resource;
-import javax.ejb.Local;
-
-import org.apache.log4j.Logger;
-
-import com.cloud.resource.ServerResource;
-
-@Local(value = ServerResource.class)
-public class XenServer602Resource extends XenServer600Resource {
-    private static final Logger s_logger = Logger.getLogger(XenServer602Resource.class);
-
-    public XenServer602Resource() {
-        super();
-    }
-
-    @Override
-    protected String getGuestOsType(String stdType, String platformEmulator, boolean bootFromCD)
{
-        if (platformEmulator == null) {
-            if (!bootFromCD) {
-                s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer
6.0.2 guestOS type, start it as HVM guest");
-                platformEmulator = "Other install media";
-            } else {
-                String msg = "XenServer 6.0.2 DOES NOT support Guest OS type " + stdType;
-                s_logger.warn(msg);
-            }
-        }
-        return platformEmulator;
-    }
-
-    @Override
-    public long getStaticMax(String os, boolean b, long dynamicMinRam, long dynamicMaxRam)
{
-        long recommendedValue = CitrixHelper.getXenServer602StaticMax(os, b);
-        if (recommendedValue == 0) {
-            s_logger.warn("No recommended value found for dynamic max, setting static max
and dynamic max equal");
-            return dynamicMaxRam;
-        }
-        long staticMax = Math.min(recommendedValue, 4l * dynamicMinRam);  // XS constraint
for stability
-        if (dynamicMaxRam > staticMax) { // XS contraint that dynamic max <= static
max
-            s_logger.warn("dynamixMax " + dynamicMaxRam + " cant be greater than static max
" + staticMax +
-                ", can lead to stability issues. Setting static max as much as dynamic max
");
-            return dynamicMaxRam;
-        }
-        return staticMax;
-    }
-
-    @Override
-    public long getStaticMin(String os, boolean b, long dynamicMinRam, long dynamicMaxRam)
{
-        long recommendedValue = CitrixHelper.getXenServer602StaticMin(os, b);
-        if (recommendedValue == 0) {
-            s_logger.warn("No recommended value found for dynamic min");
-            return dynamicMinRam;
-        }
-        if (dynamicMinRam < recommendedValue) {   // XS contraint that dynamic min >
static min
-            s_logger.warn("Vm is set to dynamixMin " + dynamicMinRam + " less than the recommended
static min " + recommendedValue + ", could lead to stability issues");
-        }
-        return dynamicMinRam;
-    }
-
-}

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/81c5e184/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer610Resource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer610Resource.java
b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer610Resource.java
index c4a0056..5e3f95c 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer610Resource.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer610Resource.java
@@ -64,7 +64,7 @@ import com.cloud.storage.Volume;
 import com.cloud.utils.exception.CloudRuntimeException;
 
 @Local(value = ServerResource.class)
-public class XenServer610Resource extends XenServer602Resource {
+public class XenServer610Resource extends XenServer600Resource {
     private static final Logger s_logger = Logger.getLogger(XenServer610Resource.class);
 
     public XenServer610Resource() {
@@ -72,20 +72,6 @@ public class XenServer610Resource extends XenServer602Resource {
     }
 
     @Override
-    protected String getGuestOsType(String stdType, String platformEmulator, boolean bootFromCD)
{
-        if (platformEmulator == null) {
-            if (!bootFromCD) {
-                s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer
6.1.0 guestOS type, start it as HVM guest");
-                platformEmulator = "Other install media";
-            } else {
-                String msg = "XenServer 6.1.0 DOES NOT support Guest OS type " + stdType;
-                s_logger.warn(msg);
-            }
-        }
-        return platformEmulator;
-    }
-
-    @Override
     public Answer executeRequest(Command cmd) {
         if (cmd instanceof MigrateWithStorageCommand) {
             return execute((MigrateWithStorageCommand)cmd);
@@ -379,36 +365,6 @@ public class XenServer610Resource extends XenServer602Resource {
     }
 
     @Override
-    public long getStaticMax(String os, boolean b, long dynamicMinRam, long dynamicMaxRam)
{
-        long recommendedValue = CitrixHelper.getXenServer610StaticMax(os, b);
-        if (recommendedValue == 0) {
-            s_logger.warn("No recommended value found for dynamic max, setting static max
and dynamic max equal");
-            return dynamicMaxRam;
-        }
-        long staticMax = Math.min(recommendedValue, 4l * dynamicMinRam);  // XS constraint
for stability
-        if (dynamicMaxRam > staticMax) { // XS contraint that dynamic max <= static
max
-            s_logger.warn("dynamixMax " + dynamicMaxRam + " cant be greater than static max
" + staticMax +
-                ", can lead to stability issues. Setting static max as much as dynamic max
");
-            return dynamicMaxRam;
-        }
-        return staticMax;
-    }
-
-    @Override
-    public long getStaticMin(String os, boolean b, long dynamicMinRam, long dynamicMaxRam)
{
-        long recommendedValue = CitrixHelper.getXenServer610StaticMin(os, b);
-        if (recommendedValue == 0) {
-            s_logger.warn("No recommended value found for dynamic min");
-            return dynamicMinRam;
-        }
-
-        if (dynamicMinRam < recommendedValue) {   // XS contraint that dynamic min >
static min
-            s_logger.warn("Vm is set to dynamixMin " + dynamicMinRam + " less than the recommended
static min " + recommendedValue + ", could lead to stability issues");
-        }
-        return dynamicMinRam;
-    }
-
-    @Override
     protected void plugDom0Vif(Connection conn, VIF dom0Vif) throws XmlRpcException, XenAPIException
{
         // do nothing. In xenserver 6.1 and beyond this step isn't needed.
     }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/81c5e184/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer620Resource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer620Resource.java
b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer620Resource.java
index 4b43023..ecc3089 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer620Resource.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer620Resource.java
@@ -40,49 +40,6 @@ public class XenServer620Resource extends XenServer610Resource {
         super();
     }
 
-    @Override
-    protected String getGuestOsType(String stdType, String platformEmulator, boolean bootFromCD)
{
-        if (platformEmulator == null) {
-            if (!bootFromCD) {
-                s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer
6.2.0 guestOS type, start it as HVM guest");
-                platformEmulator = "Other install media";
-            } else {
-                String msg = "XenServer 6.2.0 DOES NOT support Guest OS type " + stdType;
-                s_logger.warn(msg);
-            }
-        }
-        return platformEmulator;
-    }
-
-    @Override
-    public long getStaticMax(String os, boolean b, long dynamicMinRam, long dynamicMaxRam)
{
-        long recommendedValue = CitrixHelper.getXenServer620StaticMax(os, b);
-        if (recommendedValue == 0) {
-            s_logger.warn("No recommended value found for dynamic max, setting static max
and dynamic max equal");
-            return dynamicMaxRam;
-        }
-        long staticMax = Math.min(recommendedValue, 4l * dynamicMinRam);  // XS constraint
for stability
-        if (dynamicMaxRam > staticMax) { // XS contraint that dynamic max <= static
max
-            s_logger.warn("dynamixMax " + dynamicMaxRam + " cant be greater than static max
" + staticMax +
-                ", can lead to stability issues. Setting static max as much as dynamic max
");
-            return dynamicMaxRam;
-        }
-        return staticMax;
-    }
-
-    @Override
-    public long getStaticMin(String os, boolean b, long dynamicMinRam, long dynamicMaxRam)
{
-        long recommendedValue = CitrixHelper.getXenServer620StaticMin(os, b);
-        if (recommendedValue == 0) {
-            s_logger.warn("No recommended value found for dynamic min");
-            return dynamicMinRam;
-        }
-
-        if (dynamicMinRam < recommendedValue) {   // XS contraint that dynamic min >
static min
-            s_logger.warn("Vm is set to dynamixMin " + dynamicMinRam + " less than the recommended
static min " + recommendedValue + ", could lead to stability issues");
-        }
-        return dynamicMinRam;
-    }
 
     protected boolean hostHasHotFix(Connection conn, String hotFixUuid) {
         try {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/81c5e184/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer620SP1Resource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer620SP1Resource.java
b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer620SP1Resource.java
index 8e23764..88e4600 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer620SP1Resource.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/XenServer620SP1Resource.java
@@ -164,46 +164,4 @@ public class XenServer620SP1Resource extends XenServer620Resource {
         cmd.getVirtualMachine().getGpuDevice().setGroupDetails(getGPUGroupDetails(conn));
     }
 
-    @Override
-    protected String getGuestOsType(String stdType, String platformEmulator, boolean bootFromCD)
{
-        if (platformEmulator == null) {
-            if (!bootFromCD) {
-                s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer
6.2.0 guestOS type, start it as HVM guest");
-                platformEmulator = "Other install media";
-            } else {
-                String msg = "XenServer 6.2.0 DOES NOT support Guest OS type " + stdType;
-                s_logger.warn(msg);
-            }
-        }
-        return platformEmulator;
-    }
-
-    @Override
-    public long getStaticMax(String os, boolean b, long dynamicMinRam, long dynamicMaxRam){
-        long recommendedValue = CitrixHelper.getXenServer620SP1StaticMax(os, b);
-        if(recommendedValue == 0){
-            s_logger.warn("No recommended value found for dynamic max, setting static max
and dynamic max equal");
-            return dynamicMaxRam;
-        }
-        long staticMax = Math.min(recommendedValue, 4l * dynamicMinRam);  // XS constraint
for stability
-        if (dynamicMaxRam > staticMax){ // XS contraint that dynamic max <= static
max
-            s_logger.warn("dynamixMax " + dynamicMaxRam + " cant be greater than static max
" + staticMax + ", can lead to stability issues. Setting static max as much as dynamic max
");
-            return dynamicMaxRam;
-        }
-        return staticMax;
-    }
-
-    @Override
-    public long getStaticMin(String os, boolean b, long dynamicMinRam, long dynamicMaxRam){
-        long recommendedValue = CitrixHelper.getXenServer620SP1StaticMin(os, b);
-        if(recommendedValue == 0){
-            s_logger.warn("No recommended value found for dynamic min");
-            return dynamicMinRam;
-        }
-
-        if(dynamicMinRam < recommendedValue){   // XS contraint that dynamic min >
static min
-            s_logger.warn("Vm is set to dynamixMin " + dynamicMinRam + " less than the recommended
static min " + recommendedValue + ", could lead to stability issues");
-        }
-        return dynamicMinRam;
-    }
 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/81c5e184/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/Xenserver625Resource.java
----------------------------------------------------------------------
diff --git a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/Xenserver625Resource.java
b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/Xenserver625Resource.java
index de108e4..c10844e 100644
--- a/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/Xenserver625Resource.java
+++ b/plugins/hypervisors/xenserver/src/com/cloud/hypervisor/xenserver/resource/Xenserver625Resource.java
@@ -50,20 +50,6 @@ public class Xenserver625Resource extends XenServerResourceNewBase {
     }
 
     @Override
-    protected String getGuestOsType(String stdType, String platformEmulator, boolean bootFromCD)
{
-        if (platformEmulator == null) {
-            if (!bootFromCD) {
-                s_logger.debug("Can't find the guest os: " + stdType + " mapping into XenServer
6.2.5 guestOS type, start it as HVM guest");
-                platformEmulator = "Other install media";
-            } else {
-                String msg = "XenServer 6.2.5 DOES NOT support Guest OS type " + stdType;
-                s_logger.warn(msg);
-            }
-        }
-        return platformEmulator;
-    }
-
-    @Override
     protected List<File> getPatchFiles() {
         List<File> files = new ArrayList<File>();
         String patch = "scripts/vm/hypervisor/xenserver/xenserver62/patch";
@@ -77,35 +63,6 @@ public class Xenserver625Resource extends XenServerResourceNewBase {
     }
 
     @Override
-    public long getStaticMax(String os, boolean b, long dynamicMinRam, long dynamicMaxRam){
-        long recommendedValue = CitrixHelper.getXenServer625StaticMax(os, b);
-        if(recommendedValue == 0){
-            s_logger.warn("No recommended value found for dynamic max, setting static max
and dynamic max equal");
-            return dynamicMaxRam;
-        }
-        long staticMax = Math.min(recommendedValue, 4l * dynamicMinRam);  // XS constraint
for stability
-        if (dynamicMaxRam > staticMax){ // XS contraint that dynamic max <= static
max
-            s_logger.warn("dynamixMax " + dynamicMaxRam + " cant be greater than static max
" + staticMax + ", can lead to stability issues. Setting static max as much as dynamic max
");
-            return dynamicMaxRam;
-        }
-        return staticMax;
-    }
-
-    @Override
-    public long getStaticMin(String os, boolean b, long dynamicMinRam, long dynamicMaxRam){
-        long recommendedValue = CitrixHelper.getXenServer625StaticMin(os, b);
-        if(recommendedValue == 0){
-            s_logger.warn("No recommended value found for dynamic min");
-            return dynamicMinRam;
-        }
-
-        if(dynamicMinRam < recommendedValue){   // XS contraint that dynamic min >
static min
-            s_logger.warn("Vm is set to dynamixMin " + dynamicMinRam + " less than the recommended
static min " + recommendedValue + ", could lead to stability issues");
-        }
-        return dynamicMinRam;
-    }
-
-    @Override
     protected StorageSubsystemCommandHandler getStorageHandler() {
         XenServerStorageProcessor processor = new Xenserver625StorageProcessor(this);
         return new StorageSubsystemCommandHandlerBase(processor);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/81c5e184/setup/db/db/schema-441to450.sql
----------------------------------------------------------------------
diff --git a/setup/db/db/schema-441to450.sql b/setup/db/db/schema-441to450.sql
index e6aae8e..0840741 100644
--- a/setup/db/db/schema-441to450.sql
+++ b/setup/db/db/schema-441to450.sql
@@ -549,7 +549,7 @@ CREATE VIEW `cloud`.`domain_router_view` AS
 
 
 INSERT IGNORE INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (231,
UUID(), 1, 'CentOS 5.10 (32-bit)');
-INSERT IGNORE INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (232,
UUID(), 1, 'CentOS 5.10 (32-bit)');
+INSERT IGNORE INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (232,
UUID(), 1, 'CentOS 5.10 (64-bit)');
 INSERT IGNORE INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (233,
UUID(), 3, 'Oracle Enterprise Linux 5.10 (32-bit)');
 INSERT IGNORE INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (234,
UUID(), 3, 'Oracle Enterprise Linux 5.10 (64-bit)');
 INSERT IGNORE INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (235,
UUID(), 3, 'Oracle Enterprise Linux 6.5 (32-bit)');
@@ -563,6 +563,7 @@ INSERT IGNORE INTO `cloud`.`guest_os` (id, uuid, category_id, display_name)
VALU
 INSERT IGNORE INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (242,
UUID(), 10, 'Ubuntu 14.04 (64-bit)');
 INSERT IGNORE INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (243,
UUID(), 5, 'SUSE Linux Enterprise Server 12 (32-bit)');
 INSERT IGNORE INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (244,
UUID(), 5, 'SUSE Linux Enterprise Server 12 (64-bit)');
+INSERT IGNORE INTO `cloud`.`guest_os` (id, uuid, category_id, display_name) VALUES (245,
UUID(), 4, 'Red Hat Enterprise Linux 7.0');
 
 INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version,
guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'Xenserver', '6.4.94',
'CentOS 4.5 (32-bit)', 1, now(), 0);
 INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version,
guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'Xenserver', '6.4.94',
'CentOS 4.6 (32-bit)', 2, now(), 0);
@@ -680,6 +681,7 @@ INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type,
hypervis
 INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version,
guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'Xenserver', '6.4.94',
'Red Hat Enterprise Linux 6 (64-bit)', 206, now(), 0);
 INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version,
guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'Xenserver', '6.4.94',
'Red Hat Enterprise Linux 6 (32-bit)', 239, now(), 0);
 INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version,
guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'Xenserver', '6.4.94',
'Red Hat Enterprise Linux 6 (64-bit)', 240, now(), 0);
+INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version,
guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'Xenserver', '6.4.94',
'Red Hat Enterprise Linux 7', 245, now(), 0);
 INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version,
guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'Xenserver', '6.4.94',
'SUSE Linux Enterprise Server 10 SP1 (32-bit)', 41, now(), 0);
 INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version,
guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'Xenserver', '6.4.94',
'SUSE Linux Enterprise Server 10 SP1 (64-bit)', 42, now(), 0);
 INSERT IGNORE INTO `cloud`.`guest_os_hypervisor` (uuid,hypervisor_type, hypervisor_version,
guest_os_name, guest_os_id, created, is_user_defined) VALUES (UUID(),'Xenserver', '6.4.94',
'SUSE Linux Enterprise Server 10 SP2 (32-bit)', 43, now(), 0);


Mime
View raw message