Skip to content

Bump min required memory to 3GB and Fix KVM driver (tests) timeouts #20852

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

Merged
merged 6 commits into from
Jun 3, 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
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ KIC_VERSION ?= $(shell grep -E "Version =" pkg/drivers/kic/types.go | cut -d \"
HUGO_VERSION ?= $(shell grep -E "HUGO_VERSION = \"" netlify.toml | cut -d \" -f2)

# Default to .0 for higher cache hit rates, as build increments typically don't require new ISO versions
ISO_VERSION ?= v1.36.0
ISO_VERSION ?= v1.36.0-1748823857-20852

# Dashes are valid in semver, but not Linux packaging. Use ~ to delimit alpha/beta
DEB_VERSION ?= $(subst -,~,$(RAW_VERSION))
Expand Down Expand Up @@ -103,7 +103,7 @@ $(shell mkdir -p $(BUILD_DIR))
CURRENT_GIT_BRANCH ?= $(shell git branch | grep \* | cut -d ' ' -f2)

# Use system python if it exists, otherwise use Docker.
PYTHON := $(shell command -v python || echo "docker run --rm -it -v $(shell pwd):/minikube:Z -w /minikube python python")
PYTHON := $(shell command -v python || echo "docker run --rm -it -v $(shell pwd):/minikube -w /minikube python python")
BUILD_OS := $(shell uname -s)

SHA512SUM=$(shell command -v sha512sum || echo "shasum -a 512")
Expand Down Expand Up @@ -189,7 +189,7 @@ endef

# $(call DOCKER, image, command)
define DOCKER
docker run --rm -e GOCACHE=/app/.cache -e IN_DOCKER=1 --user $(shell id -u):$(shell id -g) -w /app -v $(PWD):/app:Z -v $(GOPATH):/go --init $(1) /bin/bash -c '$(2)'
docker run --rm -e GOCACHE=/app/.cache -e IN_DOCKER=1 --user $(shell id -u):$(shell id -g) -w /app -v $(PWD):/app -v $(GOPATH):/go --init $(1) /bin/bash -c '$(2)'
endef

ifeq ($(BUILD_IN_DOCKER),y)
Expand Down Expand Up @@ -341,13 +341,13 @@ out/minikube-%.iso: $(shell find "deploy/iso/minikube-iso" -type f)
ifeq ($(IN_DOCKER),1)
$(MAKE) minikube-iso-$*
else
docker run --rm --workdir /mnt --volume $(CURDIR):/mnt:Z $(ISO_DOCKER_EXTRA_ARGS) \
docker run --rm --workdir /mnt --volume $(CURDIR):/mnt $(ISO_DOCKER_EXTRA_ARGS) \
--user $(shell id -u):$(shell id -g) --env HOME=/tmp --env IN_DOCKER=1 \
$(ISO_BUILD_IMAGE) /bin/bash -lc '/usr/bin/make minikube-iso-$*'
endif

iso_in_docker:
docker run -it --rm --workdir /mnt --volume $(CURDIR):/mnt:Z $(ISO_DOCKER_EXTRA_ARGS) \
docker run -it --rm --workdir /mnt --volume $(CURDIR):/mnt $(ISO_DOCKER_EXTRA_ARGS) \
--user $(shell id -u):$(shell id -g) --env HOME=/tmp --env IN_DOCKER=1 \
$(ISO_BUILD_IMAGE) /bin/bash

Expand Down Expand Up @@ -523,7 +523,7 @@ out/linters/golangci-lint-$(GOLINT_VERSION):
.PHONY: lint
ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y)
lint:
docker run --rm -v `pwd`:/app:Z -w /app golangci/golangci-lint:$(GOLINT_VERSION) \
docker run --rm -v `pwd`:/app -w /app golangci/golangci-lint:$(GOLINT_VERSION) \
golangci-lint run ${GOLINT_OPTIONS} ./..."
# --skip-dirs "cmd/drivers/kvm|cmd/drivers/hyperkit|pkg/drivers/kvm|pkg/drivers/hyperkit"
# The "--skip-dirs" parameter is no longer supported in the V2 version. If you need to skip the directory,
Expand Down Expand Up @@ -657,7 +657,7 @@ out/docker-machine-driver-hyperkit:
ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y)
docker run --rm -e GOCACHE=/app/.cache -e IN_DOCKER=1 \
--user $(shell id -u):$(shell id -g) -w /app \
-v $(PWD):/app:Z -v $(GOPATH):/go:Z --init --entrypoint "" \
-v $(PWD):/app -v $(GOPATH):/go --init --entrypoint "" \
$(HYPERKIT_BUILD_IMAGE) /bin/bash -c 'CC=o64-clang CXX=o64-clang++ /usr/bin/make $@'
else
$(if $(quiet),@echo " GO $@")
Expand Down
4 changes: 2 additions & 2 deletions cmd/minikube/cmd/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -1098,8 +1098,8 @@ func suggestMemoryAllocation(sysLimit, containerLimit, nodes int) int {
return mem
}

