You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/04/23 20:29:35 UTC
[GitHub] [cloudstack] GutoVeronezi commented on a change in pull request #4722: Externalize config to set min memory/cpu with division by overprovisiā¦
GutoVeronezi commented on a change in pull request #4722:
URL: https://github.com/apache/cloudstack/pull/4722#discussion_r619479420
##########
File path: engine/orchestration/src/main/java/com/cloud/vm/VirtualMachineManagerImpl.java
##########
@@ -4564,18 +4574,23 @@ private VMInstanceVO orchestrateReConfigureVm(final String vmUuid, final Service
_capacityMgr.allocateVmCapacity(vm, false); // lock the new capacity
}
- final Answer reconfigureAnswer = _agentMgr.send(vm.getHostId(), reconfigureCmd);
- if (reconfigureAnswer == null || !reconfigureAnswer.getResult()) {
- s_logger.error("Unable to scale vm due to " + (reconfigureAnswer == null ? "" : reconfigureAnswer.getDetails()));
- throw new CloudRuntimeException("Unable to scale vm due to " + (reconfigureAnswer == null ? "" : reconfigureAnswer.getDetails()));
+ Answer scaleVmAnswer = _agentMgr.send(vm.getHostId(), scaleVmCommand);
+ if (scaleVmAnswer == null || !scaleVmAnswer.getResult()) {
+ String msg = String.format("Unable to scale %s due to [%s].", vm.toString(), (scaleVmAnswer == null ? "" : scaleVmAnswer.getDetails()));
+ s_logger.error(msg);
+ throw new CloudRuntimeException(msg);
}
if (vm.getType().equals(VirtualMachine.Type.User)) {
_userVmMgr.generateUsageEvent(vm, vm.isDisplayVm(), EventTypes.EVENT_VM_DYNAMIC_SCALE);
}
success = true;
- } catch (final OperationTimedoutException e) {
- throw new AgentUnavailableException("Operation timed out on reconfiguring " + vm, dstHostId);
- } catch (final AgentUnavailableException e) {
+ } catch (OperationTimedoutException e) {
+ String msg = String.format("Unable to scale %s due to [%s].", vm.toString(), e.getMessage());
+ s_logger.error(msg, e);
+ throw new AgentUnavailableException(msg, dstHostId);
+ } catch (AgentUnavailableException e) {
+ String msg = String.format("Unable to scale %s due to [%s].", vm.toString(), e.getMessage());
+ s_logger.error(msg, e);
throw e;
} finally {
Review comment:
@DaanHoogland lack of attention, perhaps. Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org