4242
4343import org .apache .log4j .Logger ;
4444
45- import com .cloud .deploy .DeploymentPlanner ;
4645import org .apache .cloudstack .affinity .dao .AffinityGroupVMMapDao ;
4746import org .apache .cloudstack .context .CallContext ;
4847import 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 ;
0 commit comments