cloudstack/framework
Abhisar Sinha 2a4a1f73d0
Support multi-scope configuration settings (#10300)
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 : https://github.com/apache/cloudstack-documentation/pull/476

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
Co-authored-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
2025-02-14 11:25:01 +05:30
..
agent-lb Merge branch '4.20' 2025-02-01 21:20:08 +01:00
ca Updating pom.xml version numbers for release 4.21.0.0-SNAPSHOT 2024-11-27 11:47:06 -03:00
cluster Merge branch '4.20' 2025-02-01 21:20:08 +01:00
config Support multi-scope configuration settings (#10300) 2025-02-14 11:25:01 +05:30
db Support multi-scope configuration settings (#10300) 2025-02-14 11:25:01 +05:30
direct-download Updating pom.xml version numbers for release 4.21.0.0-SNAPSHOT 2024-11-27 11:47:06 -03:00
events Merge release branch 4.20 to main 2025-01-08 14:01:19 +01:00
ipc Updating pom.xml version numbers for release 4.21.0.0-SNAPSHOT 2024-11-27 11:47:06 -03:00
jobs Merge branch '4.20' 2025-02-01 21:20:08 +01:00
managed-context Updating pom.xml version numbers for release 4.21.0.0-SNAPSHOT 2024-11-27 11:47:06 -03:00
quota Add preset variable account created (#10200) 2025-01-29 09:31:17 +01:00
rest Updating pom.xml version numbers for release 4.21.0.0-SNAPSHOT 2024-11-27 11:47:06 -03:00
security Updating pom.xml version numbers for release 4.21.0.0-SNAPSHOT 2024-11-27 11:47:06 -03:00
spring Merge branch '4.20' 2025-02-12 16:54:05 +01:00
pom.xml Updating pom.xml version numbers for release 4.21.0.0-SNAPSHOT 2024-11-27 11:47:06 -03:00