fix(ui): validate OOBM is enabled before allowing HA on KVM hosts (#13605)#13647
fix(ui): validate OOBM is enabled before allowing HA on KVM hosts (#13605)#13647Chinmay048 wants to merge 5 commits into
Conversation
|
@kiranchavala a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #13647 +/- ##
============================================
- Coverage 19.65% 19.64% -0.01%
+ Complexity 19792 19789 -3
============================================
Files 6368 6368
Lines 575107 575119 +12
Branches 70370 70373 +3
============================================
- Hits 113016 112987 -29
- Misses 449808 449849 +41
Partials 12283 12283
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
UI build: ✔️ |
|
@blueorangutan package |
|
@kiranchavala a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18620 |
|
cc @weizhouapache @winterhazel Consider this UI improvement for the 4.23 release |
kiranchavala
left a comment
There was a problem hiding this comment.
|
@Chinmay048 when admin clicks on Disable OOBM ,cloudstack should thrown a pop-up saying that to Disable HA First Only if the HA is disabled we should allow to disable the OOBM
|
|
Thanks for the review and feedback @kiranchavala! That makes complete sense to guard the teardown flow as well. I am working on updating the Disable OOBM action right now so that if a host currently has High Availability (HA) enabled, the UI will intercept the action and display a warning pop-up instructing the admin to disable HA first before allowing OOBM to be turned off. Will push the commit to this PR shortly! |
586999a to
068213b
Compare
|
@blueorangutan package |
|
@kiranchavala a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
| action.resource = this.resource | ||
| const record = this.resource || this.item | ||
| if (action?.api === 'disableOutOfBandManagementForHost' && (record?.hostha?.haenable === true || record?.hastate === 'Enabled')) { |
| show: (record) => { | ||
| if (record.hypervisor === 'KVM') { | ||
| return Boolean(record?.outofbandmanagement?.enabled) | ||
| } | ||
| return record.hypervisor === 'Simulator' | ||
| }, |
| if (record.hypervisor === 'KVM') { | ||
| return Boolean(record?.outofbandmanagement?.enabled) | ||
| } |
| </template> | ||
|
|
||
| <template v-if="column.key === 'clustername'"> | ||
| <template v-if="column.key === 'clustername'"> |
| <router-link | ||
| v-if="$route.path.startsWith('/quotasummary') && $router.resolve(`${$route.path}/${record.accountid}`).matched[0].redirect !== '/exception/404'" | ||
| v-if="$route.path.startsWith('/quotasummary')" | ||
| :to="{ path: `${$route.path}/${record.accountid}` }">{{ text }}</router-link> |
| <template v-if="text"> | ||
| <template v-if="!text.startsWith('PrjAcct-')"> | ||
| <router-link | ||
| v-if="$route.path.startsWith('/quotasummary') && $router.resolve(`${$route.path}/${record.accountid}`).matched[0].redirect !== '/exception/404'" | ||
| v-if="$route.path.startsWith('/quotasummary')" | ||
| :to="{ path: `${$route.path}/${record.accountid}` }">{{ text }}</router-link> | ||
| <span v-else>{{ text }}</span> | ||
| </template> | ||
| <template v-else> | ||
| <router-link v-else-if="record.accountid" :to="{ path: '/account/' + record.accountid }">{{ text }}</router-link> | ||
| <router-link | ||
| v-if="$route.path.startsWith('/quotasummary') && $router.resolve(`${$route.path}/${record.accountid}`).matched[0].redirect !== '/exception/404'" | ||
| :to="{ path: `${$route.path}/${record.accountid}` }">{{ (record.projectname || record.account).concat(' (').concat($t('label.project')).concat(')') }}</router-link> | ||
| v-else-if="$store.getters.userInfo.roletype !== 'User'" | ||
| :to="{ path: '/account', query: { name: record.account, domainid: record.domainid, dataView: true } }"> | ||
| {{ text }} | ||
| </router-link> | ||
| <span v-else>{{ text }}</span> |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 18634 |
@kiranchavala I intend to cut a RC2 tomorrow around 2026-07-22 16:00 GMT. I will include this patch if it is ready by then. This issue is not major to block 4.23 RC2, as it does not prevent any operations via the UI or result in any bugs. The patch needs some adjustments as well (I'll send some reviews later). |
| </template> | ||
|
|
||
| <template v-if="column.key === 'clustername'"> | ||
| <template v-if="column.key === 'clustername'"> |
There was a problem hiding this comment.
Nit: this line lost its indentation, looks like an accidental de-indent (surrounding <template> blocks are indented 6 spaces).
| if (action?.api === 'disableOutOfBandManagementForHost' && (record?.hostha?.haenable === true || record?.hastate === 'Enabled')) { | ||
| this.$notification.error({ | ||
| message: this.$t('label.error'), | ||
| description: 'Please disable High Availability (HA) on this host before disabling Out-of-Band Management (OOBM).', |
There was a problem hiding this comment.
Nit: hardcoded English string here instead of $t(), rest of the UI runs user-facing messages through i18n.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (3)
ui/src/components/view/ActionButton.vue:181
execActionreferencesthis.item, butActionButtondoesn't define anitemprop/data/computed. This meansrecordwill never fall back to the clicked row item and will also trigger Vue warnings about accessing undefined instance properties. Prefer derivingrecordfromresourceand assigningaction.resourcefrom the same value to keep downstream action handling consistent.
execAction (action) {
action.resource = this.resource
const record = this.resource || this.item
if (action?.api === 'disableOutOfBandManagementForHost' && (record?.hostha?.haenable === true || record?.hastate === 'Enabled')) {
ui/src/components/view/ListView.vue:658
- The
<template v-if="column.key === 'clustername'">line lost its indentation, which makes this block inconsistent with the surrounding template and may violate Vue/ESLint formatting rules.
<template v-if="column.key === 'clustername'">
ui/src/components/view/ListView.vue:696
- The updated account-column rendering has two functional regressions: (1) for
PrjAcct-*values outside/quotasummary, nothing is rendered (nov-elsefallback), leaving the cell blank; (2) the/quotasummarylink is created even whenrecord.accountidis missing and without the previous 404-route guard, which can produce links to invalid routes.
<template v-if="text">
<template v-if="!text.startsWith('PrjAcct-')">
<router-link
v-if="$route.path.startsWith('/quotasummary')"
:to="{ path: `${$route.path}/${record.accountid}` }">{{ text }}</router-link>




Description
Closes #13605
This PR updates the Vue UI infrastructure configuration (
hosts.js) to validate that Out-of-Band Management (OOBM) is active and enabled before allowing administrators to configure or enable High Availability (HA) on KVM hosts. If OOBM is not enabled on a KVM host, the HA action buttons are cleanly hidden to prevent invalid configurations.Types of changes
Feature/Enhancement Scale or Bug Severity
Bug Severity
How Has This Been Tested?
record.outofbandmanagement.enabledis false or undefined, the "Configure HA" and "Enable HA" action buttons are properly hidden.