Repository navigation
Conversation
A disabled primary storage pool could not be put in maintenance: the API accepted only pools in Up or ErrorInMaintenance and the UI hid the action. Disabling a pool first is the usual step before taking it out of service. The Disabled state is now accepted. The pool is marked with a detail when maintenance starts, and cancelling the maintenance returns it to Disabled instead of enabling it. Fixes apache#14793
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #14935 +/- ##
============================================
+ Coverage 3.86% 21.07% +17.21%
- Complexity 0 21283 +21283
============================================
Files 494 6058 +5564
Lines 42890 549864 +506974
Branches 8142 73537 +65395
============================================
+ Hits 1657 115887 +114230
- Misses 41001 420351 +379350
- Partials 232 13626 +13394
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:
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR allows a primary storage pool that is in
Disabledstate to be put into maintenance mode, and returns it toDisabledwhen maintenance is cancelled.Today
enableStorageMaintenanceis refused for a disabled pool ("is not ready for migration, as the status is:Disabled"), so an operator who has disabled a pool to stop new allocations must enable it again, and so reopen it for allocation, before maintenance can start.Changes:
StorageManagerImpl.preparePrimaryStorageForMaintenanceacceptsDisabledin addition toUpandErrorInMaintenance, and records in the pool details (disabledBeforeMaintenance) that the pool was disabled. The same is done for the children of a datastore cluster.PrimaryDataStoreHelper.cancelMaintainreturns the pool toDisabledwhen that detail is present and removes it; otherwise the pool goes toUpas before. All storage provider lifecycles go through this helper, so no provider change is needed.Disabledstate.Fixes #14793
Types of changes
How Has This Been Tested?
Unit tests added for both paths (
PrimaryDataStoreHelperTest,StorageManagerImplTest).Manual test on a KVM lab with a second NFS primary storage pool holding one running VM (change backported to 4.22.1.1):
In every case the VM's volume stayed on the same pool: maintenance stops the VMs and cancel starts them again, volumes are not migrated.