Skip to content

Commit e3699e2

Browse files
Add effectiveCapacity to cells as well
1 parent 8daf5b1 commit e3699e2

4 files changed

Lines changed: 67 additions & 4 deletions

File tree

api/v1/hypervisor_types.go

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -342,8 +342,26 @@ type Cell struct {
342342
Allocation map[ResourceName]resource.Quantity `json:"allocation"`
343343

344344
// Auto-discovered capacity of this cell.
345+
//
346+
// Note that this capacity does not include the applied overcommit ratios,
347+
// and represents the actual capacity of the cell. Use the effective capacity
348+
// field to get the capacity considering the applied overcommit ratios.
349+
//
345350
// +kubebuilder:validation:Optional
346351
Capacity map[ResourceName]resource.Quantity `json:"capacity"`
352+
353+
// Auto-discovered capacity of this cell, considering the
354+
// applied overcommit ratios.
355+
//
356+
// In case no overcommit ratio is specified for a resource type, the default
357+
// overcommit ratio of 1 should be applied, meaning the effective capacity
358+
// is the same as the actual capacity.
359+
//
360+
// If the overcommit ratio results in a fractional effective capacity, the
361+
// effective capacity is expected to be rounded down.
362+
//
363+
// +kubebuilder:validation:Optional
364+
EffectiveCapacity map[ResourceName]resource.Quantity `json:"effectiveCapacity,omitempty"`
347365
}
348366

349367
// HypervisorStatus defines the observed state of Hypervisor

api/v1/zz_generated.deepcopy.go

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

applyconfigurations/api/v1/cell.go

Lines changed: 18 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/crd/bases/kvm.cloud.sap_hypervisors.yaml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,12 +310,35 @@ spec:
310310
- type: string
311311
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
312312
x-kubernetes-int-or-string: true
313-
description: Auto-discovered capacity of this cell.
313+
description: |-
314+
Auto-discovered capacity of this cell.
315+
316+
Note that this capacity does not include the applied overcommit ratios,
317+
and represents the actual capacity of the cell. Use the effective capacity
318+
field to get the capacity considering the applied overcommit ratios.
314319
type: object
315320
cellID:
316321
description: Cell ID.
317322
format: int64
318323
type: integer
324+
effectiveCapacity:
325+
additionalProperties:
326+
anyOf:
327+
- type: integer
328+
- type: string
329+
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
330+
x-kubernetes-int-or-string: true
331+
description: |-
332+
Auto-discovered capacity of this cell, considering the
333+
applied overcommit ratios.
334+
335+
In case no overcommit ratio is specified for a resource type, the default
336+
overcommit ratio of 1 should be applied, meaning the effective capacity
337+
is the same as the actual capacity.
338+
339+
If the overcommit ratio results in a fractional effective capacity, the
340+
effective capacity is expected to be rounded down.
341+
type: object
319342
required:
320343
- cellID
321344
type: object

0 commit comments

Comments
 (0)