Skip to content
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

Support multi-scope configuration settings #10300

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

abh1sar
Copy link
Collaborator

@abh1sar abh1sar commented Jan 29, 2025

Description

This PR introduces the concept of multi-scope configuration settings. In addition to the Global level, currently all configurations can be set at a single scope level.
It will be useful if a configuration can be set at multiple scopes. For example, a configuration set at the domain level
will apply for all accounts, but it can be set for an account as well. In which case the account level setting will override the domain level setting.

This is done by changing the column scope of table configuration from string (single scope) to bitmask (multiple scopes).

public enum Scope {
    Global(null, 1),
    Zone(Global, 1 << 1),
    Cluster(Zone, 1 << 2),
    StoragePool(Cluster, 1 << 3),
    ManagementServer(Global, 1 << 4),
    ImageStore(Zone, 1 << 5),
    Domain(Global, 1 << 6),
    Account(Domain, 1 << 7);

Each scope is also assigned a parent scope. When a configuration for a given scope is not defined but is available for multiple scope types, the value will be retrieved from the parent scope. If there is no parent scope or if the configuration is defined for a single scope only, the value will fall back to the global level.

Hierarchy for different scopes is defined as below :

  • Global
    • Zone
      • Cluster
        • Storage Pool
      • Image Store
    • Management Server
    • Domain
      • Account

This PR also updates the scope of the following configurations (Storage Pool scope is added in addition to the existing Zone scope):