const fallback = 2200
maximum := 6000
const fallback = 3072
Copy link
Member

Choose a reason for hiding this comment

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

I believe this means, we are bumping the mininum required memory for minikube ? if yes and if needed how about be done in an explicit separate PR that can get attention (since affects all drivers)

all other refactors seems to be doing good by unifying the error message wording

Copy link
Contributor Author

@prezha prezha Jun 3, 2025

Choose a reason for hiding this comment

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

i think that bumping minimum required memory now, after we bumped several components starting from buildroot, became mandatory and also core to fix this issue, but i don't mind opening a separate pr for just memory bump if we think that would help, although it's coupled with few other improvements here on how we wait machine to get an ip

btw, we're also seeing other examples of failures with less than 3gb mem - like this one

i was able to replicate the issue with at least these ten kvm driver tests consistently failing (whilst all having in common originally using 2gb mem):

  • TestCertExpiration
  • TestCertOptions
  • TestDockerFlags
  • TestForceSystemdEnv
  • TestForceSystemdFlag
  • TestMountStart/serial/StartWithMountFirst
  • TestNoKubernetes/serial/Start
  • TestOffline
  • TestPause/serial/Start
  • TestScheduledStopUnix

here's couple console capture examples of kernel panic due to oom:
Screenshot-20250601 172738
Screenshot-20250601 182853

i've also added the ability to capture and log the vm console outputs in this pr - that should help future debugging as well, eg:

