Skip to content

Conversation

sureshanaparti
Copy link
Contributor

@sureshanaparti sureshanaparti commented Sep 25, 2025

Description

This PR prevents disabled local storage pools from being automatically enabled during host connection. It fixes an issue where disabled local storage pools were being automatically enabled (marked as "Up") on host connection, during management server / agent start.

Issue
Disabled local storage(s) are marked Up after mgmt server / agent start, and volumes are allocated on it.

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)
  • Build/CI
  • Test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Bug Severity

  • BLOCKER
  • Critical
  • Major
  • Minor
  • Trivial

Screenshots (if appropriate):

How Has This Been Tested?

  • Enable local storage in zone (and restart management server)
  • Disable any of the local storages and restart that host's agent or restart management server

How did you try to break this feature and the system with this change?

@sureshanaparti
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

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

Copy link

codecov bot commented Sep 25, 2025

Codecov Report

❌ Patch coverage is 0% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 16.17%. Comparing base (36cfd76) to head (35216dc).
⚠️ Report is 10 commits behind head on 4.20.

Files with missing lines Patch % Lines
...orage/volume/datastore/PrimaryDataStoreHelper.java 0.00% 2 Missing ⚠️
...cycle/CloudStackPrimaryDataStoreLifeCycleImpl.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               4.20   #11722   +/-   ##
=========================================
  Coverage     16.17%   16.17%           
+ Complexity    13296    13295    -1     
=========================================
  Files          5656     5656           
  Lines        498219   498220    +1     
  Branches      60451    60452    +1     
=========================================
+ Hits          80579    80588    +9     
+ Misses       408672   408663    -9     
- Partials       8968     8969    +1     
Flag Coverage Δ
uitests 4.00% <ø> (ø)
unittests 17.02% <0.00%> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

@blueorangutan
Copy link

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

@sureshanaparti sureshanaparti marked this pull request as ready for review September 26, 2025 06:08
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes an issue where disabled local storage pools were being automatically marked as "Up" when hosts connected to the management server or agent during startup, which could result in volumes being allocated on storage that should remain disabled.

  • Adds a condition to check if the storage pool is disabled before setting its status to Up
  • Prevents disabled local storage pools from being automatically enabled during host connection

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link
Contributor

@DaanHoogland DaanHoogland left a comment

Choose a reason for hiding this comment

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

makes sense/clgtm

@sureshanaparti
Copy link
Contributor Author

@blueorangutan test

@blueorangutan
Copy link

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

Copy link
Member

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

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

code lgtm

@weizhouapache weizhouapache added this to the 4.20.2 milestone Oct 6, 2025
@weizhouapache weizhouapache self-assigned this Oct 6, 2025
@blueorangutan
Copy link

[SF] Trillian test result (tid-14525)
Environment: kvm-ol8 (x2), zone: Advanced Networking with Mgmt server ol8
Total time taken: 54348 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr11722-t14525-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_13_retrieve_vr_default_files Error 1.34 test_diagnostics.py
test_14_retrieve_vr_one_file Error 1.13 test_diagnostics.py
test_15_retrieve_ssvm_default_files Error 1.14 test_diagnostics.py
test_16_retrieve_ssvm_single_file Error 1.12 test_diagnostics.py
test_17_retrieve_cpvm_default_files Error 1.16 test_diagnostics.py
test_18_retrieve_cpvm_single_file Error 1.15 test_diagnostics.py

@weizhouapache
Copy link
Member

I can reproduce the issue that Disabled local storage is Up when cloudstack agent is restarted, and verify this PR fixes the issue

@weizhouapache weizhouapache merged commit 823cb00 into apache:4.20 Oct 7, 2025
40 of 42 checks passed
@weizhouapache weizhouapache deleted the fix-local-storage-disabled-is-enabled-on-start branch October 7, 2025 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants