You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by pe...@apache.org on 2024/12/04 16:04:31 UTC

(cloudstack) branch rename-ambiguous-globalsetting created (now 18cfe5696c4)

This is an automated email from the ASF dual-hosted git repository.

pearl11594 pushed a change to branch rename-ambiguous-globalsetting
in repository https://gitbox.apache.org/repos/asf/cloudstack.git


      at 18cfe5696c4 Rename ambiguous global setting: enable.kvm.host.auto.enable.disable

This branch includes the following new commits:

     new 18cfe5696c4 Rename ambiguous global setting: enable.kvm.host.auto.enable.disable

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(cloudstack) 01/01: Rename ambiguous global setting: enable.kvm.host.auto.enable.disable

Posted by pe...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

pearl11594 pushed a commit to branch rename-ambiguous-globalsetting
in repository https://gitbox.apache.org/repos/asf/cloudstack.git

commit 18cfe5696c44abf7be2545845dfde3b4216c24a7
Author: Pearl Dsilva <pe...@gmail.com>
AuthorDate: Wed Dec 4 11:04:15 2024 -0500

    Rename ambiguous global setting: enable.kvm.host.auto.enable.disable
---
 .../src/main/java/com/cloud/agent/AgentManager.java            |  4 ++--
 .../main/java/com/cloud/agent/manager/AgentManagerImpl.java    |  6 +++---
 .../src/main/java/com/cloud/resource/ResourceManagerImpl.java  | 10 +++++-----
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/engine/components-api/src/main/java/com/cloud/agent/AgentManager.java b/engine/components-api/src/main/java/com/cloud/agent/AgentManager.java
index 2182dfc542d..ba802db75c3 100644
--- a/engine/components-api/src/main/java/com/cloud/agent/AgentManager.java
+++ b/engine/components-api/src/main/java/com/cloud/agent/AgentManager.java
@@ -39,8 +39,8 @@ import com.cloud.resource.ServerResource;
 public interface AgentManager {
     static final ConfigKey<Integer> Wait = new ConfigKey<Integer>("Advanced", Integer.class, "wait", "1800", "Time in seconds to wait for control commands to return",
             true);
-    ConfigKey<Boolean> EnableKVMAutoEnableDisable = new ConfigKey<>(Boolean.class,
-                    "enable.kvm.host.auto.enable.disable",
+    ConfigKey<Boolean> EnableKVMAutoEnable = new ConfigKey<>(Boolean.class,
+                    "enable.kvm.host.auto.enable",
                     "Advanced",
                     "false",
                     "(KVM only) Enable Auto Disable/Enable KVM hosts in the cluster " +
diff --git a/engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java b/engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java
index 606a902dce7..758f48ebd67 100644
--- a/engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java
+++ b/engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java
@@ -1293,9 +1293,9 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl
                 s_logger.error(String.format("Unable to find host with ID: %s", hostId));
                 return;
             }
-            if (!BooleanUtils.toBoolean(EnableKVMAutoEnableDisable.valueIn(host.getClusterId()))) {
+            if (!BooleanUtils.toBoolean(EnableKVMAutoEnable.valueIn(host.getClusterId()))) {
                 s_logger.debug(String.format("%s is disabled for the cluster %s, cannot process the health check result " +
-                        "received for the host %s", EnableKVMAutoEnableDisable.key(), host.getClusterId(), host.getName()));
+                        "received for the host %s", EnableKVMAutoEnable.key(), host.getClusterId(), host.getName()));
                 return;
             }
 
@@ -1838,7 +1838,7 @@ public class AgentManagerImpl extends ManagerBase implements AgentManager, Handl
     @Override
     public ConfigKey<?>[] getConfigKeys() {
         return new ConfigKey<?>[] { CheckTxnBeforeSending, Workers, Port, Wait, AlertWait, DirectAgentLoadSize,
-                DirectAgentPoolSize, DirectAgentThreadCap, EnableKVMAutoEnableDisable, ReadyCommandWait };
+                DirectAgentPoolSize, DirectAgentThreadCap, EnableKVMAutoEnable, ReadyCommandWait };
     }
 
     protected class SetHostParamsListener implements Listener {
diff --git a/server/src/main/java/com/cloud/resource/ResourceManagerImpl.java b/server/src/main/java/com/cloud/resource/ResourceManagerImpl.java
index 5ba79c2d7bd..dc003b21d24 100755
--- a/server/src/main/java/com/cloud/resource/ResourceManagerImpl.java
+++ b/server/src/main/java/com/cloud/resource/ResourceManagerImpl.java
@@ -1834,7 +1834,7 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
                     Boolean.parseBoolean(hostDetail.getValue()) && resourceEvent == ResourceState.Event.Disable) {
                 s_logger.info(String.format("The setting %s is enabled but the host %s is manually set into %s state," +
                                 "ignoring future auto enabling of the host based on health check results",
-                        AgentManager.EnableKVMAutoEnableDisable.key(), host.getName(), resourceEvent));
+                        AgentManager.EnableKVMAutoEnable.key(), host.getName(), resourceEvent));
                 hostDetail.setValue(Boolean.FALSE.toString());
                 _hostDetailsDao.update(hostDetail.getId(), hostDetail);
             } else if (hostDetail == null) {
@@ -1846,7 +1846,7 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
     }
     private boolean updateHostAllocationState(HostVO host, String allocationState,
                                            boolean isUpdateFromHostHealthCheck) throws NoTransitionException {
-        boolean autoEnableDisableKVMSetting = AgentManager.EnableKVMAutoEnableDisable.valueIn(host.getClusterId()) &&
+        boolean autoEnableDisableKVMSetting = AgentManager.EnableKVMAutoEnable.valueIn(host.getClusterId()) &&
                 host.getHypervisorType() == HypervisorType.KVM;
         ResourceState.Event resourceEvent = getResourceEventFromAllocationStateString(allocationState);
         DetailVO hostDetail = _hostDetailsDao.findDetail(host.getId(), ApiConstants.AUTO_ENABLE_KVM_HOST);
@@ -1860,7 +1860,7 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
         if (isAutoEnableAttemptForADisabledHost(autoEnableDisableKVMSetting, isUpdateFromHostHealthCheck, hostDetail, resourceEvent)) {
             s_logger.debug(String.format("The setting '%s' is enabled and the health check succeeds on the host, " +
                             "but the host has been manually disabled previously, ignoring auto enabling",
-                    AgentManager.EnableKVMAutoEnableDisable.key()));
+                    AgentManager.EnableKVMAutoEnable.key()));
             return false;
         }
 
