cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ni...@apache.org
Subject git commit: updated refs/heads/4.3 to dc0f8eb
Date Wed, 18 Dec 2013 02:34:55 GMT
Updated Branches:
  refs/heads/4.3 ed2125ec3 -> dc0f8ebdf


CLOUDSTACK-4941:
During HA call different planners which skip some heurestics


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

Branch: refs/heads/4.3
Commit: dc0f8ebdf12dde8ecdec971a992a8991bf1298c4
Parents: ed2125e
Author: Nitin Mehta <nitin.mehta@citrix.com>
Authored: Tue Dec 17 18:32:46 2013 -0800
Committer: Nitin Mehta <nitin.mehta@citrix.com>
Committed: Tue Dec 17 18:32:46 2013 -0800

----------------------------------------------------------------------
 api/src/com/cloud/deploy/HAPlanner.java         | 21 +++++++
 client/pom.xml                                  |  5 ++
 .../core/spring-core-registry-core-context.xml  |  5 ++
 ...re-lifecycle-planner-context-inheritable.xml |  5 ++
 .../src/com/cloud/vm/VirtualMachineManager.java |  9 ++-
 .../cloud/deploy/DeploymentPlanningManager.java |  2 +-
 .../com/cloud/vm/VirtualMachineManagerImpl.java | 27 +++++----
 .../cloud/entity/api/VMEntityManagerImpl.java   |  2 +-
 plugins/ha-planners/skip-heurestics/pom.xml     | 29 ++++++++++
 .../skip-heurestics/module.properties           | 18 ++++++
 .../spring-skip-heurestics-context.xml          | 26 +++++++++
 .../com/cloud/deploy/SkipHeuresticsPlanner.java | 61 ++++++++++++++++++++
 plugins/pom.xml                                 |  1 +
 .../spring-server-core-managers-context.xml     |  1 +
 .../consoleproxy/ConsoleProxyManagerImpl.java   |  2 +-
 .../deploy/DeploymentPlanningManagerImpl.java   | 28 ++++-----
 .../src/com/cloud/deploy/FirstFitPlanner.java   |  9 ++-
 .../cloud/ha/HighAvailabilityManagerImpl.java   | 37 ++++++++++--
 .../VirtualNetworkApplianceManagerImpl.java     |  6 +-
 .../storage/StoragePoolAutomationImpl.java      | 14 ++---
 .../secondary/SecondaryStorageManagerImpl.java  |  2 +-
 .../vm/snapshot/VMSnapshotManagerImpl.java      |  2 +-
 .../vm/DeploymentPlanningManagerImplTest.java   | 24 ++++----
 23 files changed, 275 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc0f8ebd/api/src/com/cloud/deploy/HAPlanner.java
----------------------------------------------------------------------
diff --git a/api/src/com/cloud/deploy/HAPlanner.java b/api/src/com/cloud/deploy/HAPlanner.java
new file mode 100644
index 0000000..aeb5083
--- /dev/null
+++ b/api/src/com/cloud/deploy/HAPlanner.java
@@ -0,0 +1,21 @@
+// 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.deploy;
+
+
+public interface HAPlanner extends DeploymentPlanner {
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc0f8ebd/client/pom.xml
----------------------------------------------------------------------
diff --git a/client/pom.xml b/client/pom.xml
index a15a409..0bff438 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -177,6 +177,11 @@
       <version>${project.version}</version>
     </dependency>
     <dependency>
+       <groupId>org.apache.cloudstack</groupId>
+       <artifactId>cloud-plugin-planner-skip-heurestics</artifactId>
+       <version>${project.version}</version>
+    </dependency>
+    <dependency>
       <groupId>org.apache.cloudstack</groupId>
       <artifactId>cloud-plugin-planner-user-concentrated-pod</artifactId>
       <version>${project.version}</version>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc0f8ebd/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml
b/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml
index be11a1f..5e799c0 100644
--- a/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml
+++ b/core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml
@@ -77,6 +77,11 @@
         <property name="excludeKey" value="deployment.planners.exclude" />
     </bean>
 
+    <bean id="haPlannersRegistry"
+          class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
+        <property name="excludeKey" value="ha.planners.exclude" />
+    </bean>
+
     <bean id="podAllocatorsRegistry"
         class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
         <property name="excludeKey" value="pod.allocators.exclude" />

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc0f8ebd/core/resources/META-INF/cloudstack/planner/spring-core-lifecycle-planner-context-inheritable.xml
----------------------------------------------------------------------
diff --git a/core/resources/META-INF/cloudstack/planner/spring-core-lifecycle-planner-context-inheritable.xml
b/core/resources/META-INF/cloudstack/planner/spring-core-lifecycle-planner-context-inheritable.xml
index 715f86d..80779e4 100644
--- a/core/resources/META-INF/cloudstack/planner/spring-core-lifecycle-planner-context-inheritable.xml
+++ b/core/resources/META-INF/cloudstack/planner/spring-core-lifecycle-planner-context-inheritable.xml
@@ -38,4 +38,9 @@
             value="org.apache.cloudstack.affinity.AffinityGroupProcessor" />
     </bean>
 
+    <bean class="org.apache.cloudstack.spring.lifecycle.registry.RegistryLifecycle">
+        <property name="registry" ref="haPlannersRegistry" />
+        <property name="typeClass" value="com.cloud.deploy.HAPlanner" />
+    </bean>
+
 </beans>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc0f8ebd/engine/api/src/com/cloud/vm/VirtualMachineManager.java
----------------------------------------------------------------------
diff --git a/engine/api/src/com/cloud/vm/VirtualMachineManager.java b/engine/api/src/com/cloud/vm/VirtualMachineManager.java
index 30991fe..d182126 100644
--- a/engine/api/src/com/cloud/vm/VirtualMachineManager.java
+++ b/engine/api/src/com/cloud/vm/VirtualMachineManager.java
@@ -103,19 +103,22 @@ public interface VirtualMachineManager extends Manager {
 
     boolean stateTransitTo(VirtualMachine vm, VirtualMachine.Event e, Long hostId) throws
NoTransitionException;
 
-    void advanceStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params)
throws InsufficientCapacityException, ResourceUnavailableException,
+    void advanceStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params,
DeploymentPlanner planner) throws InsufficientCapacityException, ResourceUnavailableException,
             ConcurrentOperationException, OperationTimedoutException;
 
