mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
CLOUDSTACK-10176: VM Start Api Job returns success for failed Job (#2354)
ISSUE : VM start API Job returns success for failed Job STEPS TO REPRODUCE : Stop VM instance. Mark state of associate router as Stopping from DB Execute startVirtualMachine Api from rest client. VM will not start but still main job will return the status as SUCCEEDED, whereas sub-job for command VmWorkStart will return status as failed.
This commit is contained in:
parent
fc49533a8e
commit
44a7eb0d14
@ -38,6 +38,7 @@ import java.util.concurrent.TimeUnit;
|
||||
import javax.inject.Inject;
|
||||
import javax.naming.ConfigurationException;
|
||||
|
||||
import org.apache.cloudstack.framework.jobs.impl.JobSerializerHelper;
|
||||
import com.cloud.agent.api.AttachOrDettachConfigDriveCommand;
|
||||
import org.apache.cloudstack.affinity.dao.AffinityGroupVMMapDao;
|
||||
import org.apache.cloudstack.ca.CAManager;
|
||||
@ -4730,8 +4731,9 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
|
||||
orchestrateStart(vm.getUuid(), work.getParams(), work.getPlan(), _dpMgr.getDeploymentPlannerByName(work.getDeploymentPlanner()));
|
||||
}
|
||||
catch (CloudRuntimeException e){
|
||||
s_logger.info("Caught CloudRuntimeException, returning job failed");
|
||||
return new Pair<JobInfo.Status, String>(JobInfo.Status.FAILED, null);
|
||||
s_logger.info("Caught CloudRuntimeException, returning job failed " + e);
|
||||
CloudRuntimeException ex = new CloudRuntimeException("Unable to start VM instance");
|
||||
return new Pair<JobInfo.Status, String>(JobInfo.Status.FAILED, JobSerializerHelper.toObjectSerializedString(ex));
|
||||
}
|
||||
return new Pair<JobInfo.Status, String>(JobInfo.Status.SUCCEEDED, null);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user