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

add full AZ awareness to plugin scraping interfaces #358

Merged
merged 2 commits into from
Sep 19, 2023

Conversation

majewsky
Copy link
Contributor

@majewsky majewsky commented Sep 15, 2023

Depending on the resource, scraping can now return capacity and usage data either for the entire region, or broken down by AZs. This distinction is represented by the enum type core.Topological. Quota stays affixed to the regional level for now (i.e. one number that applies across all AZs), since there is no committed requirement to support AZ quota in the backend.

The frontend does not change in any way at this point. This change is specifically about enhancing the interface between Limes internals and plugins to the point that whatever changes end up being done in the frontend can be supported.

Some more details are in the commit messages.

Update: I have tested that the new plugin implementations yield the same results. There are some exceptions for sharev2/share_capacity and compute/instances, where, because of rounding errors, computing the total capacity from raw values (as we did before) is different from computing the capacity per AZ from raw values and then summing over all AZs. These are literal rounding errors, though.

@coveralls
Copy link

coveralls commented Sep 15, 2023

Coverage Status

coverage: 79.972% (-0.08%) from 80.056% when pulling 2f07ba7 on az-awareness into 510ec5e on master.

internal/core/data.go Outdated Show resolved Hide resolved
internal/core/data.go Outdated Show resolved Hide resolved
internal/plugins/capacity_nova.go Outdated Show resolved Hide resolved
This is the first half of a refactor of the scrape methods towards full
AZ awareness. Scraping can return data either for the entire region,
or broken down by AZs. This distinction is represented by the enum type
Topological.

For capacity scraping, this does not present a huge change, because
several capacitors already report capacity by AZ. What changes is that:

- subcapacities are now reported on the AZ (instead of regional) level
- the region-wide capacity is computed outside of the plugin by summing
  the individual AZ capacities

The frontend does not change in any way at this point. These changes
will come later, once the user-visible changes have been agreed upon.
This changeset is about preparing the things that we will definitely
need, and making data available to the collector that we will need to
surface in the frontend later on.
This is the second part of the change that was started in the previous
commit. This change is much more straight-forward than the one to the
capacity plugins, since quota plugins do not report usage per AZ at all
right now. We are still evaluating which plugins to move to per-AZ usage
reporting and which changes in the backend services will be necessary to
enable this.
@SuperSandro2000 SuperSandro2000 merged commit 3941244 into master Sep 19, 2023
6 checks passed
@SuperSandro2000 SuperSandro2000 deleted the az-awareness branch September 19, 2023 12:41
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.

3 participants