-    void advanceStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params,
DeploymentPlan planToDeploy) throws InsufficientCapacityException,
+    void advanceStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params,
DeploymentPlan planToDeploy, DeploymentPlanner planner) throws InsufficientCapacityException,
             ResourceUnavailableException, ConcurrentOperationException, OperationTimedoutException;
 
+    void orchestrateStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params,
DeploymentPlan planToDeploy, DeploymentPlanner planner) throws InsufficientCapacityException,
+    	ResourceUnavailableException, ConcurrentOperationException, OperationTimedoutException;
+
     void advanceStop(String vmUuid, boolean cleanupEvenIfUnableToStop) throws ResourceUnavailableException,
OperationTimedoutException, ConcurrentOperationException;
 
     void advanceExpunge(String vmUuid) throws ResourceUnavailableException, OperationTimedoutException,
ConcurrentOperationException;
 
     void destroy(String vmUuid) throws AgentUnavailableException, OperationTimedoutException,
ConcurrentOperationException;
 
-    void migrateAway(String vmUuid, long hostId) throws InsufficientServerCapacityException;
+    void migrateAway(String vmUuid, long hostId, DeploymentPlanner planner) throws InsufficientServerCapacityException;
 
     void migrate(String vmUuid, long srcHostId, DeployDestination dest) throws ResourceUnavailableException,
ConcurrentOperationException;
     

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc0f8ebd/engine/components-api/src/com/cloud/deploy/DeploymentPlanningManager.java
----------------------------------------------------------------------
diff --git a/engine/components-api/src/com/cloud/deploy/DeploymentPlanningManager.java b/engine/components-api/src/com/cloud/deploy/DeploymentPlanningManager.java
index 7dde815..4fa0534 100644
--- a/engine/components-api/src/com/cloud/deploy/DeploymentPlanningManager.java
+++ b/engine/components-api/src/com/cloud/deploy/DeploymentPlanningManager.java
@@ -40,7 +40,7 @@ public interface DeploymentPlanningManager extends Manager {
      *
      */
     DeployDestination planDeployment(VirtualMachineProfile vmProfile, DeploymentPlan plan,
-            ExcludeList avoids) throws InsufficientServerCapacityException, AffinityConflictException;
+            ExcludeList avoids, DeploymentPlanner planner) throws InsufficientServerCapacityException,
AffinityConflictException;
 
     String finalizeReservation(DeployDestination plannedDestination,
             VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoids)

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc0f8ebd/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
index 124ae81..e9d3a39 100755
--- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -42,6 +42,7 @@ import javax.naming.ConfigurationException;
 
 import org.apache.log4j.Logger;
 
+import com.cloud.deploy.DeploymentPlanner;
 import org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDao;
 import org.apache.cloudstack.context.CallContext;
 import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