...
I0601 21:44:01.038071 2477073 main.go:141] libmachine: (mount-start-1-457392) DBG | unable to find current IP address of domain mount-start-1-457392 in network mk-mount-start-1-457392 (interfaces detected: [])
I0601 21:44:01.038113 2477073 main.go:141] libmachine: (mount-start-1-457392) DBG | console log:
I0601 21:44:01.038120 2477073 main.go:141] libmachine: (mount-start-1-457392) DBG | [    4.962861] Kernel panic - not syncing: System is deadlocked on memory
I0601 21:44:01.038126 2477073 main.go:141] libmachine: (mount-start-1-457392) DBG | [    4.963493] CPU: 0 PID: 1 Comm: init Not tainted 5.10.207 #1
I0601 21:44:01.038134 2477073 main.go:141] libmachine: (mount-start-1-457392) DBG | [    4.963911] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.3-2-gc13ff2cd-prebuilt.qemu.org 04/01/2014
I0601 21:44:01.038140 2477073 main.go:141] libmachine: (mount-start-1-457392) DBG | [    4.964838] Call Trace:
I0601 21:44:01.038146 2477073 main.go:141] libmachine: (mount-start-1-457392) DBG | [    4.965022]  dump_stack+0x57/0x6e
I0601 21:44:01.038154 2477073 main.go:141] libmachine: (mount-start-1-457392) DBG | [    4.965340]  panic+0x11a/0x2d9
I0601 21:44:01.038160 2477073 main.go:141] libmachine: (mount-start-1-457392) DBG | [    4.965565]  out_of_memory.cold+0x2f/0x7e
I0601 21:44:01.038185 2477073 main.go:141] libmachine: (mount-start-1-457392) DBG | [    4.965886]  __alloc_pages_slowpath.constprop.0+0xae1/0xc40
I0601 21:44:01.038192 2477073 main.go:141] libmachine: (mount-start-1-457392) DBG | [    4.966343]  __alloc_pages_nodemask+0x2cb/0x300
I0601 21:44:01.038196 2477073 main.go:141] libmachine: (mount-start-1-457392) DBG | [    4.966678]  alloc_pages_vma+0x78/0x260
I0601 21:44:01.038200 2477073 main.go:141] libmachine: (mount-start-1-457392) DBG | [    4.966964]  handle_mm_fault+0xa06/0x14c0
I0601 21:44:01.038205 2477073 main.go:141] libmachine: (mount-start-1-457392) DBG | [    4.967283]  do_user_addr_fault+0x183/0x3b0
I0601 21:44:01.038209 2477073 main.go:141] libmachine: (mount-start-1-457392) DBG | [    4.967585]  exc_page_fault+0x56/0x110
I0601 21:44:01.038214 2477073 main.go:141] libmachine: (mount-start-1-457392) DBG | [    4.967877]  ? asm_exc_page_fault+0x8/0x30
I0601 21:44:01.038218 2477073 main.go:141] libmachine: (mount-start-1-457392) DBG | [    4.968241]  asm_exc_page_fault+0x1e/0x30
I0601 21:44:01.038226 2477073 main.go:141] libmachine: (mount-start-1-457392) DBG | [    4.968573] RIP: 0033:0x7f6cd017dd54
I0601 21:44:01.038234 2477073 main.go:141] libmachine: (mount-start-1-457392) DBG | [    4.968837] Code: 8d 34 19 49 39 d0 49 89 70 60 0f 95 c2 48 29 d8 48 83 c1 10 0f b6 d2 48 83 c8 01 48 c1 e2 02 48 09 da 48 83 ca 01 48 89 51 f8 <48> 89 46 08 48 89 cf 4c 89 e6 48 89 4c 24 08 e8 18 c7 ff ff 48 8b
I0601 21:44:01.038239 2477073 main.go:141] libmachine: (mount-start-1-457392) DBG | [    4.970354] RSP: 002b:00007ffff1d812d0 EFLAGS: 00010206
I0601 21:44:01.038245 2477073 main.go:141] libmachine: (mount-start-1-457392) DBG | [    4.970720] RAX: 000000000000e581 RBX: 0000000000001010 RCX: 000055b57abe9a80
I0601 21:44:01.038251 2477073 main.go:141] libmachine: (mount-start-1-457392) DBG | [    4.971262] RDX: 0000000000001011 RSI: 000055b57abeaa80 RDI: 0000000000000000
I0601 21:44:01.038257 2477073 main.go:141] libmachine: (mount-start-1-457392) DBG | [    4.971777] RBP: ffffffffffffffc0 R08: 00007f6cd02b6ac0 R09: 0000000000000000
I0601 21:44:01.038263 2477073 main.go:141] libmachine: (mount-start-1-457392) DBG | [    4.972372] R10: 0000000000000004 R11: 0000000000000202 R12: 0000000000001000
I0601 21:44:01.038269 2477073 main.go:141] libmachine: (mount-start-1-457392) DBG | [    4.972887] R13: 0000000000000000 R14: 00000000000000ff R15: 00007f6cd02b6b20
I0601 21:44:01.038275 2477073 main.go:141] libmachine: (mount-start-1-457392) DBG | [    4.973726] Kernel Offset: 0x32e00000 from 0xffffffff81000000 (relocation range: 0xffffffff80000000-0xffffffffbfffffff)
I0601 21:44:01.038280 2477073 main.go:141] libmachine: (mount-start-1-457392) DBG | [    4.975132] ---[ end Kernel panic - not syncing: System is deadlocked on memory ]---
I0601 21:44:01.038286 2477073 main.go:141] libmachine: (mount-start-1-457392) DBG | 
I0601 21:44:01.038463 2477073 client.go:171] duration metric: took 1m37.283163428s to LocalClient.Create
...

maximum := 6144

