Skip to content

Commit afcf967

Browse files
committed
Revert "CLOUDSTACK-4941:"
This reverts commit 231e7c0.
1 parent bb91b73 commit afcf967

22 files changed

Lines changed: 56 additions & 275 deletions

File tree

api/src/com/cloud/deploy/HAPlanner.java

Lines changed: 0 additions & 21 deletions
This file was deleted.

client/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,11 +176,6 @@
176176
<artifactId>cloud-plugin-planner-user-dispersing</artifactId>
177177
<version>${project.version}</version>
178178
</dependency>
179-
<dependency>
180-
<groupId>org.apache.cloudstack</groupId>
181-
<artifactId>cloud-plugin-planner-skip-heurestics</artifactId>
182-
<version>${project.version}</version>
183-
</dependency>
184179
<dependency>
185180
<groupId>org.apache.cloudstack</groupId>
186181
<artifactId>cloud-plugin-planner-user-concentrated-pod</artifactId>

core/resources/META-INF/cloudstack/core/spring-core-registry-core-context.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,6 @@
7777
<property name="excludeKey" value="deployment.planners.exclude" />
7878
</bean>
7979

80-
<bean id="haPlannersRegistry"
81-
class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
82-
<property name="excludeKey" value="ha.planners.exclude" />
83-
</bean>
84-
8580
<bean id="podAllocatorsRegistry"
8681
class="org.apache.cloudstack.spring.lifecycle.registry.ExtensionRegistry">
8782
<property name="excludeKey" value="pod.allocators.exclude" />

core/resources/META-INF/cloudstack/planner/spring-core-lifecycle-planner-context-inheritable.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,4 @@
3838
value="org.apache.cloudstack.affinity.AffinityGroupProcessor" />
3939
</bean>
4040

41-
<bean class="org.apache.cloudstack.spring.lifecycle.registry.RegistryLifecycle">
42-
<property name="registry" ref="haPlannersRegistry" />
43-
<property name="typeClass" value="com.cloud.deploy.HAPlanner" />
44-
</bean>
45-
4641
</beans>

engine/api/src/com/cloud/vm/VirtualMachineManager.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,10 @@ void allocate(String vmInstanceName, VirtualMachineTemplate template, ServiceOff
9393

9494
boolean stateTransitTo(VirtualMachine vm, VirtualMachine.Event e, Long hostId) throws NoTransitionException;
9595

96-
void advanceStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params, DeploymentPlanner planner) throws InsufficientCapacityException, ResourceUnavailableException,
97-
ConcurrentOperationException, OperationTimedoutException;
98-
99-
void advanceStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params, DeploymentPlan planToDeploy, DeploymentPlanner planner) throws InsufficientCapacityException,
100-
ResourceUnavailableException, ConcurrentOperationException, OperationTimedoutException;
96+
void advanceStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params) throws InsufficientCapacityException, ResourceUnavailableException,
97+
ConcurrentOperationException, OperationTimedoutException;
10198

102-
void orchestrateStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params, DeploymentPlan planToDeploy, DeploymentPlanner planner) throws InsufficientCapacityException,
99+
void advanceStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params, DeploymentPlan planToDeploy) throws InsufficientCapacityException,
103100
ResourceUnavailableException, ConcurrentOperationException, OperationTimedoutException;
104101

105102
void advanceStop(String vmUuid, boolean cleanupEvenIfUnableToStop) throws ResourceUnavailableException, OperationTimedoutException, ConcurrentOperationException;
@@ -108,7 +105,7 @@ void orchestrateStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> pa
108105

109106
void destroy(String vmUuid) throws AgentUnavailableException, OperationTimedoutException, ConcurrentOperationException;
110107

111-
void migrateAway(String vmUuid, long hostId, DeploymentPlanner planner) throws InsufficientServerCapacityException;
108+
void migrateAway(String vmUuid, long hostId) throws InsufficientServerCapacityException;
112109

113110
void migrate(String vmUuid, long srcHostId, DeployDestination dest) throws ResourceUnavailableException, ConcurrentOperationException;
114111

