-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Enable backup framework when the config 'backup.framework.enabled' is set to true in Zone scope and not in Global setting #11567
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 4.20
Are you sure you want to change the base?
Conversation
@blueorangutan package |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## 4.20 #11567 +/- ##
============================================
- Coverage 16.17% 16.17% -0.01%
- Complexity 13296 13297 +1
============================================
Files 5656 5656
Lines 498219 498247 +28
Branches 60451 60455 +4
============================================
+ Hits 80579 80580 +1
- Misses 408672 408698 +26
- Partials 8968 8969 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should remove this at line 983. Otherwise backup apis won't show if backup framework is enabled at zone but disabled globally.
if (!BackupFrameworkEnabled.value()) {
return cmdList;
}
2f0ee6d
to
b0b037f
Compare
@blueorangutan package |
There was a problem hiding this 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 moves the backup framework enabled configuration from zone-scoped to global-scoped, simplifying the backup management by removing per-zone enablement checks. The change affects how the backup framework determines if it's enabled, removing the need to check individual zones.
Key Changes
- Removed zone-specific backup framework configuration support
- Simplified backup enablement logic to use global configuration only
- Updated error messages to reflect global scope
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
File | Description |
---|---|
api/src/main/java/org/apache/cloudstack/backup/BackupManager.java | Removes zone scope from backup framework configuration key |
server/src/main/java/org/apache/cloudstack/backup/BackupManagerImpl.java | Updates backup enablement checks to use global configuration and removes zone-specific logic |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
server/src/main/java/org/apache/cloudstack/backup/BackupManagerImpl.java
Show resolved
Hide resolved
server/src/main/java/org/apache/cloudstack/backup/BackupManagerImpl.java
Outdated
Show resolved
Hide resolved
@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. |
Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 14918 |
233ce0d
to
08aaaaf
Compare
@blueorangutan package |
@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. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15153 |
…cking in global scope)
This reverts commit b0b037f.
08aaaaf
to
2dffcda
Compare
@blueorangutan package |
@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. |
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15163 |
@blueorangutan test |
@sureshanaparti a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
[SF] Trillian test result (tid-14446)
|
@sureshanaparti please check other zone-level settings too |
@weizhouapache There is no change in config scope, but seems minor doc changes required (I'll raise the doc PR). It fixes the issue when 'backup.framework.enabled' is set to true at zone level and set to false in global settings. |
Raised doc PR - apache/cloudstack-documentation#579 |
thanks @sureshanaparti can you check other settings ? for example |
@rohityadavcloud |
Hi @weizhouapache Yes, 'routed.network.vpc.enabled' is also Zone scoped, also has to be updated (at the below files/code) to work when 'routed.network.vpc.enabled' is set to true in Zone, and false in Global Settings. If it is set to true in Global Settings, all zones in the deployment are enabled with it by default when the respective Zone setting is not updated to false. Also, any relevant doc changes to be updated if required. cloudstack/server/src/main/java/org/apache/cloudstack/network/RoutedIpv4ManagerImpl.java Lines 171 to 174 in 86cad79
cloudstack/server/src/main/java/com/cloud/network/vpc/VpcManagerImpl.java Lines 502 to 513 in 86cad79
cloudstack/server/src/main/java/com/cloud/configuration/ConfigurationManagerImpl.java Lines 6842 to 6851 in 86cad79
|
thanks @sureshanaparti for the research can you check the PR #4202 ? |
Checked it @weizhouapache , B&R APIs are not exported when the setting is not enabled globally there because the config framework couldn't check whether any scoped level has the setting enabled or not. This PR introduces config framework to check any scoped level setting is set with any particular value set or not, which provides flexibility to check the value is set or not at the scope level. |
@sureshanaparti , doesn’t |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The approach is ok for 4.20 but this would need some major changes when merging to 4.21, as the _scope
variable has been replaced with scopes
to support multi-scope settings.
It would make more sense then to Look at all the parents of a given scope and see if any of them have the value set or not.
ConfigurationVO configurationVO = _configDao.findByName(key); | ||
if (configurationVO != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Global scope value() is good enough, right?
why do we need this code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abh1sar some earlier config keys are not part of config framework, so these are fetched directly from the db. it's the same with the current method getConfigStringValueInternal() as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM based on my tests with the NAS plugin.
@DaanHoogland No, ConfigKey.valueInScope(Scope, Long) fetches the value in that scope with id specified, if it doesn't exist, picks the global value. |
reading the title of this PR that seems to be the intention?!? |
updated title & description. |
public List<Class<?>> getCommands() { | ||
final List<Class<?>> cmdList = new ArrayList<Class<?>>(); | ||
if (!BackupFrameworkEnabled.value()) { | ||
if (!BackupFrameworkEnabled.value() && !BackupFrameworkEnabled.hasValueInScope(Boolean.TRUE.toString())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should not restrict/allow API access based on the zone config value. It might break UI/clients.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shwstppr it doesn't restrict API access. it allows API access if it is enabled in global or in any zone (not mandatory to enable in global scope). previously, enabling at global level is mandatory for API access.
Description
This PR enables backup framework when the config 'backup.framework.enabled' is set to true in Zone scope and not in Global setting. It checks backup framework enabled config is set to true or not in any of the zone scope setting when disabled in Global scope, thus supporting backup in a specific zone (and not entire cloud deployment).
Doc PR: apache/cloudstack-documentation#579
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?