Skip to content

fix(ui): validate OOBM is enabled before allowing HA on KVM hosts (#13605) - #13647

Open
Chinmay048 wants to merge 5 commits into
apache:4.20from
Chinmay048:fix-13605-kvm-ha-oobm
Open

fix(ui): validate OOBM is enabled before allowing HA on KVM hosts (#13605)#13647
Chinmay048 wants to merge 5 commits into
apache:4.20from
Chinmay048:fix-13605-kvm-ha-oobm

Conversation

@Chinmay048

Copy link
Copy Markdown
Contributor

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

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)

Feature/Enhancement Scale or Bug Severity

Bug Severity

  • Blocker
  • Critical
  • Major
  • Minor
  • Trivial

How Has This Been Tested?

  • Verified in the Vue UI that for KVM hosts where record.outofbandmanagement.enabled is false or undefined, the "Configure HA" and "Enable HA" action buttons are properly hidden.
  • Verified that KVM hosts with active OOBM configurations (and Simulator hosts) continue to display the HA action buttons normally.

Copilot AI lite review requested due to automatic review settings July 19, 2026 18:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@kiranchavala

Copy link
Copy Markdown
Member

@blueorangutan ui

@codecov

codecov Bot commented Jul 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 17.20%. Comparing base (549daae) to head (9cdb779).
⚠️ Report is 29 commits behind head on 4.20.

Files with missing lines Patch % Lines
...nagement/DisableOutOfBandManagementForHostCmd.java 0.00% 6 Missing ⚠️
...ck/api/command/admin/ha/ConfigureHAForHostCmd.java 0.00% 3 Missing ⚠️
...stack/api/command/admin/ha/EnableHAForHostCmd.java 0.00% 3 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               4.20   #13647      +/-   ##
============================================
+ Coverage     16.26%   17.20%   +0.94%     
- Complexity    13434    13574     +140     
============================================
  Files          5667     5264     -403     
  Lines        500731   468353   -32378     
  Branches      60803    55012    -5791     
============================================
- Hits          81455    80596     -859     
+ Misses       410172   378748   -31424     
+ Partials       9104     9009      -95     
Flag Coverage Δ
uitests ?
unittests 17.20% <0.00%> (+0.08%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@kiranchavala

Copy link
Copy Markdown
Member

@blueorangutan package

@kiranchavala

kiranchavala commented Jul 21, 2026

Copy link
Copy Markdown
Member

cc @weizhouapache @winterhazel

Consider this UI improvement for the 4.23 release

@kiranchavala kiranchavala left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

Message when user tries to Enable OOBM

Image

Message when user tries to Enable HA

Image

Wondering if we should Disable HA when OOBM is also disabled

Image

cc @sureshanaparti

@kiranchavala

kiranchavala commented Jul 21, 2026

Copy link
Copy Markdown
Member

@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

Screenshot 2026-07-21 at 2 49 52 PM

Copilot AI review requested due to automatic review settings July 21, 2026 10:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Chinmay048

Copy link
Copy Markdown
Contributor Author

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!

@Chinmay048
Chinmay048 force-pushed the fix-13605-kvm-ha-oobm branch from 586999a to 068213b Compare July 21, 2026 10:36
Copilot AI review requested due to automatic review settings July 21, 2026 10:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@kiranchavala

Copy link
Copy Markdown
Member

@blueorangutan package

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

Comment thread ui/src/components/view/ActionButton.vue Outdated
Comment thread ui/src/config/section/infra/hosts.js Outdated
Comment thread ui/src/config/section/infra/hosts.js Outdated
Comment thread ui/src/components/view/ListView.vue Outdated
Comment thread ui/src/components/view/ListView.vue Outdated
Comment thread ui/src/components/view/ListView.vue Outdated
@winterhazel

Copy link
Copy Markdown
Member

cc @weizhouapache @winterhazel

Consider this UI improvement for the 4.23 release

@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).

Comment thread ui/src/components/view/ListView.vue Outdated
Comment thread ui/src/components/view/ActionButton.vue Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

  • execAction references this.item, but ActionButton doesn't define an item prop/data/computed. This means record will never fall back to the clicked row item and will also trigger Vue warnings about accessing undefined instance properties. Prefer deriving record from resource and assigning action.resource from 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 (no v-else fallback), leaving the cell blank; (2) the /quotasummary link is created even when record.accountid is 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>

@winterhazel winterhazel left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Chinmay048 I left a few comments. I think this can go into 4.20.4 too, could you check and rebase into branch 4.20 if that is indeed the case?

Also, it would be nice to add the same checks to the enableHAForHost, configureHAForHost and disableOutOfBandManagementForHost APIs.

Comment thread ui/src/components/view/ListView.vue
Comment thread ui/src/components/view/ActionButton.vue Outdated
Comment thread ui/src/config/section/infra/hosts.js Outdated
Comment thread ui/src/config/section/infra/hosts.js Outdated
@Chinmay048
Chinmay048 force-pushed the fix-13605-kvm-ha-oobm branch from 068213b to 4c78cd7 Compare July 22, 2026 13:46
Copilot AI review requested due to automatic review settings July 22, 2026 13:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Chinmay048

Copy link
Copy Markdown
Contributor Author

I have pushed a new update to enforce the backend API validation. The DisableOutOfBandManagementForHostCmd now correctly checks haConfigManager.listHAResources to prevent disabling OOBM if HA is active on a KVM host. All local Checkstyle and compilation errors have been resolved. Waiting on the CI simulator tests to complete!

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan test

@kiranchavala

Copy link
Copy Markdown
Member

@blueorangutan ui

@kiranchavala

Copy link
Copy Markdown
Member

@Chinmay048 @sureshanaparti

can you take a look at the smoke test failures related to host ha

@boring-cyborg boring-cyborg Bot added component:integration-test Python Warning... Python code Ahead! labels Aug 14, 2026
@Chinmay048

Copy link
Copy Markdown
Contributor Author

@kiranchavala I have updated the setUp method in test_hostha_kvm.py to globally enable OOBM before the HA tests run. Could you please kick off the Trillian smoke tests again to verify?

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan shutup

@DaanHoogland DaanHoogland moved this from Backlog to Ready in CloudStack Testing Aug 31, 2026
@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan

Copy link
Copy Markdown

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19032

@DaanHoogland

Copy link
Copy Markdown
Contributor

@blueorangutan test

@blueorangutan

Copy link
Copy Markdown

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan

Copy link
Copy Markdown

[SF] Trillian test result (tid-16858)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 52378 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr13647-t16858-kvm-ol8.zip
Smoke tests completed. 140 look OK, 1 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_disable_oobm_ha_state_ineligible Error 15.55 test_hostha_kvm.py
test_hostha_configure_default_driver Error 0.34 test_hostha_kvm.py
test_hostha_enable_ha_when_host_disabled Error 0.34 test_hostha_kvm.py
test_hostha_enable_ha_when_host_disconected Error 0.33 test_hostha_kvm.py
test_hostha_enable_ha_when_host_in_maintenance Error 0.38 test_hostha_kvm.py
test_hostha_kvm_host_degraded Error 0.32 test_hostha_kvm.py
test_hostha_kvm_host_fencing Error 0.33 test_hostha_kvm.py
test_hostha_kvm_host_recovering Error 0.35 test_hostha_kvm.py
test_remove_ha_provider_not_possible Error 0.34 test_hostha_kvm.py

@DaanHoogland

Copy link
Copy Markdown
Contributor

@Chinmay048 I would think that the hostha errors are related to the change. can you check

[SF] Trillian test result (tid-16858) Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8 Total time taken: 52378 seconds Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr13647-t16858-kvm-ol8.zip Smoke tests completed. 140 look OK, 1 have errors, 0 did not run Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_disable_oobm_ha_state_ineligible Error 15.55 test_hostha_kvm.py
test_hostha_configure_default_driver Error 0.34 test_hostha_kvm.py
test_hostha_enable_ha_when_host_disabled Error 0.34 test_hostha_kvm.py
test_hostha_enable_ha_when_host_disconected Error 0.33 test_hostha_kvm.py
test_hostha_enable_ha_when_host_in_maintenance Error 0.38 test_hostha_kvm.py
test_hostha_kvm_host_degraded Error 0.32 test_hostha_kvm.py
test_hostha_kvm_host_fencing Error 0.33 test_hostha_kvm.py
test_hostha_kvm_host_recovering Error 0.35 test_hostha_kvm.py
test_remove_ha_provider_not_possible Error 0.34 test_hostha_kvm.py

@Chinmay048

Copy link
Copy Markdown
Contributor Author

The new backend validation was blocking the tests because the legacy test fixtures were calling configureHAForHost without first provisioning an OOBM interface. I have injected a dummy OOBM setup method into the execution flow for both the KVM and Simulator test suites.

Comment thread test/integration/smoke/test_hostha_kvm.py Outdated
@Chinmay048
Chinmay048 force-pushed the fix-13605-kvm-ha-oobm branch from 5577e75 to 9cdb779 Compare September 5, 2026 11:46
@DaanHoogland

Copy link
Copy Markdown
Contributor

@winterhazel , can you check if your requests for change are addressed to satisfaction?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Ready

Development

Successfully merging this pull request may close these issues.

Improvement/UI : Cloudstack Should validate if OOBM is enabled before enabling HA on the KVM host

8 participants