compute

package
v0.0.0-...-577c19e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 30, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FlavorGroupExtractor

type FlavorGroupExtractor struct {
	// Common base for all extractors that provides standard functionality.
	plugins.BaseExtractor[
		struct{},
		FlavorGroupFeature,
	]
}

FlavorGroupExtractor extracts flavor group information from the database.

func (*FlavorGroupExtractor) Extract

func (e *FlavorGroupExtractor) Extract() ([]plugins.Feature, error)

Extract flavor groups from the database.

type FlavorGroupFeature

type FlavorGroupFeature struct {
	// Name of the flavor group (from hw_version extra_spec)
	Name string `json:"name"`

	// All flavors belonging to this group
	Flavors []FlavorInGroup `json:"flavors"`

	// The largest flavor in the group (used for reservation slot sizing)
	LargestFlavor FlavorInGroup `json:"largestFlavor"`

	// The smallest flavor in the group (used for CR size quantification)
	SmallestFlavor FlavorInGroup `json:"smallestFlavor"`

	// RAM-to-core ratio in MiB per vCPU (MemoryMB / VCPUs).
	// If all flavors have the same ratio: RamCoreRatio is set, RamCoreRatioMin/Max are nil.
	// If flavors have different ratios: RamCoreRatio is nil, RamCoreRatioMin/Max are set.
	RamCoreRatio    *uint64 `json:"ramCoreRatio,omitempty"`
	RamCoreRatioMin *uint64 `json:"ramCoreRatioMin,omitempty"`
	RamCoreRatioMax *uint64 `json:"ramCoreRatioMax,omitempty"`
}

FlavorGroupFeature represents a flavor group with all its member flavors. This is the feature that gets stored in the Knowledge CRD.

func (*FlavorGroupFeature) HasFixedRamCoreRatio

func (f *FlavorGroupFeature) HasFixedRamCoreRatio() bool

HasFixedRamCoreRatio returns true if all flavors in this group have the same RAM/core ratio.

type FlavorInGroup

type FlavorInGroup struct {
	Name        string            `json:"name"`
	VCPUs       uint64            `json:"vcpus"`
	MemoryMB    uint64            `json:"memoryMB"`
	DiskGB      uint64            `json:"diskGB"`
	EphemeralGB uint64            `json:"ephemeralGB,omitempty"`
	ExtraSpecs  map[string]string `json:"extraSpecs,omitempty"`
}

FlavorInGroup represents a single flavor within a flavor group.

type HostAZ

type HostAZ struct {
	// Name of the OpenStack compute host.
	ComputeHost string `db:"compute_host"`
	// Availability zone of the compute host, if available.
	AvailabilityZone *string `db:"availability_zone"`
}

type HostAZExtractor

type HostAZExtractor struct {
	// Common base for all extractors that provides standard functionality.
	plugins.BaseExtractor[
		struct{},
		HostAZ,
	]
}

func (*HostAZExtractor) Extract

func (e *HostAZExtractor) Extract() ([]plugins.Feature, error)

Extract the traits of a compute host from the database.

type HostCapabilities

type HostCapabilities struct {
	// Name of the OpenStack compute host.
	ComputeHost string `db:"compute_host"`
	// Comma-separated list of traits assigned to the compute host.
	Traits string `db:"traits"`
	// The type of hypervisor running on the compute host.
	HypervisorType string `db:"hypervisor_type"`
}

Feature that maps the traits of a compute host in OpenStack.

type HostCapabilitiesExtractor

type HostCapabilitiesExtractor struct {
	// Common base for all extractors that provides standard functionality.
	plugins.BaseExtractor[
		struct{},
		HostCapabilities,
	]
}

Extractor that extracts the traits of a compute host.

func (*HostCapabilitiesExtractor) Extract

func (e *HostCapabilitiesExtractor) Extract() ([]plugins.Feature, error)

Extract the traits of a compute host from the database.

type HostDetails