@@ -1974,7 +1974,7 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
                                                                           boolean isUpdateFromHostHealthCheck,
                                                                           boolean isUpdateHostAllocation, String annotation) {
         boolean isAutoEnableDisableKVMSettingEnabled = host.getHypervisorType() == HypervisorType.KVM &&
-                AgentManager.EnableKVMAutoEnableDisable.valueIn(host.getClusterId());
+                AgentManager.EnableKVMAutoEnable.valueIn(host.getClusterId());
         if (!isAutoEnableDisableKVMSettingEnabled) {
             if (StringUtils.isNotBlank(annotation)) {
                 annotationService.addAnnotation(annotation, AnnotationService.EntityType.HOST, host.getUuid(), true);
@@ -1998,7 +1998,7 @@ public class ResourceManagerImpl extends ManagerBase implements ResourceManager,
                     host.getPodId(), msg, msg);
         } else {
             msg += String.format("is %s despite the setting '%s' is enabled for the cluster %s",
-                    isEventEnable ? "enabled" : "disabled", AgentManager.EnableKVMAutoEnableDisable.key(),
+                    isEventEnable ? "enabled" : "disabled", AgentManager.EnableKVMAutoEnable.key(),
                     host.getClusterId());
             if (StringUtils.isNotBlank(annotation)) {
                 msg += String.format(", reason: %s", annotation);