Repository navigation
Conversation
Codecov Report❌ Patch coverage is 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
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:
|
There was a problem hiding this comment.
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
recordStatusBeforeMaintenanceis not idempotent for Disabled pools: calling it multiple times… · New The API description says the pool must be \"Up or Disabled\", but the backend check also allows… · New This creates a new list instance each call just to do a membership check (same pattern also appears… · New
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.
|
@blueorangutan package |
|
@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. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 19563 |



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
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?