type HostDetails struct {
	// Name of the OpenStack compute host.
	ComputeHost string `db:"compute_host"`
	// Availability zone of the compute host.
	AvailabilityZone string `db:"availability_zone"`
	// CPU Architecture of the compute host.
	// Can be "cascade-lake" or "sapphire-rapids"
	CPUArchitecture string `db:"cpu_architecture"`
	// Hypervisor type of the compute host.
	HypervisorType string `db:"hypervisor_type"`
	// Hypervisor family of the compute host.
	// Can be "kvm" or "vmware"
	HypervisorFamily string `db:"hypervisor_family"`
	// Amount of VMs currently running on the compute host.
	RunningVMs int `db:"running_vms"`
	// Type of workload running on the compute host.
	// Can be "general-purpose" or "hana"
	WorkloadType string `db:"workload_type"`
	// Whether the compute host is decommissioned.
	Decommissioned bool `db:"decommissioned"`
	// Whether the compute host is reserved for external customers.
	ExternalCustomer bool `db:"external_customer"`
	// Whether the compute host can be used for workloads.
	Enabled bool `db:"enabled"`
	// Reason why the compute host is disabled, if applicable.
	DisabledReason *string `db:"disabled_reason"`
	// Comma separated list of pinned projects of the ComputeHost.
	PinnedProjects *string `db:"pinned_projects"`
}

type HostDetailsExtractor

type HostDetailsExtractor struct {
	// Common base for all extractors that provides standard functionality.
	plugins.BaseExtractor[
		struct{},
		HostDetails,
	]
}

func (*HostDetailsExtractor) Extract

func (e *HostDetailsExtractor) Extract() ([]plugins.Feature, error)

Extract the traits of a compute host from the database.

type HostPinnedProjects

type HostPinnedProjects struct {
	// The name of the aggregate where the filter is defined
	AggregateName *string `db:"aggregate_name"`
	// UUID of the aggregate where the filter is defined
	AggregateUUID *string `db:"aggregate_uuid"`
	// Tenant ID that belongs to the filter
	ProjectID *string `db:"project_id"`
	// Domain ID of the project
	DomainID *string `db:"domain_id"`
	// Combination of project name and domain name
	Label *string `db:"label"`
	// Name of the OpenStack compute host.
	ComputeHost *string `db:"compute_host"`
}

HostPinnedProjects represents the mapping between compute hosts and their tenant restrictions. This feature tracks which projects are allowed on specific hosts based on Nova aggregate tenant isolation filters. Hosts without restrictions have a NULL project_id, indicating they accept workloads from any project. See the docs: https://docs.openstack.org/nova/latest/admin/scheduling.html#aggregatemultitenancyisolation

type HostPinnedProjectsExtractor

type HostPinnedProjectsExtractor struct {
	// Common base for all extractors that provides standard functionality.
	plugins.BaseExtractor[
		struct{},
		HostPinnedProjects,
	]
}

Extractor that extracts the pinned projects of a compute host.

func (*HostPinnedProjectsExtractor) Extract

Extract the pinned projects of a compute host.

type HostUtilization

type HostUtilization struct {
	// Name of the OpenStack compute host.
	ComputeHost string `db:"compute_host" json:"computeHost"`

	// VCPU resource usage
	VCPUsUsed             float64 `db:"vcpus_used" json:"vcpusUsed"`
	VCPUsUtilizedPct      float64 `db:"vcpus_utilized_pct" json:"vcpusUtilizedPct"`
	TotalVCPUsAllocatable float64 `db:"total_vcpus_allocatable" json:"totalVCPUsAllocatable"`

	// RAM resource usage
	RAMUsedMB             float64 `db:"ram_used_mb" json:"ramUsedMB"`
	RAMUtilizedPct        float64 `db:"ram_utilized_pct" json:"ramUtilizedPct"`
	TotalRAMAllocatableMB float64 `db:"total_ram_allocatable_mb" json:"totalRAMAllocatableMB"`

	// Disk resource usage
	DiskUsedGB             float64 `db:"disk_used_gb" json:"diskUsedGB"`
	DiskUtilizedPct        float64 `db:"disk_utilized_pct" json:"diskUtilizedPct"`
	TotalDiskAllocatableGB float64 `db:"total_disk_allocatable_gb" json:"totalDiskAllocatableGB"`
}

