sureshanaparti commented on a change in pull request #4681:
URL: https://github.com/apache/cloudstack/pull/4681#discussion_r574335490
##########
File path: server/src/main/java/com/cloud/vm/UserVmManagerImpl.java
##########
@@ -964,6 +964,15 @@ private UserVm rebootVirtualMachine(long userId, long
vmId, boolean enterSetup)
if (vm.getState() == State.Running && vm.getHostId() != null) {
collectVmDiskStatistics(vm);
collectVmNetworkStatistics(vm);
+
+ if (forced) {
+ Host vmOnHost = _hostDao.findById(vm.getHostId());
+ if (vmOnHost == null || vmOnHost.getResourceState() !=
ResourceState.Enabled || vmOnHost.getStatus() != Status.Up ) {
Review comment:
@rhtyd Start VM can fail (or) either pick another host when the VM's
host is not Enabled / not Up. As the force reboot stops and starts the VM,
there are chances that start VM would fail in that case, and so it's safe to
not allow when force reboot when host is not Enabled / not Up.
----------------------------------------------------------------
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:
[email protected]