cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prachida...@apache.org
Subject git commit: updated refs/heads/planner_reserve to 0d23cd3
Date Thu, 16 May 2013 20:42:22 GMT
Updated Branches:
  refs/heads/planner_reserve db4f335c8 -> 0d23cd3c9


If hypervisortype is baremetal, need to make sure we choose the correct planner


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

Branch: refs/heads/planner_reserve
Commit: 0d23cd3c9e94dec2388d8fdcb7c0b5d0f5abc695
Parents: db4f335
Author: Prachi Damle <prachi@cloud.com>
Authored: Thu May 16 13:40:44 2013 -0700
Committer: Prachi Damle <prachi@cloud.com>
Committed: Thu May 16 13:40:44 2013 -0700

----------------------------------------------------------------------
 .../deploy/DeploymentPlanningManagerImpl.java      |    6 ++++-
 server/src/com/cloud/deploy/FirstFitPlanner.java   |   16 ++++++++------
 server/src/com/cloud/vm/UserVmManagerImpl.java     |   12 +++++++---
 3 files changed, 22 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0d23cd3c/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
index b64148d..62a175a 100644
--- a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
+++ b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
@@ -223,7 +223,11 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements
Deploy
         ServiceOffering offering = vmProfile.getServiceOffering();
         String plannerName = offering.getDeploymentPlanner();
         if (plannerName == null) {
-            plannerName = _configDao.getValue(Config.VmDeploymentPlanner.key());
+            if (vm.getHypervisorType() != HypervisorType.BareMetal) {
+                plannerName = "BareMetalPlanner";
+            } else {
+                plannerName = _configDao.getValue(Config.VmDeploymentPlanner.key());
+            }
         }
         DeploymentPlanner planner = null;
         for (DeploymentPlanner plannerInList : _planners) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0d23cd3c/server/src/com/cloud/deploy/FirstFitPlanner.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/deploy/FirstFitPlanner.java b/server/src/com/cloud/deploy/FirstFitPlanner.java
index f4dbca5..caf8c6e 100755
--- a/server/src/com/cloud/deploy/FirstFitPlanner.java
+++ b/server/src/com/cloud/deploy/FirstFitPlanner.java
@@ -486,13 +486,15 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentClusterPla
     public boolean canHandle(VirtualMachineProfile<? extends VirtualMachine> vm, DeploymentPlan
plan, ExcludeList avoid) {
         // check what the ServiceOffering says. If null, check the global config
         ServiceOffering offering = vm.getServiceOffering();
-        if (offering != null && offering.getDeploymentPlanner() != null) {
-            if (offering.getDeploymentPlanner().equals(this.getName())) {
-                return true;
-            }
-        } else {
-            if (_globalDeploymentPlanner != null && _globalDeploymentPlanner.equals(this._name))
{
-                return true;
+        if (vm.getHypervisorType() != HypervisorType.BareMetal) {
+            if (offering != null && offering.getDeploymentPlanner() != null) {
+                if (offering.getDeploymentPlanner().equals(this.getName())) {
+                    return true;
+                }
+            } else {
+                if (_globalDeploymentPlanner != null && _globalDeploymentPlanner.equals(this._name))
{
+                    return true;
+                }
             }
         }
         return false;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/0d23cd3c/server/src/com/cloud/vm/UserVmManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/UserVmManagerImpl.java b/server/src/com/cloud/vm/UserVmManagerImpl.java
index 72d483e..ed1ce5f 100755
--- a/server/src/com/cloud/vm/UserVmManagerImpl.java
+++ b/server/src/com/cloud/vm/UserVmManagerImpl.java
@@ -2832,7 +2832,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Use
         }
         return result;
     }
-    
+
     @Override
     public boolean finalizeDeployment(Commands cmds,
             VirtualMachineProfile<UserVmVO> profile, DeployDestination dest,
@@ -3029,7 +3029,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Use
                                 + " stop due to exception ", ex);
             }
         }
-        
+
         VMInstanceVO vm = profile.getVirtualMachine();
         List<NicVO> nics = _nicDao.listByVmId(vm.getId());
         for (NicVO nic : nics) {
@@ -3171,7 +3171,11 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Use
         ServiceOfferingVO offering = _serviceOfferingDao.findByIdIncludingRemoved(vm.getServiceOfferingId());
         String plannerName = offering.getDeploymentPlanner();
         if (plannerName == null) {
-            plannerName = _configDao.getValue(Config.VmDeploymentPlanner.key());
+            if (vm.getHypervisorType() != HypervisorType.BareMetal) {
+                plannerName = "BareMetalPlanner";
+            } else {
+                plannerName = _configDao.getValue(Config.VmDeploymentPlanner.key());
+            }
         }
 
         String reservationId = vmEntity.reserve(plannerName, plan, new ExcludeList(), new
Long(callerUser.getId()).toString());
@@ -3815,7 +3819,7 @@ public class UserVmManagerImpl extends ManagerBase implements UserVmManager,
Use
                     + cmd.getAccountName() + " is disabled.");
         }
 
-        //check caller has access to both the old and new account 
+        //check caller has access to both the old and new account
         _accountMgr.checkAccess(caller, null, true, oldAccount);
         _accountMgr.checkAccess(caller, null, true, newAccount);
 


Mime
View raw message