Feature that maps how many resources are utilized on a compute host.

type HostUtilizationExtractor

type HostUtilizationExtractor struct {
	// Common base for all extractors that provides standard functionality.
	plugins.BaseExtractor[
		struct{},
		HostUtilization,
	]
}

Extractor that extracts the utilization on a compute host.

func (*HostUtilizationExtractor) Extract

func (e *HostUtilizationExtractor) Extract() ([]plugins.Feature, error)

Extract the utilization on a compute host. Depends on the OpenStack hypervisors to be synced.

type LibvirtDomainCPUStealPct

type LibvirtDomainCPUStealPct struct {
	// The openstack server instance uuid.
	InstanceUUID string `db:"instance_uuid"`
	// The compute host on which the instance is running.
	Host string `db:"host"`
	// The maximum steal pct recorded.
	MaxStealTimePct float64 `db:"max_steal_time_pct"`
}

type LibvirtDomainCPUStealPctExtractor

type LibvirtDomainCPUStealPctExtractor struct {
	// Common base for all extractors that provides standard functionality.
	plugins.BaseExtractor[
		struct{},
		LibvirtDomainCPUStealPct,
	]
}

Extractor that extracts CPU steal percentage of kvm instances and stores it as a feature into the database.

func (*LibvirtDomainCPUStealPctExtractor) Extract

Extract CPU steal time of kvm hosts.

type ResolvedVROpsHostsystem

type ResolvedVROpsHostsystem struct {
	VROpsHostsystem string `db:"vrops_hostsystem"`
	NovaComputeHost string `db:"nova_compute_host"`
}

Feature that resolves the vROps metrics hostsystem label to the corresponding Nova compute host.

type VMHostResidencyExtractor

type VMHostResidencyExtractor struct {
	// Common base for all extractors that provides standard functionality.
	plugins.BaseExtractor[
		struct{},
		VMHostResidencyHistogramBucket,
	]
}

Extractor that extracts the time elapsed until the first migration of a virtual machine.

func (*VMHostResidencyExtractor) Extract

func (e *VMHostResidencyExtractor) Extract() ([]plugins.Feature, error)

Extract the time elapsed until the first migration of a virtual machine. Depends on the OpenStack servers and migrations to be synced.

type VMHostResidencyHistogramBucket

type VMHostResidencyHistogramBucket struct {
	// Flavor name of the virtual machine.
	FlavorName string `db:"flavor_name"`
	// The bucket this residency falls into.
	Bucket float64 `db:"bucket"`
	// The value of the bucket.
	Value uint64 `db:"value"`
	// The count of vms that fell into this bucket.
	Count uint64 `db:"count"`
	// The sum of all durations that fell into this bucket.
	Sum float64 `db:"sum"`
}

Feature that describes how long a vm was running on a host until it needed to move out, and the reason for the move (i.e., who forced it to move).

type VMHostResidencyRaw

type VMHostResidencyRaw struct {
	// Time the vm stayed on the host in seconds.
	Duration int `db:"duration"`
	// Flavor name of the virtual machine.
	FlavorName string `db:"flavor_name"`
}

type VMLifeSpanHistogramBucket

type VMLifeSpanHistogramBucket struct {
	// Flavor name of the virtual machine.
	FlavorName string `db:"flavor_name"`
	// The bucket this life span falls into.
	Bucket float64 `db:"bucket"`
	// The value of the bucket.
	Value uint64 `db:"value"`
	// The count of vms that fell into this bucket.
	Count uint64 `db:"count"`
	// The sum of all durations that fell into this bucket.
	Sum float64 `db:"sum"`
	// Whether the statistic is of VMs that are deleted or still running.
	Deleted bool `db:"deleted"`
}

