Skip to content

Commit

Permalink
Anexia: allow to specify CPU performance type
Browse files Browse the repository at this point in the history
  • Loading branch information
LittleFox94 committed May 14, 2024
1 parent 5cd0271 commit c3b5142
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
5 changes: 5 additions & 0 deletions examples/anexia-machinedeployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ spec:
cpus: 2
memory: 2048

# this defaults to "performance", but you can set anything
# supported by the Anexia Engine here - or not set this attribute
# at all
cpuPerformanceType: standard

disks:
- size: 60
performanceType: ENT6
Expand Down
4 changes: 4 additions & 0 deletions pkg/cloudprovider/provider/anexia/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ func provisionVM(ctx context.Context, log *zap.SugaredLogger, client anxclient.C

vm.DiskType = config.Disks[0].PerformanceType

if config.CPUPerformanceType != "" {
vm.CPUPerformanceType = config.CPUPerformanceType
}

for _, disk := range config.Disks[1:] {
vm.AdditionalDisks = append(vm.AdditionalDisks, anxvm.AdditionalDisk{
SizeGBs: disk.Size,
Expand Down
5 changes: 3 additions & 2 deletions pkg/cloudprovider/provider/anexia/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,9 @@ type RawConfig struct {
Template providerconfigtypes.ConfigVarString `json:"template"`
TemplateBuild providerconfigtypes.ConfigVarString `json:"templateBuild"`

CPUs int `json:"cpus"`
Memory int `json:"memory"`
CPUs int `json:"cpus"`
CPUPerformanceType string `json:"cpuPerformanceType"`
Memory int `json:"memory"`

// Deprecated, use Disks instead.
DiskSize int `json:"diskSize"`
Expand Down

0 comments on commit c3b5142

Please sign in to comment.