Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
103 changes: 99 additions & 4 deletions api/v1/hypervisor_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ type HypervisorSpec struct {
// Aggregates are used to apply aggregates to the hypervisor.
Aggregates []string `json:"aggregates"`

// +kubebuilder:default:={}
// AllowedProjects defines which openstack projects are allowed to schedule
// instances on this hypervisor. The values of this list should be project
// uuids. If left empty, all projects are allowed.
AllowedProjects []string `json:"allowedProjects"`

// +kubebuilder:default:=true
// HighAvailability is used to enable the high availability handling of the hypervisor.
HighAvailability bool `json:"highAvailability"`
Expand Down Expand Up @@ -190,8 +196,8 @@ type OperatingSystemStatus struct {
GardenLinuxFeatures []string `json:"gardenLinuxFeatures,omitempty"`
}

// Current capabilities reported by libvirt.
type CapabilitiesStatus struct {
// Capabilities of the hypervisor as reported by libvirt.
type Capabilities struct {
// +kubebuilder:default:=unknown
// The hosts CPU architecture (not the guests).
HostCpuArch string `json:"cpuArch,omitempty"`
Expand All @@ -201,6 +207,77 @@ type CapabilitiesStatus struct {
HostCpus resource.Quantity `json:"cpus,omitempty"`
}

// Domain capabilities of the hypervisor as reported by libvirt.
// These details are relevant to check if a VM can be scheduled on the hypervisor.
type DomainCapabilities struct {
// The available domain cpu architecture.
// +kubebuilder:default:=unknown
Arch string `json:"arch,omitempty"`

// The supported type of virtualization for domains, such as "ch".
// +kubebuilder:default:=unknown
HypervisorType string `json:"hypervisorType,omitempty"`

// Supported devices for domains.
//
// The format of this list is the device type, and if specified, a specific
// model. For example, the take the following xml domain device definition:
//
// <video supported='yes'>
// <enum name='modelType'>
// <value>nvidia</value>
// </enum>
// </video>
//
// The corresponding entries in this list would be "video" and "video/nvidia".
//
// +kubebuilder:default:={}
SupportedDevices []string `json:"supportedDevices,omitempty"`

// Supported cpu modes for domains.
//
// The format of this list is cpu mode, and if specified, a specific
// submode. For example, the take the following xml domain cpu definition:
//
// <mode name='host-passthrough' supported='yes'>
// <enum name='hostPassthroughMigratable'/>
// </mode>
//
// The corresponding entries in this list would be "host-passthrough" and
// "host-passthrough/migratable".
//
// +kubebuilder:default:={}
SupportedCpuModes []string `json:"supportedCpuModes,omitempty"`

// Supported features for domains, such as "sev" or "sgx".
//
// This is a flat list of supported features, meaning the following xml:
//
// <features>
// <sev supported='no'/>
// <sgx supported='no'/>
// </features>
//
// Would correspond to the entries "sev" and "sgx" in this list.
//
// +kubebuilder:default:={}
SupportedFeatures []string `json:"supportedFeatures,omitempty"`
}

// Cell represents a NUMA cell on the hypervisor.
type Cell struct {
// Cell ID.
CellID uint64 `json:"cellID"`

// Auto-discovered resource allocation of all hosted VMs in this cell.
// +kubebuilder:validation:Optional
Allocation map[string]resource.Quantity `json:"allocation"`

// Auto-discovered capacity of this cell.
// +kubebuilder:validation:Optional
Capacity map[string]resource.Quantity `json:"capacity"`
}

// HypervisorStatus defines the observed state of Hypervisor
type HypervisorStatus struct {
// +kubebuilder:default:=unknown
Expand All @@ -216,8 +293,26 @@ type HypervisorStatus struct {
// Represents the Hypervisor hosted Virtual Machines
Instances []Instance `json:"instances,omitempty"`

// The capabilities of the hypervisors as reported by libvirt.
Capabilities CapabilitiesStatus `json:"capabilities,omitempty"`
// Auto-discovered capabilities as reported by libvirt.
// +kubebuilder:validation:Optional
Capabilities Capabilities `json:"capabilities"`

// Auto-discovered domain capabilities relevant to check if a VM
// can be scheduled on the hypervisor.
// +kubebuilder:validation:Optional
DomainCapabilities DomainCapabilities `json:"domainCapabilities"`

// Auto-discovered resource allocation of all hosted VMs.
// +kubebuilder:validation:Optional
Allocation map[string]resource.Quantity `json:"allocation"`

// Auto-discovered capacity of the hypervisor.
// +kubebuilder:validation:Optional
Capacity map[string]resource.Quantity `json:"capacity"`

// Auto-discovered cells on this hypervisor.
// +kubebuilder:validation:Optional
Cells []Cell `json:"cells,omitempty"`

// +kubebuilder:default:=0
// Represent the num of instances
Expand Down
95 changes: 91 additions & 4 deletions api/v1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

57 changes: 57 additions & 0 deletions applyconfigurations/api/v1/cell.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading