Skip to content

Commit

Permalink
Merge pull request #174 from gecgooden/enable-cpu-type
Browse files Browse the repository at this point in the history
Enable CPU Type on machine template
  • Loading branch information
sp-yduck authored Apr 25, 2024
2 parents dff1aaf + d1253db commit 3d2890a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/v1beta1/type.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ type Hardware struct {
// +kubebuilder:default:=2
CPU int `json:"cpu,omitempty"`

// emulated cpu type
// CPUType string `json:"cpuType,omitempty"`
// Emulated CPU Type. Defaults to kvm64
CPUType string `json:"cpuType,omitempty"`

// +kubebuilder:validation:Minimum:=1
// The number of CPU sockets. Defaults to 1.
Expand Down
1 change: 1 addition & 0 deletions cloud/services/compute/instance/qemu.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ func (s *Service) generateVMOptions() api.VirtualMachineCreateOptions {
Boot: fmt.Sprintf("order=%s", bootDvice),
CiCustom: cicustom,
Cores: hardware.CPU,
Cpu: hardware.CPUType,
CpuLimit: hardware.CPULimit,
Description: options.Description,
HugePages: options.HugePages.String(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ spec:
Defaults to 0.
minimum: 0
type: integer
cpuType:
description: Emulated CPU Type. Defaults to kvm64
type: string
disk:
default: 50G
description: hard disk size
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,9 @@ spec:
no CPU limit. Defaults to 0.
minimum: 0
type: integer
cpuType:
description: Emulated CPU Type. Defaults to kvm64
type: string
disk:
default: 50G
description: hard disk size
Expand Down

0 comments on commit 3d2890a

Please sign in to comment.