  • pool.storage.allocated.capacity.disablethreshold
  • pool.storage.allocated.resize.capacity.disablethreshold
  • pool.storage.capacity.disablethreshold

Doc PR : apache/cloudstack-documentation#476

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?

Tested Upgrade path
Tested that the configuration values are set correctly for all mentioned configurations at different scopes.

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

Copy link

codecov bot commented Jan 29, 2025

Codecov Report

Attention: Patch coverage is 64.28571% with 105 lines in your changes missing coverage. Please review.

Project coverage is 16.13%. Comparing base (f8563b8) to head (9f22056).

Files with missing lines Patch % Lines
.../apache/cloudstack/framework/config/ConfigKey.java 78.70% 11 Missing and 12 partials ⚠️
...va/com/cloud/upgrade/dao/DatabaseAccessObject.java 65.38% 7 Missing and 2 partials ⚠️
...udstack/framework/config/impl/ConfigDepotImpl.java 64.00% 4 Missing and 5 partials ⚠️
...m/cloud/storage/dao/StoragePoolDetailsDaoImpl.java 0.00% 8 Missing ⚠️
...storage/datastore/db/ImageStoreDetailsDaoImpl.java 0.00% 7 Missing ⚠️
.../main/java/com/cloud/dc/ClusterDetailsDaoImpl.java 0.00% 6 Missing ⚠️
...ain/java/com/cloud/user/AccountDetailsDaoImpl.java 0.00% 6 Missing ⚠️
...ain/java/com/cloud/upgrade/dao/DbUpgradeUtils.java 54.54% 3 Missing and 2 partials ⚠️
...ava/com/cloud/upgrade/dao/Upgrade42010to42100.java 79.16% 4 Missing and 1 partial ⚠️
.../cloud/configuration/ConfigurationManagerImpl.java 54.54% 2 Missing and 3 partials ⚠️
... and 9 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #10300      +/-   ##
============================================
+ Coverage     16.07%   16.13%   +0.06%     
- Complexity    13189    13233      +44     
============================================
  Files          5664     5664              
  Lines        497612   497821     +209     
  Branches      60216    60243      +27     
============================================
+ Hits          79991    80335     +344     
+ Misses       408663   408479     -184     
- Partials       8958     9007      +49     
Flag Coverage Δ
uitests 4.00% <ø> (ø)
unittests 16.98% <64.28%> (+0.06%) ⬆️

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.

@abh1sar abh1sar changed the title [WIP] Support multiple hierarchical scopes for configurations [WIP] Add allocation and disable thresholds per storage pool Jan 30, 2025
@abh1sar
Copy link
Collaborator Author

abh1sar commented Jan 30, 2025

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@abh1sar
Copy link
Collaborator Author

abh1sar commented Jan 30, 2025

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@abh1sar
Copy link
Collaborator Author

abh1sar commented Jan 31, 2025

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@blueorangutan
Copy link

[SF] Trillian test result (tid-12371)
Environment: kvm-ubuntu22 (x2), Advanced Networking with Mgmt server u22
Total time taken: 73763 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10300-t12371-kvm-ubuntu22.zip
Smoke tests completed. 136 look OK, 5 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_11_isolated_network_with_dynamic_routed_mode Error 2.29 test_ipv4_routing.py
test_12_vpc_and_tier_with_dynamic_routed_mode Error 3.46 test_ipv4_routing.py
test_12_vpc_and_tier_with_dynamic_routed_mode Error 3.46 test_ipv4_routing.py
test_oobm_multiple_mgmt_server_ownership Failure 30.75 test_outofbandmanagement.py
test_02_list_cpvm_vm Failure 0.04 test_ssvm.py
test_04_cpvm_internals Failure 0.04 test_ssvm.py
test_12_start_vm_multiple_volumes_allocated Error 17.04 test_vm_life_cycle.py
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL Error 4357.82 test_vpc_redundant.py
test_01_create_redundant_VPC_2tiers_4VMs_4IPs_4PF_ACL Error 4358.00 test_vpc_redundant.py
test_02_redundant_VPC_default_routes Error 3615.20 test_vpc_redundant.py

@blueorangutan
Copy link

[SF] Trillian test result (tid-12373)
Environment: xcpng82 (x2), Advanced Networking with Mgmt server ol9
Total time taken: 78384 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10300-t12373-xcpng82.zip
Smoke tests completed. 133 look OK, 8 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_01_condensed_drs_algorithm Failure 193.66 test_cluster_drs.py
test_02_balanced_drs_algorithm Failure 186.36 test_cluster_drs.py
test_11_isolated_network_with_dynamic_routed_mode Error 2.27 test_ipv4_routing.py
test_12_vpc_and_tier_with_dynamic_routed_mode Error 4.38 test_ipv4_routing.py
test_12_vpc_and_tier_with_dynamic_routed_mode Error 4.38 test_ipv4_routing.py
test_01_prepare_and_cancel_maintenance Error 0.11 test_ms_maintenance_and_safe_shutdown.py
ContextSuite context=TestSharedNetworkWithConfigDrive>:setup Error 10.49 test_network.py
test_01_non_strict_host_anti_affinity Error 268.78 test_nonstrict_affinity_group.py
test_02_non_strict_host_affinity Error 122.26 test_nonstrict_affinity_group.py
test_02_create_volume Error 2.19 test_resource_names.py
test_05_scale_vm_dont_allow_disk_offering_change Failure 70.31 test_scale_vm.py
test_12_start_vm_multiple_volumes_allocated Error 14.84 test_vm_life_cycle.py

Copy link

This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch.

@abh1sar
Copy link
Collaborator Author

abh1sar commented Feb 12, 2025

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@abh1sar
Copy link
Collaborator Author

abh1sar commented Feb 13, 2025

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@abh1sar
Copy link
Collaborator Author

abh1sar commented Feb 13, 2025

@blueorangutan test

@blueorangutan
Copy link

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

Copy link
Contributor

@borisstoyanov borisstoyanov left a comment

Choose a reason for hiding this comment

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

LGTM, manually tested that pool settings are taking precedence over the global settings.

@rohityadavcloud rohityadavcloud marked this pull request as ready for review February 13, 2025 12:18
@rohityadavcloud
Copy link
Member

@blueorangutan package

@blueorangutan
Copy link

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

@blueorangutan
Copy link

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

@blueorangutan
Copy link

[SF] Trillian test result (tid-12388)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 54507 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10300-t12388-kvm-ol8.zip
Smoke tests completed. 139 look OK, 2 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File
test_11_isolated_network_with_dynamic_routed_mode Error 2.35 test_ipv4_routing.py
test_12_vpc_and_tier_with_dynamic_routed_mode Error 1.39 test_ipv4_routing.py
test_12_vpc_and_tier_with_dynamic_routed_mode Error 1.39 test_ipv4_routing.py
test_06_purge_expunged_vm_background_task Failure 399.20 test_purge_expunged_vms.py

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.

7 participants