engine/components-api/src/com/cloud/deploy/DeploymentPlanningManager.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,11 @@ public interface DeploymentPlanningManager extends Manager {
3939
*
4040
*
4141
*/
42-
DeployDestination planDeployment(VirtualMachineProfile vmProfile, DeploymentPlan plan,
43-
ExcludeList avoids, DeploymentPlanner planner) throws InsufficientServerCapacityException, AffinityConflictException;
42+
DeployDestination planDeployment(VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoids) throws InsufficientServerCapacityException,
43+
AffinityConflictException;
4444

45-
String finalizeReservation(DeployDestination plannedDestination,
46-
VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoids)
47-
throws InsufficientServerCapacityException, AffinityConflictException;
45+
String finalizeReservation(DeployDestination plannedDestination, VirtualMachineProfile vmProfile, DeploymentPlan plan, ExcludeList avoids)
46+
throws InsufficientServerCapacityException, AffinityConflictException;
4847

4948
void cleanupVMReservations();
5049
}

engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242

4343
import org.apache.log4j.Logger;
4444

45-
import com.cloud.deploy.DeploymentPlanner;
4645
import org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDao;
4746
import org.apache.cloudstack.context.CallContext;
4847
import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService;
@@ -560,7 +559,7 @@ public void start(String vmUuid, Map<VirtualMachineProfile.Param, Object> params
560559
@Override
561560
public void start(String vmUuid, Map<VirtualMachineProfile.Param, Object> params, DeploymentPlan planToDeploy) {
562561
try {
563-
advanceStart(vmUuid, params, planToDeploy, null);
562+
advanceStart(vmUuid, params, planToDeploy);
564563
} catch (ConcurrentOperationException e) {
565564
throw new CloudRuntimeException("Unable to start a VM due to concurrent operation", e).add(VirtualMachine.class, vmUuid);
566565
} catch (InsufficientCapacityException e) {
@@ -701,19 +700,20 @@ protected boolean areAffinityGroupsAssociated(VirtualMachineProfile vmProfile) {
701700
}
702701

703702
@Override
704-
public void advanceStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params, DeploymentPlanner planner)
703+
public void advanceStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params)
705704
throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException {
706-
advanceStart(vmUuid, params, null, planner);
705+
706+
advanceStart(vmUuid, params, null);
707707
}
708708

709709
@Override
710-
public void advanceStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params, DeploymentPlan planToDeploy, DeploymentPlanner planner) throws InsufficientCapacityException,
710+
public void advanceStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params, DeploymentPlan planToDeploy) throws InsufficientCapacityException,
711711
ConcurrentOperationException, ResourceUnavailableException {
712712

713713
AsyncJobExecutionContext jobContext = AsyncJobExecutionContext.getCurrentExecutionContext();
714714
if (!VmJobEnabled.value() || jobContext.isJobDispatchedBy(VmWorkJobDispatcher.VM_WORK_JOB_DISPATCHER)) {
715715
// avoid re-entrance
716-
orchestrateStart(vmUuid, params, planToDeploy, planner);
716+
orchestrateStart(vmUuid, params, planToDeploy);
717717
} else {
718718
Outcome<VirtualMachine> outcome = startVmThroughJobQueue(vmUuid, params, planToDeploy);
719719

@@ -735,10 +735,8 @@ else if (jobException instanceof ResourceUnavailableException)
735735
}
736736
}
737737

