Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1399,7 +1399,7 @@
}
if (!BooleanUtils.toBoolean(EnableKVMAutoEnableDisable.valueIn(host.getClusterId()))) {
logger.debug("{} is disabled for the cluster {}, cannot process the health check result " +
"received for the host {}", EnableKVMAutoEnableDisable.key(), host.getClusterId(), host);
"received for {}", EnableKVMAutoEnableDisable.key(), host.getClusterId(), host);

Check warning on line 1402 in engine/orchestration/src/main/java/com/cloud/agent/manager/AgentManagerImpl.java

View check run for this annotation

Codecov / codecov/patch

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

Added line #L1402 was not covered by tests
return;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1840,9 +1840,9 @@
_hostDetailsDao.update(hostDetail.getId(), hostDetail);
} else if (!isUpdateFromHostHealthCheck && hostDetail != null &&
Boolean.parseBoolean(hostDetail.getValue()) && resourceEvent == ResourceState.Event.Disable) {
logger.info(String.format("The setting %s is enabled but the host %s is manually set into %s state," +
logger.info("The setting {} is enabled but {} is manually set into {} state," +

Check warning on line 1843 in server/src/main/java/com/cloud/resource/ResourceManagerImpl.java

View check run for this annotation

Codecov / codecov/patch

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

Added line #L1843 was not covered by tests
"ignoring future auto enabling of the host based on health check results",
AgentManager.EnableKVMAutoEnableDisable.key(), host.getName(), resourceEvent));
AgentManager.EnableKVMAutoEnableDisable.key(), host, resourceEvent);

Check warning on line 1845 in server/src/main/java/com/cloud/resource/ResourceManagerImpl.java

View check run for this annotation

Codecov / codecov/patch

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

Added line #L1845 was not covered by tests
hostDetail.setValue(Boolean.FALSE.toString());
_hostDetailsDao.update(hostDetail.getId(), hostDetail);
} else if (hostDetail == null) {
Expand Down
12 changes: 6 additions & 6 deletions ui/src/views/infra/HostEnableDisable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,15 @@
>
<a-alert type="warning">
<template #message>
<span v-html="$t('message.confirm.enable.host')" />
<span v-html="resourcestate === 'Disabled' ? $t('message.confirm.enable.host') : $t('message.confirm.disable.host') " />
</template>
</a-alert>
<div v-show="enableKVMAutoEnableDisableSetting" class="reason">
<div v-show="kvmAutoEnableDisableSetting" class="reason">
<a-form-item
class="form__item"
name="reason"
ref="reason"
:label="'The setting \'enable.kvm.host.auto.enable.disable\' is enabled, ' +
:label="'The Auto Enable/Disable KVM Hosts functionality is enabled, ' +
' can specify a reason for ' + (resourcestate === 'Enabled' ? 'disabling' : 'enabling') + ' this host'">
<a-textarea
v-model:value="form.reason"
Expand Down Expand Up @@ -69,7 +69,7 @@ export default {
return {
resourcestate: '',
allocationstate: '',
enableKVMAutoEnableDisableSetting: false
kvmAutoEnableDisableSetting: false
}
},
created () {
Expand All @@ -91,8 +91,8 @@ export default {
return
}
api('listConfigurations', { name: 'enable.kvm.host.auto.enable.disable', clusterid: this.resource.clusterid }).then(json => {
if (json.listconfigurationsresponse.configuration[0]) {
this.enableKVMAutoEnableDisableSetting = json.listconfigurationsresponse.configuration[0].value
if (json.listconfigurationsresponse.configuration?.[0]) {
this.kvmAutoEnableDisableSetting = json?.listconfigurationsresponse?.configuration?.[0]?.value || false
}
})
},
Expand Down
Loading