diff --git a/server/src/com/cloud/configuration/Config.java b/server/src/com/cloud/configuration/Config.java index aee5fd1be72..190de310710 100755 --- a/server/src/com/cloud/configuration/Config.java +++ b/server/src/com/cloud/configuration/Config.java @@ -194,7 +194,8 @@ public enum Config { CapacitySkipcountingHours("Advanced", ManagementServer.class, Integer.class, "capacity.skipcounting.hours", "3600", "Time (in seconds) to wait before release VM's cpu and memory when VM in stopped state", null), VmStatsInterval("Advanced", ManagementServer.class, Integer.class, "vm.stats.interval", "60000", "The interval (in milliseconds) when vm stats are retrieved from agents.", null), VmTransitionWaitInterval("Advanced", ManagementServer.class, Integer.class, "vm.tranisition.wait.interval", "3600", "Time (in seconds) to wait before taking over a VM in transition state", null), - + VmDestroyForcestop("Advanced", ManagementServer.class, Boolean.class, "vm.destory.forcestop", "false", "On destory, force-stop takes this value ", null), + ControlCidr("Advanced", ManagementServer.class, String.class, "control.cidr", "169.254.0.0/16", "Changes the cidr for the control network traffic. Defaults to using link local. Must be unique within pods", null), ControlGateway("Advanced", ManagementServer.class, String.class, "control.gateway", "169.254.0.1", "gateway for the control network traffic", null), UseUserConcentratedPodAllocation("Advanced", ManagementServer.class, Boolean.class, "use.user.concentrated.pod.allocation", "true", "If true, deployment planner applies the user concentration heuristic during VM resource allocation", "true,false"), diff --git a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java index 2506606e8c8..b89574351dd 100755 --- a/server/src/com/cloud/vm/VirtualMachineManagerImpl.java +++ b/server/src/com/cloud/vm/VirtualMachineManagerImpl.java @@ -215,6 +215,8 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene protected StoragePoolDao _storagePoolDao; @Inject protected HypervisorGuruManager _hvGuruMgr; + @Inject + protected ConfigurationDao _configDao; @Inject(adapter = DeploymentPlanner.class) protected Adapters _planners; @@ -1138,8 +1140,8 @@ public class VirtualMachineManagerImpl implements VirtualMachineManager, Listene } return true; } - - if (!advanceStop(vm, false, user, caller)) { + boolean forceStop = Boolean.parseBoolean(_configDao.getValue("vm.destory.forcestop")); + if (!advanceStop(vm, forceStop, user, caller)) { s_logger.debug("Unable to stop " + vm); return false; }