Skip to content

Allow maintenance of a disabled primary storage - #14405

Draft
vishesh92 wants to merge 1 commit into
apache:mainfrom
shapeblue:allow-maint-disabled-ps
Draft

vishesh92 wants to merge 1 commit into
apache:mainfrom
shapeblue:allow-maint-disabled-ps

Conversation

@vishesh92

Copy link
Copy Markdown
Member

Description

This PR addresses the first point in #12189 and allows maintenance of a primary storage when it's in disabled state.

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

Screenshots (if appropriate):

How Has This Been Tested?

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

@codecov

codecov Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 20.40%. Comparing base (d3f0700) to head (f9d607e).

Files with missing lines Patch % Lines
...ain/java/com/cloud/storage/StorageManagerImpl.java 80.00% 1 Missing and 1 partial ⚠️
...orage/volume/datastore/PrimaryDataStoreHelper.java 87.50% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##               main   #14405   +/-   ##
=========================================
  Coverage     20.39%   20.40%           
- Complexity    21283    21288    +5     
=========================================
  Files          6481     6481           
  Lines        588040   588055   +15     
  Branches      72021    72023    +2     
=========================================
+ Hits         119957   119982   +25     
+ Misses       455052   455036   -16     
- Partials      13031    13037    +6     
Flag Coverage Δ
uitests 3.70% <ø> (ø)
unittests 21.70% <83.33%> (+<0.01%) ⬆️

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.

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.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

3 open findings
What changed in this PR

Enables putting a Disabled primary storage into maintenance and ensures the status is restored correctly when maintenance is cancelled.

Changes:

  • Allow “Enable maintenance mode” action for Disabled primary storage in the UI.
  • Backend: permit maintenance preparation for Disabled pools and persist/restore the pre-maintenance status via a pool detail key.
  • Add unit tests covering status recording/restoration and the new allowed/rejected state transitions.
File Description
ui/​src/​config/​section/​infra/​primaryStorages.js Shows the maintenance action for Disabled primary storage.
server/​src/​main/​java/​com/​cloud/​storage/​StorageManagerImpl.java Allows maintenance preparation for Disabled pools and records the pre-maintenance status.
server/​src/​test/​java/​com/​cloud/​storage/​StorageManagerImplTest.java Adds tests for status recording and Disabled pool maintenance behavior.
engine/​storage/​src/​main/​java/​org/​apache/​cloudstack/​storage/​volume/​datastore/​PrimaryDataStoreHelper.java Restores Disabled status on cancel-maintenance when recorded.
engine/​storage/​src/​test/​java/​org/​apache/​cloudstack/​storage/​volume/​datastore/​PrimaryDataStoreHelperTest.java Adds tests for restoring Disabled vs defaulting to Up.
engine/​api/​src/​main/​java/​org/​apache/​cloudstack/​engine/​subsystem/​api/​storage/​PrimaryDataStoreLifeCycle.java Adds constant key for “status before maintenance” pool detail.
api/​src/​main/​java/​org/​apache/​cloudstack/​api/​command/​admin/​storage/​PreparePrimaryStorageForMaintenanceCmd.java Updates API description to mention allowed states.

🧠 Review effort: Lite


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread server/src/main/java/com/cloud/storage/StorageManagerImpl.java
Comment thread server/src/main/java/com/cloud/storage/StorageManagerImpl.java
@vishesh92

Copy link
Copy Markdown
Member Author

@blueorangutan package

@blueorangutan

Copy link
Copy Markdown

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

@blueorangutan

Copy link
Copy Markdown

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

This branch has not been deployed

No deployments
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.

3 participants