|
40 | 40 | import javax.inject.Inject; |
41 | 41 | import javax.naming.ConfigurationException; |
42 | 42 |
|
43 | | -import org.apache.log4j.Logger; |
44 | | - |
45 | 43 | import org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDao; |
46 | 44 | import org.apache.cloudstack.context.CallContext; |
47 | 45 | import org.apache.cloudstack.engine.orchestration.service.NetworkOrchestrationService; |
|
70 | 68 | import org.apache.cloudstack.storage.datastore.db.StoragePoolVO; |
71 | 69 | import org.apache.cloudstack.storage.to.VolumeObjectTO; |
72 | 70 | import org.apache.cloudstack.utils.identity.ManagementServerNode; |
| 71 | +import org.apache.log4j.Logger; |
73 | 72 |
|
74 | 73 | import com.cloud.agent.AgentManager; |
75 | 74 | import com.cloud.agent.Listener; |
|
80 | 79 | import com.cloud.agent.api.CheckVirtualMachineCommand; |
81 | 80 | import com.cloud.agent.api.ClusterSyncAnswer; |
82 | 81 | import com.cloud.agent.api.ClusterSyncCommand; |
83 | | -import com.cloud.agent.api.ClusterVMMetaDataSyncCommand; |
84 | 82 | import com.cloud.agent.api.ClusterVMMetaDataSyncAnswer; |
| 83 | +import com.cloud.agent.api.ClusterVMMetaDataSyncCommand; |
85 | 84 | import com.cloud.agent.api.Command; |
86 | 85 | import com.cloud.agent.api.MigrateAnswer; |
87 | 86 | import com.cloud.agent.api.MigrateCommand; |
@@ -608,13 +607,13 @@ protected VirtualMachineManagerImpl() { |
608 | 607 |
|
609 | 608 | @Override |
610 | 609 | public void start(String vmUuid, Map<VirtualMachineProfile.Param, Object> params) { |
611 | | - start(vmUuid, params, null); |
| 610 | + start(vmUuid, params, null, null); |
612 | 611 | } |
613 | 612 |
|
614 | 613 | @Override |
615 | | - public void start(String vmUuid, Map<VirtualMachineProfile.Param, Object> params, DeploymentPlan planToDeploy) { |
| 614 | + public void start(String vmUuid, Map<VirtualMachineProfile.Param, Object> params, DeploymentPlan planToDeploy, DeploymentPlanner planner) { |
616 | 615 | try { |
617 | | - advanceStart(vmUuid, params, planToDeploy, null); |
| 616 | + advanceStart(vmUuid, params, planToDeploy, planner); |
618 | 617 | } catch (ConcurrentOperationException e) { |
619 | 618 | throw new CloudRuntimeException("Unable to start a VM due to concurrent operation", e).add(VirtualMachine.class, vmUuid); |
620 | 619 | } catch (InsufficientCapacityException e) { |
@@ -779,7 +778,7 @@ public void advanceStart(String vmUuid, Map<VirtualMachineProfile.Param, Object> |
779 | 778 | _workJobDao.expunge(placeHolder.getId()); |
780 | 779 | } |
781 | 780 | } else { |
782 | | - Outcome<VirtualMachine> outcome = startVmThroughJobQueue(vmUuid, params, planToDeploy); |
| 781 | + Outcome<VirtualMachine> outcome = startVmThroughJobQueue(vmUuid, params, planToDeploy, planner); |
783 | 782 |
|
784 | 783 | try { |
785 | 784 | VirtualMachine vm = outcome.get(); |
@@ -4451,7 +4450,7 @@ protected VirtualMachine retrieve() { |
4451 | 4450 | // |
4452 | 4451 | public Outcome<VirtualMachine> startVmThroughJobQueue(final String vmUuid, |
4453 | 4452 | final Map<VirtualMachineProfile.Param, Object> params, |
4454 | | - final DeploymentPlan planToDeploy) { |
| 4453 | + final DeploymentPlan planToDeploy, final DeploymentPlanner planner) { |
4455 | 4454 |
|
4456 | 4455 | final CallContext context = CallContext.current(); |
4457 | 4456 | final User callingUser = context.getCallingUser(); |
@@ -4488,6 +4487,9 @@ public Object[] doInTransaction(TransactionStatus status) { |
4488 | 4487 | // save work context info (there are some duplications) |
4489 | 4488 | VmWorkStart workInfo = new VmWorkStart(callingUser.getId(), callingAccount.getId(), vm.getId(), VirtualMachineManagerImpl.VM_WORK_JOB_HANDLER); |
4490 | 4489 | workInfo.setPlan(planToDeploy); |
| 4490 | + if (planner != null) { |
| 4491 | + workInfo.setDeploymentPlanner(planner.getName()); |
| 4492 | + } |
4491 | 4493 | workInfo.setParams(params); |
4492 | 4494 | workJob.setCmdInfo(VmWorkSerializer.serialize(workInfo)); |
4493 | 4495 |
|
@@ -5123,7 +5125,7 @@ private Pair<JobInfo.Status, String> orchestrateStart(VmWorkStart work) throws E |
5123 | 5125 | } |
5124 | 5126 | assert (vm != null); |
5125 | 5127 |
|
5126 | | - orchestrateStart(vm.getUuid(), work.getParams(), work.getPlan(), null); |
| 5128 | + orchestrateStart(vm.getUuid(), work.getParams(), work.getPlan(), _dpMgr.getDeploymentPlannerByName(work.getDeploymentPlanner())); |
5127 | 5129 | return new Pair<JobInfo.Status, String>(JobInfo.Status.SUCCEEDED, null); |
5128 | 5130 | } |
5129 | 5131 |
|
|
0 commit comments