Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MTV-1865 | Remove the q35 machine type #1291

Merged
merged 2 commits into from
Jan 7, 2025
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
11 changes: 0 additions & 11 deletions pkg/controller/plan/adapter/openstack/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,6 @@ const (
SecureBootOptional = "optional"
)

// Machine types
const (
PC = "pc"
Q35 = "q35"
PcQ35 = "pc-q35"
)

// Firmware types
const (
BIOS = "bios"
Expand Down Expand Up @@ -204,7 +197,6 @@ const (
CpuSockets = "hw_cpu_sockets"
CpuThreads = "hw_cpu_threads"
FirmwareType = "hw_firmware_type"
MachineType = "hw_machine_type"
CdromBus = "hw_cdrom_bus"
PointerModel = "hw_pointer_model"
VideoModel = "hw_video_model"
Expand Down Expand Up @@ -247,7 +239,6 @@ var DefaultProperties = map[string]string{
CpuPolicy: CpuPolicyShared,
CpuThreadPolicy: CpuThreadPolicyPrefer,
FirmwareType: BIOS,
MachineType: PC,
CdromBus: IdeBus,
PointerModel: UsbTablet,
VideoModel: VideoVirtio,
Expand Down Expand Up @@ -407,8 +398,6 @@ func (r *Builder) mapInput(vm *model.Workload, object *cnv.VirtualMachineSpec) {
}

func (r *Builder) mapResources(vm *model.Workload, object *cnv.VirtualMachineSpec, usesInstanceType bool) {
// KubeVirt supports Q35 or PC-Q35 machine types only.
object.Template.Spec.Domain.Machine = &cnv.Machine{Type: Q35}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Q35 definition. Should we drop it as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah nice catch, I have also removed additional OpenStack machinetype settings

if usesInstanceType {
return
}
Expand Down
5 changes: 0 additions & 5 deletions pkg/controller/plan/adapter/ova/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,6 @@ func (r *Builder) VirtualMachine(vmRef ref.Ref, object *cnv.VirtualMachineSpec,
}
r.mapDisks(vm, persistentVolumeClaims, object)
r.mapFirmware(vm, vmRef, object)
r.setMachine(object)
r.mapInput(object)
if !usesInstanceType {
r.mapCPU(vm, object)
Expand Down Expand Up @@ -325,10 +324,6 @@ func (r *Builder) mapMemory(vm *model.VM, object *cnv.VirtualMachineSpec) error
return nil
}

func (r *Builder) setMachine(object *cnv.VirtualMachineSpec) {
object.Template.Spec.Domain.Machine = &cnv.Machine{Type: "q35"}
}

func (r *Builder) mapCPU(vm *model.VM, object *cnv.VirtualMachineSpec) {
if vm.CoresPerSocket == 0 {
vm.CoresPerSocket = 1
Expand Down
5 changes: 0 additions & 5 deletions pkg/controller/plan/adapter/ovirt/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,6 @@ func (r *Builder) VirtualMachine(vmRef ref.Ref, object *cnv.VirtualMachineSpec,
}
r.mapDisks(vm, persistentVolumeClaims, object)
r.mapFirmware(vm, &vm.Cluster, object)
r.setMachine(object)
if !usesInstanceType {
r.mapCPU(vm, object)
r.mapMemory(vm, object)
Expand Down Expand Up @@ -370,10 +369,6 @@ func (r *Builder) mapMemory(vm *model.Workload, object *cnv.VirtualMachineSpec)
object.Template.Spec.Domain.Memory = &cnv.Memory{Guest: reservation}
}

func (r *Builder) setMachine(object *cnv.VirtualMachineSpec) {
object.Template.Spec.Domain.Machine = &cnv.Machine{Type: "q35"}
}

func (r *Builder) mapCPU(vm *model.Workload, object *cnv.VirtualMachineSpec) {
object.Template.Spec.Domain.CPU = &cnv.CPU{
Sockets: uint32(vm.CpuSockets),
Expand Down
5 changes: 0 additions & 5 deletions pkg/controller/plan/adapter/vsphere/builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,6 @@ func (r *Builder) VirtualMachine(vmRef ref.Ref, object *cnv.VirtualMachineSpec,
}
r.mapDisks(vm, vmRef, persistentVolumeClaims, object)
r.mapFirmware(vm, object)
r.setMachine(object)
if !usesInstanceType {
r.mapCPU(vm, object)
r.mapMemory(vm, object)
Expand Down Expand Up @@ -640,10 +639,6 @@ func (r *Builder) mapClock(host *model.Host, object *cnv.VirtualMachineSpec) {
}
}

func (r *Builder) setMachine(object *cnv.VirtualMachineSpec) {
object.Template.Spec.Domain.Machine = &cnv.Machine{Type: "q35"}
}

func (r *Builder) mapMemory(vm *model.VM, object *cnv.VirtualMachineSpec) {
memoryBytes := int64(vm.MemoryMB) * 1024 * 1024
reservation := resource.NewQuantity(memoryBytes, resource.BinarySI)
Expand Down
Loading