@@ -555,7 +556,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements
VirtualMac
     @Override
     public void start(String vmUuid, Map<VirtualMachineProfile.Param, Object> params,
DeploymentPlan planToDeploy) {
         try {
-            advanceStart(vmUuid, params, planToDeploy);
+            advanceStart(vmUuid, params, planToDeploy, null);
         } catch (ConcurrentOperationException e) {
             throw new CloudRuntimeException("Unable to start a VM due to concurrent operation",
e).add(VirtualMachine.class, vmUuid);
         } catch (InsufficientCapacityException e) {
@@ -696,20 +697,20 @@ public class VirtualMachineManagerImpl extends ManagerBase implements
VirtualMac
     }
 
     @Override
-    public void advanceStart(String vmUuid, Map<VirtualMachineProfile.Param, Object>
params)
+    public void advanceStart(String vmUuid, Map<VirtualMachineProfile.Param, Object>
params, DeploymentPlanner planner)
     	throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException
{
 
-        advanceStart(vmUuid, params, null);
+        advanceStart(vmUuid, params, null, planner);
     }
 
     @Override
-    public void advanceStart(String vmUuid, Map<VirtualMachineProfile.Param, Object>
params, DeploymentPlan planToDeploy) throws InsufficientCapacityException,
+    public void advanceStart(String vmUuid, Map<VirtualMachineProfile.Param, Object>
params, DeploymentPlan planToDeploy, DeploymentPlanner planner) throws InsufficientCapacityException,
 		ConcurrentOperationException, ResourceUnavailableException {
 
     	AsyncJobExecutionContext jobContext = AsyncJobExecutionContext.getCurrentExecutionContext();
         if (!VmJobEnabled.value() || jobContext.isJobDispatchedBy(VmWorkConstants.VM_WORK_JOB_DISPATCHER))
{
     		// avoid re-entrance
-    		orchestrateStart(vmUuid, params, planToDeploy);
+    		orchestrateStart(vmUuid, params, planToDeploy, planner);
     	} else {
     	    Outcome<VirtualMachine> outcome = startVmThroughJobQueue(vmUuid, params, planToDeploy);
 
@@ -731,9 +732,11 @@ public class VirtualMachineManagerImpl extends ManagerBase implements
VirtualMac
     	}
     }
 
-    private void orchestrateStart(String vmUuid, Map<VirtualMachineProfile.Param, Object>
params, DeploymentPlan planToDeploy) throws InsufficientCapacityException,
-    	ConcurrentOperationException, ResourceUnavailableException {
 
+    @Override
+    public void orchestrateStart(String vmUuid, Map<VirtualMachineProfile.Param, Object>
params, DeploymentPlan planToDeploy, DeploymentPlanner planner)
+            throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException
{
+        
     	CallContext cctxt = CallContext.current();
         Account account = cctxt.getCallingAccount();
         User caller = cctxt.getCallingUser();
@@ -848,7 +851,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements
VirtualMac
                 VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl(vm, template,
offering, owner, params);
                 DeployDestination dest = null;
                 try {
-                    dest = _dpMgr.planDeployment(vmProfile, plan, avoids);
+                    dest = _dpMgr.planDeployment(vmProfile, plan, avoids, planner);
                 } catch (AffinityConflictException e2) {
                     s_logger.warn("Unable to create deployment, affinity rules associted
to the VM conflict", e2);
                     throw new CloudRuntimeException("Unable to create deployment, affinity
rules associted to the VM conflict");
@@ -2035,7 +2038,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements
VirtualMac
     }
 
     @Override
-    public void migrateAway(String vmUuid, long srcHostId) throws InsufficientServerCapacityException
{
+    public void migrateAway(String vmUuid, long srcHostId, DeploymentPlanner planner) throws
InsufficientServerCapacityException {
         VMInstanceVO vm = _vmDao.findByUuid(vmUuid);
         if (vm == null) {
             s_logger.debug("Unable to find a VM for " + vmUuid);
@@ -2068,7 +2071,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements
VirtualMac
         while (true) {
 
             try {
-                dest = _dpMgr.planDeployment(profile, plan, excludes);
+                dest = _dpMgr.planDeployment(profile, plan, excludes, planner);
             } catch (AffinityConflictException e2) {
                 s_logger.warn("Unable to create deployment, affinity rules associted to the
VM conflict", e2);
                 throw new CloudRuntimeException("Unable to create deployment, affinity rules
associted to the VM conflict");
@@ -3390,7 +3393,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements
VirtualMac
         DeployDestination dest = null;
 
         try {
-            dest = _dpMgr.planDeployment(profile, plan, excludes);
+            dest = _dpMgr.planDeployment(profile, plan, excludes, null);
         } catch (AffinityConflictException e2) {
             s_logger.warn("Unable to create deployment, affinity rules associted to the VM
conflict", e2);
             throw new CloudRuntimeException("Unable to create deployment, affinity rules
associted to the VM conflict");
@@ -4714,7 +4717,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements
VirtualMac
         assert (vm != null);
         if (work instanceof VmWorkStart) {
             VmWorkStart workStart = (VmWorkStart)work;
-            orchestrateStart(vm.getUuid(), workStart.getParams(), workStart.getPlan());
+            orchestrateStart(vm.getUuid(), workStart.getParams(), workStart.getPlan(), null);
             return new Pair<JobInfo.Status, String>(JobInfo.Status.SUCCEEDED, null);
         } else if (work instanceof VmWorkStop) {
             VmWorkStop workStop = (VmWorkStop)work;

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc0f8ebd/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java
----------------------------------------------------------------------
diff --git a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java
b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java
index fdccf89..bdb7323 100755
--- a/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java
+++ b/engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java
@@ -185,7 +185,7 @@ public class VMEntityManagerImpl implements VMEntityManager {
         while (true) {
             DeployDestination dest = null;
             try {
-                dest = _dpMgr.planDeployment(vmProfile, plan, exclude);
+                dest = _dpMgr.planDeployment(vmProfile, plan, exclude, null);
             } catch (AffinityConflictException e) {
                 throw new CloudRuntimeException(
                         "Unable to create deployment, affinity rules associted to the VM
conflict");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc0f8ebd/plugins/ha-planners/skip-heurestics/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/ha-planners/skip-heurestics/pom.xml b/plugins/ha-planners/skip-heurestics/pom.xml
new file mode 100644
index 0000000..dc7a360
--- /dev/null
+++ b/plugins/ha-planners/skip-heurestics/pom.xml
@@ -0,0 +1,29 @@
+<!--
+  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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>cloud-plugin-planner-skip-heurestics</artifactId>
+  <name>Apache CloudStack Plugin - Skip Heurestics Planner</name>
+  <parent>
+    <groupId>org.apache.cloudstack</groupId>
+    <artifactId>cloudstack-plugins</artifactId>
+    <version>4.3.0-SNAPSHOT</version>
+    <relativePath>../../pom.xml</relativePath>
+  </parent>
+</project>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc0f8ebd/plugins/ha-planners/skip-heurestics/resources/META-INF/cloudstack/skip-heurestics/module.properties
----------------------------------------------------------------------
diff --git a/plugins/ha-planners/skip-heurestics/resources/META-INF/cloudstack/skip-heurestics/module.properties
b/plugins/ha-planners/skip-heurestics/resources/META-INF/cloudstack/skip-heurestics/module.properties
new file mode 100644
index 0000000..dfe0641
--- /dev/null
+++ b/plugins/ha-planners/skip-heurestics/resources/META-INF/cloudstack/skip-heurestics/module.properties
@@ -0,0 +1,18 @@
+# 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.
+name=skip-heurestics
+parent=planner

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc0f8ebd/plugins/ha-planners/skip-heurestics/resources/META-INF/cloudstack/skip-heurestics/spring-skip-heurestics-context.xml
----------------------------------------------------------------------
diff --git a/plugins/ha-planners/skip-heurestics/resources/META-INF/cloudstack/skip-heurestics/spring-skip-heurestics-context.xml
b/plugins/ha-planners/skip-heurestics/resources/META-INF/cloudstack/skip-heurestics/spring-skip-heurestics-context.xml
new file mode 100644
index 0000000..93a0158
--- /dev/null
+++ b/plugins/ha-planners/skip-heurestics/resources/META-INF/cloudstack/skip-heurestics/spring-skip-heurestics-context.xml
@@ -0,0 +1,26 @@
+<!-- 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. -->
+<beans xmlns="http://www.springframework.org/schema/beans"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
+    xmlns:aop="http://www.springframework.org/schema/aop"
+    xsi:schemaLocation="http://www.springframework.org/schema/beans
+                      http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
+                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
+                      http://www.springframework.org/schema/context
+                      http://www.springframework.org/schema/context/spring-context-3.0.xsd">
+
+    <bean id="SkipHeuresticsPlanner" class="com.cloud.deploy.SkipHeuresticsPlanner">
+        <property name="name" value="SkipHeuresticsPlanner" />
+    </bean>
+
+
+</beans>
+

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc0f8ebd/plugins/ha-planners/skip-heurestics/src/com/cloud/deploy/SkipHeuresticsPlanner.java
----------------------------------------------------------------------
diff --git a/plugins/ha-planners/skip-heurestics/src/com/cloud/deploy/SkipHeuresticsPlanner.java
b/plugins/ha-planners/skip-heurestics/src/com/cloud/deploy/SkipHeuresticsPlanner.java
new file mode 100644
index 0000000..b67d112
--- /dev/null
+++ b/plugins/ha-planners/skip-heurestics/src/com/cloud/deploy/SkipHeuresticsPlanner.java
@@ -0,0 +1,61 @@
+// 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.deploy;
+
+import com.cloud.vm.VirtualMachineProfile;
+import org.apache.log4j.Logger;
+
+
+import javax.ejb.Local;
+import javax.naming.ConfigurationException;
+import java.util.List;
+import java.util.Map;
+
+@Local(value=HAPlanner.class)
+public class SkipHeuresticsPlanner extends FirstFitPlanner implements HAPlanner {
+    private static final Logger s_logger = Logger.getLogger(SkipHeuresticsPlanner.class);
+
+
+    /**
+     * This method should remove the clusters crossing capacity threshold
+     * to avoid further vm allocation on it.
+     *
+     * In case of HA, we shouldn't consider this threshold as we have reserved the capacity
for such emergencies.
+     */
+    @Override
+    protected void removeClustersCrossingThreshold(List<Long> clusterListForVmAllocation,
ExcludeList avoid,
+                                                   VirtualMachineProfile vmProfile, DeploymentPlan
plan){
+        if (s_logger.isDebugEnabled()) {
+            s_logger.debug("Deploying vm during HA process, so skipping disable threshold
check");
+        }
+        return;
+    }
+
+    @Override
+    public boolean canHandle(VirtualMachineProfile vm, DeploymentPlan plan, ExcludeList avoid)
{
+        return true;
+    }
+
+    @Override
+    public boolean configure(String name, Map<String, Object> params) throws ConfigurationException
{
+        super.configure(name, params);
+
+        return true;
+
+    }
+
+}
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc0f8ebd/plugins/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/pom.xml b/plugins/pom.xml
index d0817a2..87a7f8f 100755
--- a/plugins/pom.xml
+++ b/plugins/pom.xml
@@ -32,6 +32,7 @@
     <module>deployment-planners/user-concentrated-pod</module>
     <module>deployment-planners/user-dispersing</module>
     <module>deployment-planners/implicit-dedication</module>
+    <module>ha-planners/skip-heurestics</module>
     <module>host-allocators/random</module>
     <module>dedicated-resources</module>
     <module>hypervisors/ovm</module>

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc0f8ebd/server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml
----------------------------------------------------------------------
diff --git a/server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml
b/server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml
index 2fe76ba..31f31cd 100644
--- a/server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml
+++ b/server/resources/META-INF/cloudstack/core/spring-server-core-managers-context.xml
@@ -65,6 +65,7 @@
     <bean id="highAvailabilityManagerExtImpl" class="com.cloud.ha.HighAvailabilityManagerExtImpl">
         <property name="investigators" value="#{haInvestigatorsRegistry.registered}" />
         <property name="fenceBuilders" value="#{haFenceBuildersRegistry.registered}" />
+        <property name="haPlanners" value="#{haPlannersRegistry.registered}" />
     </bean>
 
     <bean id="ipAddressManagerImpl" class="com.cloud.network.IpAddressManagerImpl">

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc0f8ebd/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
index e82aaba..c5517c5 100755
--- a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
+++ b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
@@ -551,7 +551,7 @@ VirtualMachineGuru, SystemVmLoadScanHandler<Long>, ResourceStateAdapter
{
             }
 
             if (proxy.getState() == VirtualMachine.State.Stopped) {
-                _itMgr.advanceStart(proxy.getUuid(), null);
+                _itMgr.advanceStart(proxy.getUuid(), null, null);
                 proxy = _consoleProxyDao.findById(proxy.getId());
             }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc0f8ebd/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 65759e0..a41f5ee 100644
--- a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
+++ b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
@@ -212,7 +212,7 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements
Deploy
 
     @Override
     public DeployDestination planDeployment(VirtualMachineProfile vmProfile,
-            DeploymentPlan plan, ExcludeList avoids) throws InsufficientServerCapacityException,
+            DeploymentPlan plan, ExcludeList avoids, DeploymentPlanner planner) throws InsufficientServerCapacityException,
             AffinityConflictException {
 
         // call affinitygroup chain
@@ -247,19 +247,21 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements
Deploy
 
 
         ServiceOffering offering = vmProfile.getServiceOffering();
-        String plannerName = offering.getDeploymentPlanner();
-        if (plannerName == null) {
-            if (vm.getHypervisorType() == HypervisorType.BareMetal) {
-                plannerName = "BareMetalPlanner";
-            } else {
-                plannerName = _configDao.getValue(Config.VmDeploymentPlanner.key());
+        if(planner == null){
+            String plannerName = offering.getDeploymentPlanner();
+            if (plannerName == null) {
+                if (vm.getHypervisorType() == HypervisorType.BareMetal) {
+                    plannerName = "BareMetalPlanner";
+                } else {
+                    plannerName = _configDao.getValue(Config.VmDeploymentPlanner.key());
+                }
             }
-        }
-        DeploymentPlanner planner = null;
-        for (DeploymentPlanner plannerInList : _planners) {
-            if (plannerName.equals(plannerInList.getName())) {
-                planner = plannerInList;
-                break;
+
+            for (DeploymentPlanner plannerInList : _planners) {
+                if (plannerName.equals(plannerInList.getName())) {
+                    planner = plannerInList;
+                    break;
+                }
             }
         }
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc0f8ebd/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 3707d3d..e534894 100755
--- a/server/src/com/cloud/deploy/FirstFitPlanner.java
+++ b/server/src/com/cloud/deploy/FirstFitPlanner.java
@@ -266,7 +266,14 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentClusterPla
         return capacityList;
     }
 
-    private void removeClustersCrossingThreshold(List<Long> clusterListForVmAllocation,
ExcludeList avoid,
+    /**
+     * This method should remove the clusters crossing capacity threshold to avoid further
vm allocation on it.
+     * @param clusterListForVmAllocation
+     * @param avoid
+     * @param vmProfile
+     * @param plan
+     */
+    protected void removeClustersCrossingThreshold(List<Long> clusterListForVmAllocation,
ExcludeList avoid,
             VirtualMachineProfile vmProfile, DeploymentPlan plan) {
 
         List<Short> capacityList = getCapacitiesForCheckingThreshold();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc0f8ebd/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java b/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java
index d6b9ff3..54ca0aa 100755
--- a/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java
+++ b/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java
@@ -29,6 +29,7 @@ import javax.ejb.Local;
 import javax.inject.Inject;
 import javax.naming.ConfigurationException;
 
+import com.cloud.deploy.HAPlanner;
 import org.apache.cloudstack.engine.orchestration.service.VolumeOrchestrationService;
 import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
 import org.apache.cloudstack.managed.context.ManagedContext;
@@ -136,7 +137,17 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements
HighAvai
 		this._fenceBuilders = _fenceBuilders;
 	}
 
-	@Inject
+    List<HAPlanner> _haPlanners;
+    public List<HAPlanner> getHaPlanners() {
+        return _haPlanners;
+    }
+
+    public void setHaPlanners(List<HAPlanner> _haPlanners) {
+        this._haPlanners = _haPlanners;
+    }
+
+
+    @Inject
     AgentManager _agentMgr;
     @Inject
     AlertManager _alertMgr;
@@ -539,12 +550,22 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements
HighAvai
             if (_haTag != null) {
                 params.put(VirtualMachineProfile.Param.HaTag, _haTag);
             }
-            _itMgr.advanceStart(vm.getUuid(), params);
-            
+
+            // First try starting the vm with its original planner, if it doesn't succeed
send HAPlanner as its an emergency.
+            _itMgr.advanceStart(vm.getUuid(), params, null);
             VMInstanceVO started = _instanceDao.findById(vm.getId());
             if (started != null && started.getState() == VirtualMachine.State.Running)
{
                 s_logger.info("VM is now restarted: " + vmId + " on " + started.getHostId());
                 return null;
+            }else {
+                s_logger.warn("Failed to deploy vm " + vmId + " with original planner, sending
HAPlanner");
+                _itMgr.advanceStart(vm.getUuid(), params, _haPlanners.get(0));
+            }
+
+            started = _instanceDao.findById(vm.getId());
+            if (started != null && started.getState() == VirtualMachine.State.Running)
{
+                s_logger.info("VM is now restarted: " + vmId + " on " + started.getHostId());
+                return null;
             }
 
             if (s_logger.isDebugEnabled()) {
@@ -582,8 +603,14 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements
HighAvai
             _haDao.update(work.getId(), work);
             
             VMInstanceVO vm = _instanceDao.findById(vmId);
-
-            _itMgr.migrateAway(vm.getUuid(), srcHostId);
+            // First try starting the vm with its original planner, if it doesn't succeed
send HAPlanner as its an emergency.
+            boolean result = false;
+            try {
+                _itMgr.migrateAway(vm.getUuid(), srcHostId, null);
+            }catch (InsufficientServerCapacityException e) {
+                s_logger.warn("Failed to deploy vm " + vmId + " with original planner, sending
HAPlanner");
+                _itMgr.migrateAway(vm.getUuid(), srcHostId, _haPlanners.get(0));
+            }
             return null;
         } catch (InsufficientServerCapacityException e) {
             s_logger.warn("Insufficient capacity for migrating a VM.");

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc0f8ebd/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
index ca01831..7d9805b 100755
--- a/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
+++ b/server/src/com/cloud/network/router/VirtualNetworkApplianceManagerImpl.java
@@ -2664,7 +2664,7 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase
implements V
     ConcurrentOperationException, ResourceUnavailableException {
         s_logger.debug("Starting router " + router);
         try {
-            _itMgr.advanceStart(router.getUuid(), params, planToDeploy);
+            _itMgr.advanceStart(router.getUuid(), params, planToDeploy, null);
         } catch (OperationTimedoutException e) {
             throw new ResourceUnavailableException("Starting router " + router + " failed!
" + e.toString(), DataCenter.class, router.getDataCenterId());
         }
@@ -3433,9 +3433,9 @@ public class VirtualNetworkApplianceManagerImpl extends ManagerBase
implements V
     }
 
     protected boolean sendCommandsToRouter(final VirtualRouter router, Commands cmds) throws
AgentUnavailableException {
-        if(!checkRouterVersion(router)){
+       /*if(!checkRouterVersion(router)){
             throw new CloudRuntimeException("Router requires upgrade. Unable to send command
to router:" + router.getId());
-        }
+        }*/
         Answer[] answers = null;
         try {
             answers = _agentMgr.send(router.getHostId(), cmds);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc0f8ebd/server/src/com/cloud/storage/StoragePoolAutomationImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/StoragePoolAutomationImpl.java b/server/src/com/cloud/storage/StoragePoolAutomationImpl.java
index f0f6eaf..2c11e73 100644
--- a/server/src/com/cloud/storage/StoragePoolAutomationImpl.java
+++ b/server/src/com/cloud/storage/StoragePoolAutomationImpl.java
@@ -242,7 +242,7 @@ public class StoragePoolAutomationImpl implements StoragePoolAutomation
{
 
                     if (restart) {
 
-                        vmMgr.advanceStart(consoleProxy.getUuid(), null);
+                        vmMgr.advanceStart(consoleProxy.getUuid(), null, null);
                         // update work status
                         work.setStartedAfterMaintenance(true);
                         _storagePoolWorkDao.update(work.getId(), work);
@@ -269,7 +269,7 @@ public class StoragePoolAutomationImpl implements StoragePoolAutomation
{
                     _storagePoolWorkDao.update(work.getId(), work);
 
                     if (restart) {
-                        vmMgr.advanceStart(secStrgVm.getUuid(), null);
+                        vmMgr.advanceStart(secStrgVm.getUuid(), null, null);
                         // update work status
                         work.setStartedAfterMaintenance(true);
                         _storagePoolWorkDao.update(work.getId(), work);
@@ -287,7 +287,7 @@ public class StoragePoolAutomationImpl implements StoragePoolAutomation
{
                     _storagePoolWorkDao.update(work.getId(), work);
 
                     if (restart) {
-                        vmMgr.advanceStart(domR.getUuid(), null);
+                        vmMgr.advanceStart(domR.getUuid(), null, null);
                         // update work status
                         work.setStartedAfterMaintenance(true);
                         _storagePoolWorkDao.update(work.getId(), work);
@@ -365,7 +365,7 @@ public class StoragePoolAutomationImpl implements StoragePoolAutomation
{
 
                     ConsoleProxyVO consoleProxy = _consoleProxyDao
                             .findById(vmInstance.getId());
-                    vmMgr.advanceStart(consoleProxy.getUuid(), null);
+                    vmMgr.advanceStart(consoleProxy.getUuid(), null, null);
                     // update work queue
                     work.setStartedAfterMaintenance(true);
                     _storagePoolWorkDao.update(work.getId(), work);
@@ -376,7 +376,7 @@ public class StoragePoolAutomationImpl implements StoragePoolAutomation
{
                         VirtualMachine.Type.SecondaryStorageVm)) {
                     SecondaryStorageVmVO ssVm = _secStrgDao.findById(vmInstance
                             .getId());
-                    vmMgr.advanceStart(ssVm.getUuid(), null);
+                    vmMgr.advanceStart(ssVm.getUuid(), null, null);
                     // update work queue
                     work.setStartedAfterMaintenance(true);
                     _storagePoolWorkDao.update(work.getId(), work);
@@ -386,7 +386,7 @@ public class StoragePoolAutomationImpl implements StoragePoolAutomation
{
                 if (vmInstance.getType().equals(
                         VirtualMachine.Type.DomainRouter)) {
                     DomainRouterVO domR = _domrDao.findById(vmInstance.getId());
-                    vmMgr.advanceStart(domR.getUuid(), null);
+                    vmMgr.advanceStart(domR.getUuid(), null, null);
                     // update work queue
                     work.setStartedAfterMaintenance(true);
                     _storagePoolWorkDao.update(work.getId(), work);
@@ -396,7 +396,7 @@ public class StoragePoolAutomationImpl implements StoragePoolAutomation
{
                 if (vmInstance.getType().equals(VirtualMachine.Type.User)) {
                     UserVmVO userVm = userVmDao.findById(vmInstance.getId());
 
-                    vmMgr.advanceStart(userVm.getUuid(), null);                        //
update work queue
+                    vmMgr.advanceStart(userVm.getUuid(), null, null);                   
    // update work queue
                     work.setStartedAfterMaintenance(true);
                     _storagePoolWorkDao.update(work.getId(), work);
                 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc0f8ebd/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
index 7743dca..fb44b80 100755
--- a/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
+++ b/server/src/com/cloud/storage/secondary/SecondaryStorageManagerImpl.java
@@ -258,7 +258,7 @@ public class SecondaryStorageManagerImpl extends ManagerBase implements
Secondar
     public SecondaryStorageVmVO startSecStorageVm(long secStorageVmId) {
         try {
             SecondaryStorageVmVO secStorageVm = _secStorageVmDao.findById(secStorageVmId);
-            _itMgr.advanceStart(secStorageVm.getUuid(), null);
+            _itMgr.advanceStart(secStorageVm.getUuid(), null, null);
             return _secStorageVmDao.findById(secStorageVm.getId());
         } catch (StorageUnavailableException e) {
             s_logger.warn("Exception while trying to start secondary storage vm", e);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc0f8ebd/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
----------------------------------------------------------------------
diff --git a/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java b/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
index 3e6d7f9..a35a27d 100644
--- a/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
+++ b/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
@@ -428,7 +428,7 @@ public class VMSnapshotManagerImpl extends ManagerBase implements VMSnapshotMana
         // start or stop VM first, if revert from stopped state to running state, or from
running to stopped
         if(userVm.getState() == VirtualMachine.State.Stopped && vmSnapshotVo.getType()
== VMSnapshot.Type.DiskAndMemory){
             try {
-                _itMgr.advanceStart(userVm.getUuid(), new HashMap<VirtualMachineProfile.Param,
Object>());
+                _itMgr.advanceStart(userVm.getUuid(), new HashMap<VirtualMachineProfile.Param,
Object>(), null);
                 vm = _userVMDao.findById(userVm.getId());
         	    hostId = vm.getHostId();
         	} catch (Exception e) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dc0f8ebd/server/test/com/cloud/vm/DeploymentPlanningManagerImplTest.java
----------------------------------------------------------------------
diff --git a/server/test/com/cloud/vm/DeploymentPlanningManagerImplTest.java b/server/test/com/cloud/vm/DeploymentPlanningManagerImplTest.java
index 0f343a5..08e472a 100644
--- a/server/test/com/cloud/vm/DeploymentPlanningManagerImplTest.java
+++ b/server/test/com/cloud/vm/DeploymentPlanningManagerImplTest.java
@@ -41,7 +41,7 @@ import com.cloud.dc.ClusterVO;
 import com.cloud.dc.DataCenterVO;
 import com.cloud.dc.dao.ClusterDao;
 import com.cloud.dc.dao.DataCenterDao;
-import com.cloud.dc.dao.DedicatedResourceDao;
+import com.cloud.dc.dao.DedicatedResourceDao;
 import com.cloud.dc.dao.HostPodDao;
 import com.cloud.deploy.DataCenterDeployment;
 import com.cloud.deploy.DeployDestination;
@@ -120,9 +120,9 @@ public class DeploymentPlanningManagerImplTest {
     @Inject
     ClusterDao _clusterDao;
 
-    @Inject
-    DedicatedResourceDao _dedicatedDao;
-
+    @Inject
+    DedicatedResourceDao _dedicatedDao;
+
     private static long domainId = 5L;
 
     private static long dataCenterId = 1L;
@@ -167,7 +167,7 @@ public class DeploymentPlanningManagerImplTest {
         DataCenterDeployment plan = new DataCenterDeployment(dataCenterId);
 
         Mockito.when(avoids.shouldAvoid((DataCenterVO) Mockito.anyObject())).thenReturn(true);
-        DeployDestination dest = _dpm.planDeployment(vmProfile, plan, avoids);
+        DeployDestination dest = _dpm.planDeployment(vmProfile, plan, avoids, null);
         assertNull("DataCenter is in avoid set, destination should be null! ", dest);
     }
 
@@ -182,7 +182,7 @@ public class DeploymentPlanningManagerImplTest {
         Mockito.when(avoids.shouldAvoid((DataCenterVO) Mockito.anyObject())).thenReturn(false);
 
         Mockito.when(_planner.canHandle(vmProfile, plan, avoids)).thenReturn(false);
-        DeployDestination dest = _dpm.planDeployment(vmProfile, plan, avoids);
+        DeployDestination dest = _dpm.planDeployment(vmProfile, plan, avoids, null);
         assertNull("Planner cannot handle, destination should be null! ", dest);
     }
 
@@ -197,7 +197,7 @@ public class DeploymentPlanningManagerImplTest {
         Mockito.when(_planner.canHandle(vmProfile, plan, avoids)).thenReturn(true);
 
         Mockito.when(((DeploymentClusterPlanner) _planner).orderClusters(vmProfile, plan,
avoids)).thenReturn(null);
-        DeployDestination dest = _dpm.planDeployment(vmProfile, plan, avoids);
+        DeployDestination dest = _dpm.planDeployment(vmProfile, plan, avoids, null);
         assertNull("Planner cannot handle, destination should be null! ", dest);
     }
 
@@ -262,11 +262,11 @@ public class DeploymentPlanningManagerImplTest {
         }
 
         @Bean
-        public DedicatedResourceDao dedicatedResourceDao() {
-            return Mockito.mock(DedicatedResourceDao.class);
-        }
-
-        @Bean
+        public DedicatedResourceDao dedicatedResourceDao() {
+            return Mockito.mock(DedicatedResourceDao.class);
+        }
+
+        @Bean
         public GuestOSDao guestOSDao() {
             return Mockito.mock(GuestOSDao.class);
         }


Mime
View raw message