if sysLimit > 0 && fallback > sysLimit {
return sysLimit
Expand Down
20 changes: 10 additions & 10 deletions cmd/minikube/cmd/start_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -277,26 +277,26 @@ func TestSuggestMemoryAllocation(t *testing.T) {
nodes int
want int
}{
{"128GB sys", 128000, 0, 1, 6000},
{"64GB sys", 64000, 0, 1, 6000},
{"32GB sys", 32768, 0, 1, 6000},
{"128GB sys", 128000, 0, 1, 6144},
{"64GB sys", 64000, 0, 1, 6144},
{"32GB sys", 32768, 0, 1, 6144},
{"16GB sys", 16384, 0, 1, 4000},
{"odd sys", 14567, 0, 1, 3600},
{"4GB sys", 4096, 0, 1, 2200},
{"4GB sys", 4096, 0, 1, 3072},
{"2GB sys", 2048, 0, 1, 2048},
{"Unable to poll sys", 0, 0, 1, 2200},
{"Unable to poll sys", 0, 0, 1, 3072},
{"128GB sys, 16GB container", 128000, 16384, 1, 16336},
{"64GB sys, 16GB container", 64000, 16384, 1, 16000},
{"16GB sys, 4GB container", 16384, 4096, 1, 4000},
{"4GB sys, 3.5GB container", 16384, 3500, 1, 3452},
{"16GB sys, 2GB container", 16384, 2048, 1, 2048},
{"16GB sys, unable to poll container", 16384, 0, 1, 4000},
{"128GB sys 2 nodes", 128000, 0, 2, 6000},
{"8GB sys 3 nodes", 8192, 0, 3, 2200},
{"16GB sys 2 nodes", 16384, 0, 2, 2200},
{"128GB sys 2 nodes", 128000, 0, 2, 6144},
{"8GB sys 3 nodes", 8192, 0, 3, 3072},
{"16GB sys 2 nodes", 16384, 0, 2, 3072},
{"32GB sys 2 nodes", 32768, 0, 2, 4050},
{"odd sys 2 nodes", 14567, 0, 2, 2200},
{"4GB sys 2 nodes", 4096, 0, 2, 2200},
{"odd sys 2 nodes", 14567, 0, 2, 3072},
{"4GB sys 2 nodes", 4096, 0, 2, 3072},
{"2GB sys 3 nodes", 2048, 0, 3, 2048},
}
for _, test := range tests {
Expand Down
2 changes: 1 addition & 1 deletion deploy/iso/minikube-iso/go.hash
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ sha256 36930162a93df417d90bd22c6e14daff4705baac2b02418edda671cdfa9cd07f go1.23
sha256 8d6a77332487557c6afa2421131b50f83db4ae3c579c3bc72e670ee1f6968599 go1.23.3.src.tar.gz
sha256 ad345ac421e90814293a9699cca19dd5238251c3f687980bbcae28495b263531 go1.23.4.src.tar.gz
sha256 d14120614acb29d12bcab72bd689f257eb4be9e0b6f88a8fb7e41ac65f8556e5 go1.24.0.src.tar.gz
sha256 6924efde5de86fe277676e929dc9917d466efa02fb934197bc2eba35d5680971 go1.23.4.linux-amd64.tar.gz
sha256 6924efde5de86fe277676e929dc9917d466efa02fb934197bc2eba35d5680971 go1.23.4.linux-amd64.tar.gz
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ require (
k8s.io/klog/v2 v2.130.1
k8s.io/kubectl v0.32.2
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738
libvirt.org/go/libvirt v1.11001.0
libvirt.org/go/libvirt v1.11002.0
sigs.k8s.io/sig-storage-lib-external-provisioner/v6 v6.3.0
)

Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -3218,8 +3218,8 @@ k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b/go.mod h1:jPW/WVKK9YHAvNhRxK0md/
k8s.io/utils v0.0.0-20211116205334-6203023598ed/go.mod h1:jPW/WVKK9YHAvNhRxK0md/EJ228hCsBRufyofKtW8HA=
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 h1:M3sRQVHv7vB20Xc2ybTt7ODCeFj6JSWYFzOFnYeS6Ro=
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0=
libvirt.org/go/libvirt v1.11001.0 h1:QJgpslxY7qkpXZIDxdMHpkDl7FfhgQJwqRTGBbg/S8E=
libvirt.org/go/libvirt v1.11001.0/go.mod h1:1WiFE8EjZfq+FCVog+rvr1yatKbKZ9FaFMZgEqxEJqQ=
libvirt.org/go/libvirt v1.11002.0 h1:cb8KJG3D97pc/hxQ2n6P82hRX3rlgdzO7bih6W1AAQ8=
libvirt.org/go/libvirt v1.11002.0/go.mod h1:1WiFE8EjZfq+FCVog+rvr1yatKbKZ9FaFMZgEqxEJqQ=
lukechampine.com/uint128 v1.1.1/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk=
lukechampine.com/uint128 v1.2.0/go.mod h1:c4eWIwlEGaxC/+H1VguhU4PHXNWDCDMUlWdIWl2j1gk=
modernc.org/cc/v3 v3.36.0/go.mod h1:NFUHyPn4ekoC/JHeZFfZurN6ixxawE1BnVonP/oahEI=
Expand Down
2 changes: 1 addition & 1 deletion hack/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ func getLabels(containerRuntime string) *stackdriver.Labels {
func minikubeStartTime(ctx context.Context, projectID, minikubePath, containerRuntime string) (float64, error) {
defer deleteMinikube(ctx, minikubePath)

cmd := exec.CommandContext(ctx, minikubePath, "start", "--driver=docker", "-p", profile, "--memory=2048", "--trace=gcp", fmt.Sprintf("--container-runtime=%s", containerRuntime))
cmd := exec.CommandContext(ctx, minikubePath, "start", "--driver=docker", "-p", profile, "--memory=3072", "--trace=gcp", fmt.Sprintf("--container-runtime=%s", containerRuntime))
Copy link
Member

Choose a reason for hiding this comment

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

btw this is for the Docker Driver, do we even need this ? (this is benchmarking)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it's definitelly not "critical", but i think that now that we know we can expect issues with less than 3gb mem, my thinking is trying to avoid potential flakiness, including here

cmd.Env = append(os.Environ(), fmt.Sprintf("%s=%s", pkgtrace.ProjectEnvVar, projectID))
cmd.Stdout = os.Stderr
cmd.Stderr = os.Stderr
Expand Down
30 changes: 20 additions & 10 deletions pkg/drivers/kvm/domain.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ import (
func (d *Driver) getDomain() (*libvirt.Domain, *libvirt.Connect, error) {
conn, err := getConnection(d.ConnectionURI)
if err != nil {
return nil, nil, errors.Wrap(err, "getting libvirt connection")
return nil, nil, fmt.Errorf("failed opening libvirt connection: %w", err)
}

dom, err := conn.LookupDomainByName(d.MachineName)
if err != nil {
return nil, nil, errors.Wrap(err, "looking up domain")
return nil, nil, fmt.Errorf("failed looking up domain: %w", lvErr(err))
}

return dom, conn, nil
Expand All @@ -45,13 +45,17 @@ func (d *Driver) getDomain() (*libvirt.Domain, *libvirt.Connect, error) {
func getConnection(connectionURI string) (*libvirt.Connect, error) {
conn, err := libvirt.NewConnect(connectionURI)
if err != nil {
return nil, errors.Wrap(err, "connecting to libvirt socket")
return nil, fmt.Errorf("failed connecting to libvirt socket: %w", lvErr(err))
}

return conn, nil
}

func closeDomain(dom *libvirt.Domain, conn *libvirt.Connect) error {
if dom == nil {
return fmt.Errorf("nil domain, cannot close")
}

if err := dom.Free(); err != nil {
return err
}
Expand All @@ -62,25 +66,31 @@ func closeDomain(dom *libvirt.Domain, conn *libvirt.Connect) error {
return err
}

func (d *Driver) createDomain() (*libvirt.Domain, error) {
// create the XML for the domain using our domainTmpl template
// defineDomain defines the XML for the domain using our domainTmpl template
func (d *Driver) defineDomain() (*libvirt.Domain, error) {
tmpl := template.Must(template.New("domain").Parse(domainTmpl))
var domainXML bytes.Buffer
if err := tmpl.Execute(&domainXML, d); err != nil {
dlog := struct {
Driver
ConsoleLogPath string
}{
Driver: *d,
ConsoleLogPath: consoleLogPath(*d),
}
if err := tmpl.Execute(&domainXML, dlog); err != nil {
return nil, errors.Wrap(err, "executing domain xml")
}
conn, err := getConnection(d.ConnectionURI)
if err != nil {
return nil, errors.Wrap(err, "getting libvirt connection")
return nil, fmt.Errorf("failed opening libvirt connection: %w", err)
}
defer func() {
if _, err := conn.Close(); err != nil {
log.Errorf("unable to close libvirt connection: %v", err)
log.Errorf("failed closing libvirt connection: %v", lvErr(err))
}
}()

log.Infof("define libvirt domain using xml: %v", domainXML.String())
// define the domain in libvirt using the generated XML
log.Infof("defining domain using XML: %v", domainXML.String())
dom, err := conn.DomainDefineXML(domainXML.String())
if err != nil {
return nil, errors.Wrapf(err, "error defining domain xml: %s", domainXML.String())
Expand Down
16 changes: 8 additions & 8 deletions pkg/drivers/kvm/domain_definition_arm64.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ const domainTmpl = `
<acpi/>
<apic/>
<pae/>
{{if .Hidden}}
{{- if .Hidden}}
<kvm>
<hidden state='on'/>
</kvm>
{{end}}
{{- end}}
</features>
<cpu mode='host-passthrough'>
{{if gt .NUMANodeCount 1}}
{{- if gt .NUMANodeCount 1}}
Copy link
Member

Choose a reason for hiding this comment

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

was this not working in past ? seems to be a new syntax ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we're using that syntax to avoid printing empty lines where conditions are not met - we use that in a number of other templates already - eg: v1beta4.go

{{.NUMANodeXML}}
{{end}}
{{- end}}
</cpu>
<os>
<type machine='virt-4.2' arch='aarch64'>hvm</type>
Expand Down Expand Up @@ -75,12 +75,12 @@ const domainTmpl = `
<rng model='virtio'>
<backend model='random'>/dev/random</backend>
</rng>
{{if .GPU}}
{{- if .GPU}}
{{.DevicesXML}}
{{end}}
{{if gt .ExtraDisks 0}}
{{- end}}
{{- if gt .ExtraDisks 0}}
{{.ExtraDisksXML}}
{{end}}
{{- end}}
</devices>
</domain>
`
21 changes: 13 additions & 8 deletions pkg/drivers/kvm/domain_definition_x86.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ const domainTmpl = `
<acpi/>
<apic/>
<pae/>
{{if .Hidden}}
{{- if .Hidden}}
<kvm>
<hidden state='on'/>
</kvm>
{{end}}
{{- end}}
</features>
<cpu mode='host-passthrough'>
{{if gt .NUMANodeCount 1}}
{{- if gt .NUMANodeCount 1}}
{{.NUMANodeXML}}
{{end}}
{{- end}}
</cpu>
<os>
<type>hvm</type>
Expand All @@ -55,6 +55,7 @@ const domainTmpl = `
<source file='{{.DiskPath}}'/>
<target dev='hda' bus='virtio'/>
</disk>
<controller type='virtio-serial'/>
<interface type='network'>
<source network='{{.PrivateNetwork}}'/>
<model type='virtio'/>
Expand All @@ -65,19 +66,23 @@ const domainTmpl = `
</interface>
<serial type='pty'>
<target port='0'/>
<log file='{{.ConsoleLogPath}}' append='on'/>
</serial>
<console type='pty'>
<target type='serial' port='0'/>
</console>
<console type='pty'>
<target type="virtio" port="1"/>
</console>
<rng model='virtio'>
<backend model='random'>/dev/random</backend>
</rng>
{{if .GPU}}
{{- if .GPU}}
{{.DevicesXML}}
{{end}}
{{if gt .ExtraDisks 0}}
{{- end}}
{{- if gt .ExtraDisks 0}}
{{.ExtraDisksXML}}
{{end}}
{{- end}}
</devices>
</domain>
`
Loading
Loading