738-
739-
@Override
740-
public void orchestrateStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params, DeploymentPlan planToDeploy, DeploymentPlanner planner)
741-
throws InsufficientCapacityException, ConcurrentOperationException, ResourceUnavailableException {
738+
private void orchestrateStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> params, DeploymentPlan planToDeploy) throws InsufficientCapacityException,
739+
ConcurrentOperationException, ResourceUnavailableException {
742740

743741
CallContext cctxt = CallContext.current();
744742
Account account = cctxt.getCallingAccount();
@@ -856,7 +854,7 @@ public void orchestrateStart(String vmUuid, Map<VirtualMachineProfile.Param, Obj
856854
VirtualMachineProfileImpl vmProfile = new VirtualMachineProfileImpl(vm, template, offering, owner, params);
857855
DeployDestination dest = null;
858856
try {
859-
dest = _dpMgr.planDeployment(vmProfile, plan, avoids, planner);
857+
dest = _dpMgr.planDeployment(vmProfile, plan, avoids);
860858
} catch (AffinityConflictException e2) {
861859
s_logger.warn("Unable to create deployment, affinity rules associted to the VM conflict", e2);
862860
throw new CloudRuntimeException("Unable to create deployment, affinity rules associted to the VM conflict");
@@ -2039,7 +2037,7 @@ protected void cancelWorkItems(long nodeId) {
20392037
}
20402038

20412039
@Override
2042-
public void migrateAway(String vmUuid, long srcHostId, DeploymentPlanner planner) throws InsufficientServerCapacityException {
2040+
public void migrateAway(String vmUuid, long srcHostId) throws InsufficientServerCapacityException {
20432041
VMInstanceVO vm = _vmDao.findByUuid(vmUuid);
20442042
if (vm == null) {
20452043
s_logger.debug("Unable to find a VM for " + vmUuid);
@@ -2072,7 +2070,7 @@ public void migrateAway(String vmUuid, long srcHostId, DeploymentPlanner planner
20722070
while (true) {
20732071

20742072
try {
2075-
dest = _dpMgr.planDeployment(profile, plan, excludes, planner);
2073+
dest = _dpMgr.planDeployment(profile, plan, excludes);
20762074
} catch (AffinityConflictException e2) {
20772075
s_logger.warn("Unable to create deployment, affinity rules associted to the VM conflict", e2);
20782076
throw new CloudRuntimeException("Unable to create deployment, affinity rules associted to the VM conflict");
@@ -3394,7 +3392,7 @@ public void findHostAndMigrate(String vmUuid, Long newSvcOfferingId, ExcludeList
33943392
DeployDestination dest = null;
33953393

33963394
try {
3397-
dest = _dpMgr.planDeployment(profile, plan, excludes, null);
3395+
dest = _dpMgr.planDeployment(profile, plan, excludes);
33983396
} catch (AffinityConflictException e2) {
33993397
s_logger.warn("Unable to create deployment, affinity rules associted to the VM conflict", e2);
34003398
throw new CloudRuntimeException("Unable to create deployment, affinity rules associted to the VM conflict");
@@ -4714,7 +4712,7 @@ public Pair<JobInfo.Status, String> handleVmWorkJob(AsyncJob job, VmWork work) t
47144712
assert (vm != null);
47154713
if (work instanceof VmWorkStart) {
47164714
VmWorkStart workStart = (VmWorkStart)work;
4717-
orchestrateStart(vm.getUuid(), workStart.getParams(), workStart.getPlan(), null);
4715+
orchestrateStart(vm.getUuid(), workStart.getParams(), workStart.getPlan());
47184716
return new Pair<JobInfo.Status, String>(JobInfo.Status.SUCCEEDED, null);
47194717
} else if (work instanceof VmWorkStop) {
47204718
VmWorkStop workStop = (VmWorkStop)work;

engine/orchestration/src/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ public String reserveVirtualMachine(VMEntityVO vmEntityVO, String plannerToUse,
189189
while (true) {
190190
DeployDestination dest = null;
191191
try {
192-
dest = _dpMgr.planDeployment(vmProfile, plan, exclude, null);
192+
dest = _dpMgr.planDeployment(vmProfile, plan, exclude);
193193
} catch (AffinityConflictException e) {
194194
throw new CloudRuntimeException("Unable to create deployment, affinity rules associted to the VM conflict");
195195
}

plugins/ha-planners/skip-heurestics/pom.xml

Lines changed: 0 additions & 29 deletions
This file was deleted.

plugins/ha-planners/skip-heurestics/resources/META-INF/cloudstack/skip-heurestics/module.properties

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)