You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mc...@apache.org on 2013/12/19 01:12:00 UTC
[2/2] git commit: updated refs/heads/master to afcf967
Revert "CLOUDSTACK-4941:"
This reverts commit 231e7c01f2415c1f25d6a2715b7469fe7fcfe771.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/afcf967d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/afcf967d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/afcf967d
Branch: refs/heads/master
Commit: afcf967d24655f74d369bd0f41ba75721140b2bb
Parents: bb91b73
Author: Min Chen <mi...@citrix.com>
Authored: Wed Dec 18 16:01:37 2013 -0800
Committer: Min Chen <mi...@citrix.com>
Committed: Wed Dec 18 16:01:37 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 | 11 ++--
.../cloud/deploy/DeploymentPlanningManager.java | 9 ++-
.../com/cloud/vm/VirtualMachineManagerImpl.java | 28 +++++----
.../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 | 29 +++++-----
.../src/com/cloud/deploy/FirstFitPlanner.java | 10 +---
.../cloud/ha/HighAvailabilityManagerImpl.java | 34 +----------
.../storage/StoragePoolAutomationImpl.java | 24 ++++----
.../secondary/SecondaryStorageManagerImpl.java | 2 +-
.../vm/snapshot/VMSnapshotManagerImpl.java | 2 +-
.../vm/DeploymentPlanningManagerImplTest.java | 6 +-
22 files changed, 56 insertions(+), 275 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/afcf967d/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
deleted file mode 100644
index aeb5083..0000000
--- a/api/src/com/cloud/deploy/HAPlanner.java
+++ /dev/null
@@ -1,21 +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.deploy;
-
-
-public interface HAPlanner extends DeploymentPlanner {
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/afcf967d/client/pom.xml
----------------------------------------------------------------------
diff --git a/client/pom.xml b/client/pom.xml
index 75b5504..fc01113 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -177,11 +177,6 @@
<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/afcf967d/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 5e799c0..be11a1f 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,11 +77,6 @@
<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/afcf967d/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 80779e4..715f86d 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,9 +38,4 @@
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/afcf967d/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 4f4a652..4c2222c 100644
--- a/engine/api/src/com/cloud/vm/VirtualMachineManager.java
+++ b/engine/api/src/com/cloud/vm/VirtualMachineManager.java
@@ -93,13 +93,10 @@ 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, DeploymentPlanner planner) throws InsufficientCapacityException, ResourceUnavailableException,
- ConcurrentOperationException, OperationTimedoutException;
-
- void advanceStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params, DeploymentPlan planToDeploy, DeploymentPlanner planner) throws InsufficientCapacityException,
- ResourceUnavailableException, ConcurrentOperationException, OperationTimedoutException;
+ void advanceStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params) throws InsufficientCapacityException, ResourceUnavailableException,
+ ConcurrentOperationException, OperationTimedoutException;
- void orchestrateStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params, DeploymentPlan planToDeploy, DeploymentPlanner planner) throws InsufficientCapacityException,
+ void advanceStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params, DeploymentPlan planToDeploy) throws InsufficientCapacityException,
ResourceUnavailableException, ConcurrentOperationException, OperationTimedoutException;
void advanceStop(String vmUuid, boolean cleanupEvenIfUnableToStop) throws ResourceUnavailableException, OperationTimedoutException, ConcurrentOperationException;
@@ -108,7 +105,7 @@ public interface VirtualMachineManager extends Manager {
void destroy(String vmUuid) throws AgentUnavailableException, OperationTimedoutException, ConcurrentOperationException;
- void migrateAway(String vmUuid, long hostId, DeploymentPlanner planner) throws InsufficientServerCapacityException;
+ void migrateAway(String vmUuid, long hostId) throws InsufficientServerCapacityException;
void migrate(String vmUuid, long srcHostId, DeployDestination dest) throws ResourceUnavailableException, ConcurrentOperationException;
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/afcf967d/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 de2fc0e..b61e89d 100644
--- a/engine/components-api/src/com/cloud/deploy/DeploymentPlanningManager.java
+++ b/engine/components-api/src/com/cloud/deploy/DeploymentPlanningManager.java
@@ -39,12 +39,11 @@ public interface DeploymentPlanningManager extends Manager {
*
*
*/
- DeployDestination planDeployment(VirtualMachineProfile vmProfile, DeploymentPlan plan,
- ExcludeList avoids, DeploymentPlanner planner) throws InsufficientServerCapacityException, AffinityConflictException;
+ DeployDestination planDeployment(VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoids) throws InsufficientServerCapacityException,
+ AffinityConflictException;
- String finalizeReservation(DeployDestination plannedDestination,
- VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoids)
- throws InsufficientServerCapacityException, AffinityConflictException;
+ String finalizeReservation(DeployDestination plannedDestination, VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoids)
+ throws InsufficientServerCapacityException, AffinityConflictException;
void cleanupVMReservations();
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/afcf967d/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 f4a86fc..75ab47b 100755
--- a/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
+++ b/engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java
@@ -42,7 +42,6 @@ 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;
@@ -560,7 +559,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, null);
+ advanceStart(vmUuid, params, planToDeploy);
} catch (ConcurrentOperationException e) {
throw new CloudRuntimeException("Unable to start a VM due to concurrent operation", e).add(VirtualMachine.class, vmUuid);
} catch (InsufficientCapacityException e) {
@@ -701,19 +700,20 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
}
@Override
- public void advanceStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params, DeploymentPlanner planner)
+ public void advanceStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params)
throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException {
- advanceStart(vmUuid, params, null, planner);
+
+ advanceStart(vmUuid, params, null);
}
@Override
- public void advanceStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params, DeploymentPlan planToDeploy, DeploymentPlanner planner) throws InsufficientCapacityException,
+ public void advanceStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params, DeploymentPlan planToDeploy) throws InsufficientCapacityException,
ConcurrentOperationException, ResourceUnavailableException {
AsyncJobExecutionContext jobContext = AsyncJobExecutionContext.getCurrentExecutionContext();
if (!VmJobEnabled.value() || jobContext.isJobDispatchedBy(VmWorkJobDispatcher.VM_WORK_JOB_DISPATCHER)) {
// avoid re-entrance
- orchestrateStart(vmUuid, params, planToDeploy, planner);
+ orchestrateStart(vmUuid, params, planToDeploy);
} else {
Outcome<VirtualMachine> outcome = startVmThroughJobQueue(vmUuid, params, planToDeploy);
@@ -735,10 +735,8 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
}
}
-
- @Override
- public void orchestrateStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params, DeploymentPlan planToDeploy, DeploymentPlanner planner)
- throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException {
+ private void orchestrateStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params, DeploymentPlan planToDeploy) throws InsufficientCapacityException,
+ ConcurrentOperationException, ResourceUnavailableException {
CallContext cctxt = CallContext.current();
Account account = cctxt.getCallingAccount();
@@ -856,7 +854,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, planner);
+ dest = _dpMgr.planDeployment(vmProfile, plan, avoids);
} 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");
@@ -2039,7 +2037,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
}
@Override
- public void migrateAway(String vmUuid, long srcHostId, DeploymentPlanner planner) throws InsufficientServerCapacityException {
+ public void migrateAway(String vmUuid, long srcHostId) throws InsufficientServerCapacityException {
VMInstanceVO vm = _vmDao.findByUuid(vmUuid);
if (vm == null) {
s_logger.debug("Unable to find a VM for " + vmUuid);
@@ -2072,7 +2070,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
while (true) {
try {
- dest = _dpMgr.planDeployment(profile, plan, excludes, planner);
+ dest = _dpMgr.planDeployment(profile, plan, excludes);
} 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");
@@ -3394,7 +3392,7 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
DeployDestination dest = null;
try {
- dest = _dpMgr.planDeployment(profile, plan, excludes, null);
+ dest = _dpMgr.planDeployment(profile, plan, excludes);
} 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 +4712,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(), null);
+ orchestrateStart(vm.getUuid(), workStart.getParams(), workStart.getPlan());
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/afcf967d/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 36481ab..40b0f44 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
@@ -189,7 +189,7 @@ public class VMEntityManagerImpl implements VMEntityManager {
while (true) {
DeployDestination dest = null;
try {
- dest = _dpMgr.planDeployment(vmProfile, plan, exclude, null);
+ dest = _dpMgr.planDeployment(vmProfile, plan, exclude);
} 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/afcf967d/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
deleted file mode 100644
index 223789a..0000000
--- a/plugins/ha-planners/skip-heurestics/pom.xml
+++ /dev/null
@@ -1,29 +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.
--->
-<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.4.0-SNAPSHOT</version>
- <relativePath>../../pom.xml</relativePath>
- </parent>
-</project>
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/afcf967d/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
deleted file mode 100644
index dfe0641..0000000
--- a/plugins/ha-planners/skip-heurestics/resources/META-INF/cloudstack/skip-heurestics/module.properties
+++ /dev/null
@@ -1,18 +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.
-name=skip-heurestics
-parent=planner
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/afcf967d/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
deleted file mode 100644
index 93a0158..0000000
--- a/plugins/ha-planners/skip-heurestics/resources/META-INF/cloudstack/skip-heurestics/spring-skip-heurestics-context.xml
+++ /dev/null
@@ -1,26 +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. -->
-<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/afcf967d/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
deleted file mode 100644
index b67d112..0000000
--- a/plugins/ha-planners/skip-heurestics/src/com/cloud/deploy/SkipHeuresticsPlanner.java
+++ /dev/null
@@ -1,61 +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.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/afcf967d/plugins/pom.xml
----------------------------------------------------------------------
diff --git a/plugins/pom.xml b/plugins/pom.xml
index 06cf79f..17dd8af 100755
--- a/plugins/pom.xml
+++ b/plugins/pom.xml
@@ -32,7 +32,6 @@
<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/afcf967d/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 d4ee85e..35683f0 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,7 +65,6 @@
<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/afcf967d/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 3b23715..4b35b0e 100755
--- a/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
+++ b/server/src/com/cloud/consoleproxy/ConsoleProxyManagerImpl.java
@@ -549,7 +549,7 @@ public class ConsoleProxyManagerImpl extends ManagerBase implements ConsoleProxy
}
if (proxy.getState() == VirtualMachine.State.Stopped) {
- _itMgr.advanceStart(proxy.getUuid(), null, null);
+ _itMgr.advanceStart(proxy.getUuid(), null);
proxy = _consoleProxyDao.findById(proxy.getId());
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/afcf967d/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 8cad796..ca2ff42 100644
--- a/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
+++ b/server/src/com/cloud/deploy/DeploymentPlanningManagerImpl.java
@@ -233,8 +233,8 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy
}
@Override
- public DeployDestination planDeployment(VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoids, DeploymentPlanner planner)
- throws InsufficientServerCapacityException, AffinityConflictException {
+ public DeployDestination planDeployment(VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoids) throws InsufficientServerCapacityException,
+ AffinityConflictException {
// call affinitygroup chain
VirtualMachine vm = vmProfile.getVirtualMachine();
@@ -265,20 +265,19 @@ public class DeploymentPlanningManagerImpl extends ManagerBase implements Deploy
}
ServiceOffering offering = vmProfile.getServiceOffering();
- if(planner == null){
- String plannerName = offering.getDeploymentPlanner();
- if (plannerName == null) {
- if (vm.getHypervisorType() == HypervisorType.BareMetal) {
- plannerName = "BareMetalPlanner";
- } else {
- plannerName = _configDao.getValue(Config.VmDeploymentPlanner.key());
- }
+ String plannerName = offering.getDeploymentPlanner();
+ if (plannerName == null) {
+ if (vm.getHypervisorType() == HypervisorType.BareMetal) {
+ plannerName = "BareMetalPlanner";
+ } else {
+ plannerName = _configDao.getValue(Config.VmDeploymentPlanner.key());
}
- for (DeploymentPlanner plannerInList : _planners) {
- if (plannerName.equals(plannerInList.getName())) {
- planner = plannerInList;
- break;
- }
+ }
+ DeploymentPlanner planner = null;
+ for (DeploymentPlanner plannerInList : _planners) {
+ if (plannerName.equals(plannerInList.getName())) {
+ planner = plannerInList;
+ break;
}
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/afcf967d/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 1c79a67..b59fcef 100755
--- a/server/src/com/cloud/deploy/FirstFitPlanner.java
+++ b/server/src/com/cloud/deploy/FirstFitPlanner.java
@@ -259,15 +259,7 @@ public class FirstFitPlanner extends PlannerBase implements DeploymentClusterPla
return capacityList;
}
- /**
- * 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) {
+ private void removeClustersCrossingThreshold(List<Long> clusterListForVmAllocation, ExcludeList avoid, VirtualMachineProfile vmProfile, DeploymentPlan plan) {
List<Short> capacityList = getCapacitiesForCheckingThreshold();
List<Long> clustersCrossingThreshold = new ArrayList<Long>();
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/afcf967d/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 ad33666..8e86bbc 100755
--- a/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java
+++ b/server/src/com/cloud/ha/HighAvailabilityManagerImpl.java
@@ -32,7 +32,6 @@ import javax.naming.ConfigurationException;
import org.apache.log4j.Logger;
import org.apache.log4j.NDC;
-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;
@@ -142,16 +141,6 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai
this.fenceBuilders = fenceBuilders;
}
- List<HAPlanner> _haPlanners;
- public List<HAPlanner> getHaPlanners() {
- return _haPlanners;
- }
-
- public void setHaPlanners(List<HAPlanner> haPlanners) {
- this._haPlanners = haPlanners;
- }
-
-
@Inject
AgentManager _agentMgr;
@Inject
@@ -559,23 +548,12 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai
if (_haTag != null) {
params.put(VirtualMachineProfile.Param.HaTag, _haTag);
}
-
- // 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);
+ _itMgr.advanceStart(vm.getUuid(), params);
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()) {
@@ -613,14 +591,8 @@ public class HighAvailabilityManagerImpl extends ManagerBase implements HighAvai
_haDao.update(work.getId(), work);
VMInstanceVO vm = _instanceDao.findById(vmId);
- // 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));
- }
+
+ _itMgr.migrateAway(vm.getUuid(), srcHostId);
return null;
} catch (InsufficientServerCapacityException e) {
s_logger.warn("Insufficient capacity for migrating a VM.");
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/afcf967d/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 8becd75..c76c647 100644
--- a/server/src/com/cloud/storage/StoragePoolAutomationImpl.java
+++ b/server/src/com/cloud/storage/StoragePoolAutomationImpl.java
@@ -219,7 +219,7 @@ public class StoragePoolAutomationImpl implements StoragePoolAutomation {
if (restart) {
- vmMgr.advanceStart(consoleProxy.getUuid(), null, null);
+ vmMgr.advanceStart(consoleProxy.getUuid(), null);
// update work status
work.setStartedAfterMaintenance(true);
_storagePoolWorkDao.update(work.getId(), work);
@@ -245,7 +245,7 @@ public class StoragePoolAutomationImpl implements StoragePoolAutomation {
_storagePoolWorkDao.update(work.getId(), work);
if (restart) {
- vmMgr.advanceStart(secStrgVm.getUuid(), null, null);
+ vmMgr.advanceStart(secStrgVm.getUuid(), null);
// update work status
work.setStartedAfterMaintenance(true);
_storagePoolWorkDao.update(work.getId(), work);
@@ -262,7 +262,7 @@ public class StoragePoolAutomationImpl implements StoragePoolAutomation {
_storagePoolWorkDao.update(work.getId(), work);
if (restart) {
- vmMgr.advanceStart(domR.getUuid(), null, null);
+ vmMgr.advanceStart(domR.getUuid(), null);
// update work status
work.setStartedAfterMaintenance(true);
_storagePoolWorkDao.update(work.getId(), work);
@@ -330,21 +330,17 @@ public class StoragePoolAutomationImpl implements StoragePoolAutomation {
// proxy
if (vmInstance.getType().equals(VirtualMachine.Type.ConsoleProxy)) {
- ConsoleProxyVO consoleProxy = _consoleProxyDao
- .findById(vmInstance.getId());
- vmMgr.advanceStart(consoleProxy.getUuid(), null, null);
+ ConsoleProxyVO consoleProxy = _consoleProxyDao.findById(vmInstance.getId());
+ vmMgr.advanceStart(consoleProxy.getUuid(), null);
// update work queue
work.setStartedAfterMaintenance(true);
_storagePoolWorkDao.update(work.getId(), work);
}
// if the instance is of type ssvm, call the ssvm manager
- if (vmInstance.getType().equals(
- VirtualMachine.Type.SecondaryStorageVm)) {
- SecondaryStorageVmVO ssVm = _secStrgDao.findById(vmInstance
- .getId());
- vmMgr.advanceStart(ssVm.getUuid(), null, null);
-
+ if (vmInstance.getType().equals(VirtualMachine.Type.SecondaryStorageVm)) {
+ SecondaryStorageVmVO ssVm = _secStrgDao.findById(vmInstance.getId());
+ vmMgr.advanceStart(ssVm.getUuid(), null);
// update work queue
work.setStartedAfterMaintenance(true);
_storagePoolWorkDao.update(work.getId(), work);
@@ -353,7 +349,7 @@ public class StoragePoolAutomationImpl implements StoragePoolAutomation {
// if the instance is of type ssvm, call the ssvm manager
if (vmInstance.getType().equals(VirtualMachine.Type.DomainRouter)) {
DomainRouterVO domR = _domrDao.findById(vmInstance.getId());
- vmMgr.advanceStart(domR.getUuid(), null, null);
+ vmMgr.advanceStart(domR.getUuid(), null);
// update work queue
work.setStartedAfterMaintenance(true);
_storagePoolWorkDao.update(work.getId(), work);
@@ -363,7 +359,7 @@ public class StoragePoolAutomationImpl implements StoragePoolAutomation {
if (vmInstance.getType().equals(VirtualMachine.Type.User)) {
UserVmVO userVm = userVmDao.findById(vmInstance.getId());
- vmMgr.advanceStart(userVm.getUuid(), null, null); // update work queue
+ vmMgr.advanceStart(userVm.getUuid(), null); // update work queue
work.setStartedAfterMaintenance(true);
_storagePoolWorkDao.update(work.getId(), work);
}
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/afcf967d/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 99de391..8decfd2 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, null);
+ _itMgr.advanceStart(secStorageVm.getUuid(), 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/afcf967d/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 93c845a..ece75be 100644
--- a/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
+++ b/server/src/com/cloud/vm/snapshot/VMSnapshotManagerImpl.java
@@ -429,7 +429,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>(), null);
+ _itMgr.advanceStart(userVm.getUuid(), new HashMap<VirtualMachineProfile.Param, Object>());
vm = _userVMDao.findById(userVm.getId());
hostId = vm.getHostId();
} catch (Exception e) {
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/afcf967d/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 751a3bd..0d82ff2 100644
--- a/server/test/com/cloud/vm/DeploymentPlanningManagerImplTest.java
+++ b/server/test/com/cloud/vm/DeploymentPlanningManagerImplTest.java
@@ -168,7 +168,7 @@ public class DeploymentPlanningManagerImplTest {
DataCenterDeployment plan = new DataCenterDeployment(dataCenterId);
Mockito.when(avoids.shouldAvoid((DataCenterVO)Matchers.anyObject())).thenReturn(true);
- DeployDestination dest = _dpm.planDeployment(vmProfile, plan, avoids, null);
+ DeployDestination dest = _dpm.planDeployment(vmProfile, plan, avoids);
assertNull("DataCenter is in avoid set, destination should be null! ", dest);
}
@@ -183,7 +183,7 @@ public class DeploymentPlanningManagerImplTest {
Mockito.when(avoids.shouldAvoid((DataCenterVO)Matchers.anyObject())).thenReturn(false);
Mockito.when(_planner.canHandle(vmProfile, plan, avoids)).thenReturn(false);
- DeployDestination dest = _dpm.planDeployment(vmProfile, plan, avoids, null);
+ DeployDestination dest = _dpm.planDeployment(vmProfile, plan, avoids);
assertNull("Planner cannot handle, destination should be null! ", dest);
}
@@ -199,7 +199,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, null);
+ DeployDestination dest = _dpm.planDeployment(vmProfile, plan, avoids);
assertNull("Planner cannot handle, destination should be null! ", dest);
}