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 will fail when host is not Enabled and not Up. As the
force reboot stops and starts the VM, the start VM would fail, and so it's safe
to not allow when force reboot when host is not Enabled and 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]