chore: improve cluster create
UX on aarch64
Improve cluster create UX on aarch64. Signed-off-by: Noel Georgi <git@frezbo.dev>
This commit is contained in:
parent
45cc8688a1
commit
6f969e3645
@ -74,7 +74,7 @@ type PFlash struct {
|
||||
func (arch Arch) PFlash(uefiEnabled bool, extraUEFISearchPaths []string) []PFlash {
|
||||
switch arch {
|
||||
case ArchArm64:
|
||||
uefiSourcePaths := []string{"/usr/share/qemu-efi-aarch64/QEMU_EFI.fd", "/usr/share/OVMF/QEMU_EFI.fd"}
|
||||
uefiSourcePaths := []string{"/usr/share/qemu-efi-aarch64/QEMU_EFI.fd", "/usr/share/OVMF/QEMU_EFI.fd", "/usr/share/edk2/aarch64/QEMU_EFI.fd"}
|
||||
for _, p := range extraUEFISearchPaths {
|
||||
uefiSourcePaths = append(uefiSourcePaths, filepath.Join(p, "QEMU_EFI.fd"))
|
||||
}
|
||||
@ -178,3 +178,8 @@ func (arch Arch) QemuExecutable() string {
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
// Architecture returns the architecture.
|
||||
func (arch Arch) Architecture() string {
|
||||
return string(arch)
|
||||
}
|
||||
|
@ -44,6 +44,7 @@ type LaunchConfig struct {
|
||||
VCPUCount int64
|
||||
MemSize int64
|
||||
QemuExecutable string
|
||||
Architecture string
|
||||
KernelImagePath string
|
||||
InitrdPath string
|
||||
ISOPath string
|
||||
@ -392,7 +393,12 @@ func launchVM(config *LaunchConfig) error {
|
||||
machineArg := config.MachineType
|
||||
|
||||
if config.EnableKVM {
|
||||
machineArg += ",accel=kvm,smm=on"
|
||||
machineArg += ",accel=kvm"
|
||||
|
||||
// smm is not supported on aarch64
|
||||
if Arch(config.QemuExecutable) == ArchAmd64 {
|
||||
machineArg += ",smm=on"
|
||||
}
|
||||
}
|
||||
|
||||
args = append(args, "-machine", machineArg)
|
||||
|
@ -130,6 +130,7 @@ func (p *provisioner) createNode(state *vm.State, clusterReq provision.ClusterRe
|
||||
|
||||
launchConfig := LaunchConfig{
|
||||
QemuExecutable: arch.QemuExecutable(),
|
||||
Architecture: arch.Architecture(),
|
||||
DiskPaths: diskPaths,
|
||||
DiskDrivers: xslices.Map(nodeReq.Disks, func(disk *provision.Disk) string {
|
||||
return disk.Driver
|
||||
|
Loading…
x
Reference in New Issue
Block a user