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

Liquid nova report capacity #628

Draft
wants to merge 6 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions docs/liquids/nova.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Liquid: `nova`

This liquid provides support for the compute service Nova.

- The suggested service type is `liquid-nova`.
- The suggested area is `compute`.

## Service-specific configuration

| Field | Type | Description |
| ----- | ---- | ----------- |
| `hypervisor_selection.hypervisor_type_pattern` | regexp | Only match hypervisors with a hypervisor_type attribute matching this pattern. |
| `hypervisor_selection.required_traits` | []string | Only those hypervisors will be considered whose resource providers have all of the traits without `!` prefix and none of those with `!` prefix. |
| `hypervisor_selection.shadowing_traits` | []string | If a hypervisor matches any of the rules in this configuration field (using the same logic as above for `required_traits`), the hypervisor will be considered shadowed. Its capacity will not be counted. |
| `hypervisor_selection.aggregate_name_pattern` | regexp | Only match hypervisors that reside in an aggregate matching this pattern. If a hypervisor resides in multiple matching aggregates, an error is raised. |
| `flavor_selection.required_extra_specs` | map[string]string | Only match flavors that have all of these extra specs. |
| `flavor_selection.excluded_extra_specs` | map[string]string | Exclude flavors that have any of these extra specs. |
| `pooled_cores_resource` | string | Name of the pooled cores resource. |
| `pooled_instances_resource` | string | Name of the pooled instances resource. |
| `pooled_ram_resource` | string | Name of the pooled ram resource. |
| `with_subcapacities` | boolean | If true, subcapacities are reported. |
| `with_subresources` | boolean | If true, subresources are reported. |
| `binpack_behavior.score_ignores_cores`<br>`binpack_behavior.score_ignores_disk`<br>`binpack_behavior.score_ignores_ram` | boolean | If true, when ranking nodes during placement, do not include the respective dimension in the score. |
| `ignore_traits` | []string | Traits that should be ignored during confirmation that all pooled flavors agree on which trait-match extra specs they use. |

## Resources

TODO: @majewsky please assist here

| Resource | Unit | Capabilities |
| --- | --- | --- |
| `cores` | None | HasCapacity = true, HasQuota = true |
| `ram` | MiB | HasCapacity = true, HasQuota = true |
| `instances` | None | HasCapacity = true, HasQuota = true |
| `server_groups` | None | HasCapacity = false, HasQuota = true |
| `server_group_members` | None | HasCapacity = false, HasQuota = true |
| `instances_$FLAVOR_NAME` | None | HasCapacity = true, HasQuota = true |

## Capacity calculation

TODO: @majewsky please assist here
2 changes: 1 addition & 1 deletion internal/liquids/ironic/liquid.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import (
"github.com/sapcc/go-api-declarations/liquid"

"github.com/sapcc/limes/internal/liquids"
"github.com/sapcc/limes/internal/plugins/nova"
"github.com/sapcc/limes/internal/liquids/nova"
)

type Logic struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,19 @@ import (

"github.com/gophercloud/gophercloud/v2/openstack/compute/v2/flavors"
"github.com/gophercloud/gophercloud/v2/openstack/placement/v1/resourceproviders"
"github.com/sapcc/go-api-declarations/limes"
"github.com/sapcc/go-api-declarations/liquid"
"github.com/sapcc/go-bits/logg"
)

// TODO: Remove yaml tags when switching to liquid-nova
// BinpackBehavior contains configuration parameters for the binpack simulation.
type BinpackBehavior struct {
// When ranking nodes during placement, do not include the VCPU count dimension in the score.
ScoreIgnoresCores bool `yaml:"score_ignores_cores"`
ScoreIgnoresCores bool `yaml:"score_ignores_cores" json:"score_ignores_cores"`
// When ranking nodes during placement, do not include the disk size dimension in the score.
ScoreIgnoresDisk bool `yaml:"score_ignores_disk"`
ScoreIgnoresDisk bool `yaml:"score_ignores_disk" json:"score_ignores_disk"`
// When ranking nodes during placement, do not include the RAM size dimension in the score.
ScoreIgnoresRAM bool `yaml:"score_ignores_ram"`
ScoreIgnoresRAM bool `yaml:"score_ignores_ram" json:"score_ignores_ram"`
}

// BinpackHypervisor models an entire Nova hypervisor for the purposes of the
Expand Down Expand Up @@ -146,7 +146,7 @@ func PrepareHypervisorForBinpacking(h MatchingHypervisor) (BinpackHypervisor, er
}

// RenderDebugView prints an overview of the placements in this hypervisor on several logg.Debug lines.
func (h BinpackHypervisor) RenderDebugView(az limes.AvailabilityZone) {
func (h BinpackHypervisor) RenderDebugView(az liquid.AvailabilityZone) {
shortID := h.Match.Hypervisor.Service.Host
logg.Debug("[%s][%s] %s", az, shortID, h.Match.Hypervisor.Description())
for idx, n := range h.Nodes {
Expand Down
Loading
Loading