Feature that describes how long a vm existed before it was deleted.

type VMLifeSpanHistogramExtractor

type VMLifeSpanHistogramExtractor struct {
	// Common base for all extractors that provides standard functionality.
	plugins.BaseExtractor[
		struct{},
		VMLifeSpanHistogramBucket,
	]
}

Extractor that extracts the time elapsed until the vm was deleted.

func (*VMLifeSpanHistogramExtractor) Extract

Extract the time elapsed until the first migration of a virtual machine. Depends on the OpenStack servers and migrations to be synced.

type VMLifeSpanRaw

type VMLifeSpanRaw struct {
	// Time the vm stayed on the host in seconds.
	Duration int `db:"duration"`
	// Flavor name of the virtual machine.
	FlavorName string `db:"flavor_name"`
	// Whether the statistic is from a VM that is deleted or still running.
	Deleted bool `db:"deleted"`
}

type VROpsHostsystemContentionLongTerm

type VROpsHostsystemContentionLongTerm struct {
	ComputeHost      string
	AvgCPUContention float64
	MaxCPUContention float64
}

Feature that maps CPU contention of vROps hostsystems.

type VROpsHostsystemContentionLongTermExtractor

type VROpsHostsystemContentionLongTermExtractor struct {
	// Common base for all extractors that provides standard functionality.
	plugins.BaseExtractor[
		struct{},
		VROpsHostsystemContentionLongTerm,
	]
}

Extractor that extracts CPU contention of vROps hostsystems and stores it as a feature into the database.

func (*VROpsHostsystemContentionLongTermExtractor) Extract

Extract long term CPU contention of hostsystems. Depends on resolved vROps hostsystems (feature_vrops_resolved_hostsystem).

type VROpsHostsystemContentionShortTerm

type VROpsHostsystemContentionShortTerm struct {
	ComputeHost      string
	AvgCPUContention float64
	MaxCPUContention float64
}

Feature that maps CPU contention of vROps hostsystems.

type VROpsHostsystemContentionShortTermExtractor

type VROpsHostsystemContentionShortTermExtractor struct {
	// Common base for all extractors that provides standard functionality.
	plugins.BaseExtractor[
		struct{},
		VROpsHostsystemContentionShortTerm,
	]
}

Extractor that extracts CPU contention of vROps hostsystems and stores it as a feature into the database.

func (*VROpsHostsystemContentionShortTermExtractor) Extract

Extract short term CPU contention of hostsystems. Depends on resolved vROps hostsystems (feature_vrops_resolved_hostsystem).

type VROpsHostsystemResolver

type VROpsHostsystemResolver struct {
	// Common base for all extractors that provides standard functionality.
	plugins.BaseExtractor[
		struct{},
		ResolvedVROpsHostsystem,
	]
}

Extractor that resolves the vROps metrics hostsystem label to the corresponding Nova compute host and stores it as a feature into the database.

func (*VROpsHostsystemResolver) Extract

func (e *VROpsHostsystemResolver) Extract() ([]plugins.Feature, error)

Resolve vROps hostsystems to Nova compute hosts.

type VROpsProjectNoisiness

type VROpsProjectNoisiness struct {
	Project         string  `db:"project"`
	ComputeHost     string  `db:"compute_host"`
	AvgCPUOfProject float64 `db:"avg_cpu_of_project"`
}

Feature that calculates the noisiness of projects and on which compute hosts they are currently running.

type VROpsProjectNoisinessExtractor

type VROpsProjectNoisinessExtractor struct {
	// Common base for all extractors that provides standard functionality.
	plugins.BaseExtractor[
		struct{},
		VROpsProjectNoisiness,
	]
}

Extractor that extracts the noisiness of projects and on which compute hosts they are currently running and stores it as a feature into the database.

func (*VROpsProjectNoisinessExtractor) Extract

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL