Skip to content

Commit dc1556c

Browse files
lucas-a-martinsLucas Martins
andauthored
Change exception when orchestrating VM start (#9062)
* Remove info about the environment from exception when starting VM * Change to log4j2 syntax --------- Co-authored-by: Lucas Martins <lucas.martins@scclouds.com.br>
1 parent d41dc17 commit dc1556c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

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

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
import org.apache.cloudstack.storage.datastore.db.StoragePoolVO;
9696
import org.apache.cloudstack.storage.to.VolumeObjectTO;
9797
import org.apache.cloudstack.utils.identity.ManagementServerNode;
98+
import org.apache.cloudstack.utils.reflectiontostringbuilderutils.ReflectionToStringBuilderUtils;
9899
import org.apache.cloudstack.vm.UnmanagedVMsManager;
99100
import org.apache.commons.collections.CollectionUtils;
100101
import org.apache.commons.collections.MapUtils;
@@ -5451,9 +5452,9 @@ private Pair<JobInfo.Status, String> orchestrateStart(final VmWorkStart work) th
54515452
try {
54525453
orchestrateStart(vm.getUuid(), work.getParams(), work.getPlan(), _dpMgr.getDeploymentPlannerByName(work.getDeploymentPlanner()));
54535454
} catch (CloudRuntimeException e){
5454-
String message = String.format("Unable to orchestrate start %s due to [%s].", vm.toString(), e.getMessage());
5455-
logger.warn(message, e);
5456-
CloudRuntimeException ex = new CloudRuntimeException(message);
5455+
logger.error("Unable to orchestrate start {} due to [{}].", vm, e.getMessage());
5456+
CloudRuntimeException ex = new CloudRuntimeException(String.format("Unable to orchestrate the start of VM instance %s.",
5457+
ReflectionToStringBuilderUtils.reflectOnlySelectedFields(vm, "instanceName", "uuid")));
54575458
return new Pair<>(JobInfo.Status.FAILED, JobSerializerHelper.toObjectSerializedString(ex));
54585459
}
54595460
return new Pair<>(JobInfo.Status.SUCCEEDED, null);

0 commit comments

Comments
 (0)