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/02/11 08:59:45 UTC

[GitHub] [cloudstack] sureshanaparti commented on a change in pull request #4681: Use ACPI event to reboot VM on KVM, and Use 'forced' reboot option to stop and start the VM

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:
users@infra.apache.org