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 #476

Merged
merged 7 commits into from
Feb 14, 2025

Conversation

abh1sar
Copy link
Contributor

@abh1sar abh1sar commented Feb 3, 2025

@abh1sar abh1sar changed the title Add allocation and disable thresholds per storage pool Support multi-scope configuration settings Feb 5, 2025
@abh1sar
Copy link
Contributor Author

abh1sar commented Feb 5, 2025

@blueorangutan docbuild

@DaanHoogland
Copy link
Contributor

@blueorangutan docbuild

not sure if the ape accepts corrections ;)
@blueorangutan docbuild

@blueorangutan
Copy link

@DaanHoogland a Jenkins job has been kicked to build the document. I'll keep you posted as I make progress.

@blueorangutan
Copy link

QA-Doc build preview: https://qa.cloudstack.cloud/builds/docs-build/pr/476. (QA-JID 306)

@shwstppr
Copy link
Contributor

shwstppr commented Feb 5, 2025

@abh1sar can you please add a diagram depicting hierarchy for different scopes?

@abh1sar
Copy link
Contributor Author

abh1sar commented Feb 5, 2025

@abh1sar can you please add a diagram depicting hierarchy for different scopes?

@shwstppr although we have defined a hierarchy for each scope in the code, this general information is not useful for the admin, unless we are talking about specific settings and their scopes.
I mean to say no setting currently is configurable at both cluster and zone levels. So even if we mention that zone is the parent of cluster scope, it is not usable by the admin.
Information on hierarchy is more useful for developer who are changing the scope of a configuration.
So I didn't put it in the installguide/configurations sections. Should we put that info someplace else?

@shwstppr
Copy link
Contributor

shwstppr commented Feb 6, 2025

@abh1sar can you please add a diagram depicting hierarchy for different scopes?

@shwstppr although we have defined a hierarchy for each scope in the code, this general information is not useful for the admin, unless we are talking about specific settings and their scopes. I mean to say no setting currently is configurable at both cluster and zone levels. So even if we mention that zone is the parent of cluster scope, it is not usable by the admin. Information on hierarchy is more useful for developer who are changing the scope of a configuration. So I didn't put it in the installguide/configurations sections. Should we put that info someplace else?

I see it has been added to code PR description which should be enough for now.

Copy link
Contributor

@shwstppr shwstppr left a comment

Choose a reason for hiding this comment

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

Minor comment otherwise lgtm

Use the following steps to set local configuration parameters for an
account, zone, cluster, or primary storage. These values will override
the global configuration settings.
Configurations can also be set at more granular levels.
Copy link
Contributor

Choose a reason for hiding this comment

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

should we emphasize somewhere level = scope?

Copy link
Contributor

@harikrishna-patnala harikrishna-patnala left a comment

Choose a reason for hiding this comment

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

LGTM

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

@rohityadavcloud rohityadavcloud added this to the 4.21.0 milestone Feb 13, 2025
@rohityadavcloud rohityadavcloud marked this pull request as ready for review February 13, 2025 12:18
@abh1sar
Copy link
Contributor Author

abh1sar commented Feb 13, 2025

@blueorangutan docbuild

@blueorangutan
Copy link

@abh1sar a Jenkins job has been kicked to build the document. I'll keep you posted as I make progress.

@blueorangutan
Copy link

QA-Doc build preview: https://qa.cloudstack.cloud/builds/docs-build/pr/476. (QA-JID 308)

rohityadavcloud pushed a commit to apache/cloudstack that referenced this pull request Feb 14, 2025
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

Signed-off-by: Abhishek Kumar <[email protected]>
Co-authored-by: Abhishek Kumar <[email protected]>
@rohityadavcloud rohityadavcloud merged commit e42e70f into apache:main Feb 14, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants