Skip to content

Commit cf66aa2

Browse files
committed
Do not rename the setting
1 parent 517ba7c commit cf66aa2

File tree

5 files changed

+12
-14
lines changed

5 files changed

+12
-14
lines changed

engine/components-api/src/main/java/com/cloud/agent/AgentManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@
3939
public interface AgentManager {
4040
static final ConfigKey<Integer> Wait = new ConfigKey<Integer>("Advanced", Integer.class, "wait", "1800", "Time in seconds to wait for control commands to return",
4141
true);
42-
ConfigKey<Boolean> KVMAutoEnableDisable = new ConfigKey<>(Boolean.class,
43-
"kvm.host.auto.enable.disable",
42+
ConfigKey<Boolean> EnableKVMAutoEnableDisable = new ConfigKey<>(Boolean.class,
43+
"enable.kvm.host.auto.enable.disable",
4444
"Advanced",
4545
"false",
4646
"(KVM only) Enable Auto Disable/Enable KVM hosts in the cluster " +

engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1398,9 +1398,9 @@ private void processHostHealthCheckResult(Boolean hostHealthCheckResult, long ho
13981398
return;
13991399
}
14001400

1401-
if (!BooleanUtils.toBoolean(KVMAutoEnableDisable.valueIn(host.getClusterId()))) {
1401+
if (!BooleanUtils.toBoolean(EnableKVMAutoEnableDisable.valueIn(host.getClusterId()))) {
14021402
logger.debug("{} is disabled for the cluster {}, cannot process the health check result " +
1403-
"received for the host %s", KVMAutoEnableDisable.key(), host.getClusterId(), host.getName());
1403+
"received for the host %s", EnableKVMAutoEnableDisable.key(), host.getClusterId(), host.getName());
14041404
return;
14051405
}
14061406

@@ -1958,7 +1958,7 @@ public String getConfigComponentName() {
19581958
@Override
19591959
public ConfigKey<?>[] getConfigKeys() {
19601960
return new ConfigKey<?>[] { CheckTxnBeforeSending, Workers, Port, Wait, AlertWait, DirectAgentLoadSize,
1961-
DirectAgentPoolSize, DirectAgentThreadCap, KVMAutoEnableDisable, ReadyCommandWait,
1961+
DirectAgentPoolSize, DirectAgentThreadCap, EnableKVMAutoEnableDisable, ReadyCommandWait,
19621962
GranularWaitTimeForCommands, RemoteAgentSslHandshakeTimeout, RemoteAgentMaxConcurrentNewConnections };
19631963
}
19641964

engine/schema/src/main/resources/META-INF/db/schema-42000to42010.sql

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,6 @@ CALL `cloud`.`IDEMPOTENT_ADD_FOREIGN_KEY`('cloud.mshost_peer', 'fk_mshost_peer__
4242
-- Add last_id to the volumes table
4343
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.volumes', 'last_id', 'bigint(20) unsigned DEFAULT NULL');
4444

45-
UPDATE `cloud`.`configuration` set name = "kvm.host.auto.enable.disable" where name = "enable.kvm.host.auto.enable.disable";
46-
4745
-- Add used_iops column to support IOPS data in storage stats
4846
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.storage_pool', 'used_iops', 'bigint unsigned DEFAULT NULL COMMENT "IOPS currently in use for this storage pool" ');
4947

server/src/main/java/com/cloud/resource/ResourceManagerImpl.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1840,9 +1840,9 @@ private void handleAutoEnableDisableKVMHost(boolean autoEnableDisableKVMSetting,
18401840
_hostDetailsDao.update(hostDetail.getId(), hostDetail);
18411841
} else if (!isUpdateFromHostHealthCheck && hostDetail != null &&
18421842
Boolean.parseBoolean(hostDetail.getValue()) && resourceEvent == ResourceState.Event.Disable) {
1843-
logger.info(String.format("The setting %s is enabled but the host %s is manually set into %s state," +
1843+
logger.info("The setting {} is enabled but the host {} is manually set into {} state," +
18441844
"ignoring future auto enabling of the host based on health check results",
1845-
AgentManager.KVMAutoEnableDisable.key(), host.getName(), resourceEvent));
1845+
AgentManager.EnableKVMAutoEnableDisable.key(), host.getName(), resourceEvent);
18461846
hostDetail.setValue(Boolean.FALSE.toString());
18471847
_hostDetailsDao.update(hostDetail.getId(), hostDetail);
18481848
} else if (hostDetail == null) {
@@ -1854,7 +1854,7 @@ private void handleAutoEnableDisableKVMHost(boolean autoEnableDisableKVMSetting,
18541854
}
18551855
private boolean updateHostAllocationState(HostVO host, String allocationState,
18561856
boolean isUpdateFromHostHealthCheck) throws NoTransitionException {
1857-
boolean autoEnableDisableKVMSetting = AgentManager.KVMAutoEnableDisable.valueIn(host.getClusterId()) &&
1857+
boolean autoEnableDisableKVMSetting = AgentManager.EnableKVMAutoEnableDisable.valueIn(host.getClusterId()) &&
18581858
host.getHypervisorType() == HypervisorType.KVM;
18591859
ResourceState.Event resourceEvent = getResourceEventFromAllocationStateString(allocationState);
18601860
DetailVO hostDetail = _hostDetailsDao.findDetail(host.getId(), ApiConstants.AUTO_ENABLE_KVM_HOST);
@@ -1868,7 +1868,7 @@ private boolean updateHostAllocationState(HostVO host, String allocationState,
18681868
if (isAutoEnableAttemptForADisabledHost(autoEnableDisableKVMSetting, isUpdateFromHostHealthCheck, hostDetail, resourceEvent)) {
18691869
logger.debug(String.format("The setting '%s' is enabled and the health check succeeds on the host, " +
18701870
"but the host has been manually disabled previously, ignoring auto enabling",
1871-
AgentManager.KVMAutoEnableDisable.key()));
1871+
AgentManager.EnableKVMAutoEnableDisable.key()));
18721872
return false;
18731873
}
18741874

@@ -1982,7 +1982,7 @@ private void sendAlertAndAnnotationForAutoEnableDisableKVMHostFeature(HostVO hos
19821982
boolean isUpdateFromHostHealthCheck,
19831983
boolean isUpdateHostAllocation, String annotation) {
19841984
boolean isAutoEnableDisableKVMSettingEnabled = host.getHypervisorType() == HypervisorType.KVM &&
1985-
AgentManager.KVMAutoEnableDisable.valueIn(host.getClusterId());
1985+
AgentManager.EnableKVMAutoEnableDisable.valueIn(host.getClusterId());
19861986
if (!isAutoEnableDisableKVMSettingEnabled) {
19871987
if (StringUtils.isNotBlank(annotation)) {
19881988
annotationService.addAnnotation(annotation, AnnotationService.EntityType.HOST, host.getUuid(), true);
@@ -2006,7 +2006,7 @@ private void sendAlertAndAnnotationForAutoEnableDisableKVMHostFeature(HostVO hos
20062006
host.getPodId(), msg, msg);
20072007
} else {
20082008
msg += String.format("is %s despite the setting '%s' is enabled for the cluster %s",
2009-
isEventEnable ? "enabled" : "disabled", AgentManager.KVMAutoEnableDisable.key(),
2009+
isEventEnable ? "enabled" : "disabled", AgentManager.EnableKVMAutoEnableDisable.key(),
20102010
host.getClusterId());
20112011
if (StringUtils.isNotBlank(annotation)) {
20122012
msg += String.format(", reason: %s", annotation);

ui/src/views/infra/HostEnableDisable.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
class="form__item"
3737
name="reason"
3838
ref="reason"
39-
:label="'The setting \'kvm.host.auto.enable.disable\' is enabled, ' +
39+
:label="'The Auto Enable/Disable KVM Hosts functionality is enabled, ' +
4040
' can specify a reason for ' + (resourcestate === 'Enabled' ? 'disabling' : 'enabling') + ' this host'">
4141
<a-textarea
4242
v-model:value="form.reason"

0 commit comments

Comments
 (0)