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
5 changes: 1 addition & 4 deletions scenarios/aws/microVMs/microvms/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ func newDomainConfiguration(e config.Env, set *vmconfig.VMSet, vcpu, memory, gdb
efi := filepath.Join(GetWorkingDirectory(set.Arch), "efi.fd")

// OS-dependent settings
var hypervisor string
var commandLine pulumi.StringInput = pulumi.String("")
var hostOS string
if set.Arch == LocalVMSet {
Expand All @@ -159,10 +158,8 @@ func newDomainConfiguration(e config.Env, set *vmconfig.VMSet, vcpu, memory, gdb

var driver string
if hostOS == "linux" {
hypervisor = "kvm"
driver = "<driver name=\"qemu\" type=\"qcow2\" io=\"io_uring\"/>"
} else if hostOS == "darwin" {
hypervisor = "hvf"
// We have to use QEMU network devices because libvirt does not support the macOS
// network devices.
netID := libvirtResourceName(domainName, "netdev")
Expand Down Expand Up @@ -192,7 +189,7 @@ func newDomainConfiguration(e config.Env, set *vmconfig.VMSet, vcpu, memory, gdb
resources.Efi: pulumi.String(efi),
resources.VCPU: pulumi.Sprintf("%d", vcpu),
resources.CPUTune: pulumi.String(cputune),
resources.Hypervisor: pulumi.String(hypervisor),
resources.Hypervisor: pulumi.String(set.Hypervisor()),
resources.CommandLine: commandLine,
resources.DiskDriver: pulumi.String(driver),
},
Expand Down
2 changes: 1 addition & 1 deletion scenarios/aws/microVMs/microvms/libvirt.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func (vm *VMCollection) SetupCollectionDomainConfigurations(depends []pulumi.Res
}

// Setup individual Nvram disk for arm64 distro images
if resources.GetLocalArchRecipe(set.Recipe) == vmconfig.RecipeDistroARM64 {
if set.Hypervisor() != "hvf" && resources.GetLocalArchRecipe(set.Recipe) == vmconfig.RecipeDistroARM64 {
for _, domain := range domains {
varstorePath := filepath.Join(GetWorkingDirectory(domain.vmset.Arch), fmt.Sprintf("varstore.%s", domain.DomainName))
varstoreArgs := command.Args{
Expand Down
9 changes: 9 additions & 0 deletions scenarios/aws/microVMs/vmconfig/config.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package vmconfig

import "runtime"

type PoolType string

type VMSetID string
Expand Down Expand Up @@ -57,6 +59,13 @@ type VMSet struct {
VMHost Host `json:"host,omitempty"`
}

func (set VMSet) Hypervisor() string {
if set.Arch == "local" && runtime.GOOS == "darwin" {
return "hvf"
}
return "kvm"
}

type Config struct {
Workdir string `json:"workdir"`
VMSets []VMSet `json:"vmsets"`
Expand Down