Commit Graph

128 Commits (dependabot/go_modules/golang.org/x/term-0.35.0)

Author SHA1 Message Date
Nir Soffer 5d4d03623b
drivers: Extract drivers/common package (#21266)
Move all files and packages which are not a driver to the drivers/common
package. This helps to understand the structure of the code.

While moving, move the iso_test.iso into testdata/test.iso to separate
code and test data.

While fixing the test iso path fix few bugs in the tests using wrong iso
path. The test failed because the iso path was wrong instead of issue
with source or destination path.

New directory structure:

    % tree -L1 pkg/drivers
    pkg/drivers
    ├── common
    ├── hyperkit
    ├── kic
    ├── krunkit
    ├── kvm
    ├── none
    ├── qemu
    ├── ssh
    └── vfkit
2025-08-08 22:50:57 -07:00
Predrag Rogic 4da3cedc84
Fix KVM driver (tests) timeouts (#20852)
* Fix KVM driver tests timeouts

Rewrite KVM driver waiting logic for domain start, getting ip address
and shutting domain down. Add more config/state outputs to aid future
debugging.

Bump go/libvirt to v1.11002.0 and set the minimum memory required for
running all tests to 3GB to avoid some really weird system behaviour.

* revert reduction of timelimit for TestCert tests run

* set memory and debug output in TestNoKubernetes tests

* extend kvm waitForStaticIP timeout

* add console log to debug output

* Updating ISO to v1.36.0-1748823857-20852

---------

Co-authored-by: minikube-bot <minikube-bot@google.com>
2025-06-03 15:07:48 -07:00
Tian 3cf1e63e21
build: address all lint issues by v2 (#20804)
* fix QF1011: could omit type *os.File from declaration; it will be inferred from the right-hand side

* fix QF1012: Use fmt.Fprintf(x, ...) instead of x.Write(fmt.Sprintf(...))

* fix QF1001: could apply De Morgan's law

* fix QF1003: could use tagged switch

* fix weakCond: suspicious ; nil check may not be enough, check for len (gocritic)

* fix docStub: silencing go lint doc-comment warnings is unadvised

* fix builtinShadow: shadowing of predeclared identifier: error

* fix importShadow: shadow of imported package

* fix nestingReduce: invert if cond, replace body with , move old body after the statement

* useless-break: useless break in case clause (revive)

* Clear the redundant content in golangci.yaml file
2025-05-23 17:31:28 -07:00
Predrag Rogic 6ab1d42c0c
fix timeout when stopping KVM machine with CRI-O container runtime (#19758)
* fix timeout when stopping KVM machine with CRI-O container runtime

* Update pkg/drivers/kvm/kvm.go

Co-authored-by: Steven Powell <44844360+spowelljr@users.noreply.github.com>

* Update pkg/drivers/kvm/kvm.go

Co-authored-by: Steven Powell <44844360+spowelljr@users.noreply.github.com>

* improve error message

* Update pkg/drivers/kvm/kvm.go

Co-authored-by: Steven Powell <44844360+spowelljr@users.noreply.github.com>

---------

Co-authored-by: Steven Powell <44844360+spowelljr@users.noreply.github.com>
Co-authored-by: Medya Ghazizadeh <medyagh@users.noreply.github.com>
2024-12-12 11:14:28 -08:00
Nir Soffer fcd907fd6d kvm2 driver: Don't delete the "default" network
The special "default" network is created by libvirt and owned by the
system admin, but we try to delete it when deleting a profile.

To reproduce the issue, start and delete minikube on a system without
any other vm using the libvirt default network:

    minikube start --driver kvm2 --network default
    minikube delete

The default network will be delete, and the next minikube start will
fail, complaining about missing libvirt default networking and linking
to the complicated instructions how to recreate it.

Now we skip deletion of the special "default" network.

Example run log:

    $ out/minikube delete -v10 --logtostderr 2>delete.log
    * Deleting "minikube" in kvm2 ...
    * Removed all traces of the "minikube" cluster.

    $ cat delete.log
    ...
    I0518 03:41:27.148838 1247331 out.go:177] * Deleting "minikube" in kvm2 ...
    I0518 03:41:27.148857 1247331 main.go:141] libmachine: (minikube) Calling .Remove
    I0518 03:41:27.149156 1247331 main.go:141] libmachine: (minikube) DBG | Removing machine...
    I0518 03:41:27.159000 1247331 main.go:141] libmachine: (minikube) DBG | Trying to delete the networks (if possible)
    I0518 03:41:27.169497 1247331 main.go:141] libmachine: (minikube) DBG | Using the default network, skipping deletion
    I0518 03:41:27.169598 1247331 main.go:141] libmachine: (minikube) Successfully deleted networks
    ...
2024-05-22 11:21:41 -07:00
Medya Ghazizadeh 8000ca594b
Merge pull request #18239 from nirs/aarch64-cdrom
kvm2 driver: Use scsi cdrom for arm64 to fix Linux on Apple Silicone
2024-03-07 18:35:07 -08:00
Medya Ghazizadeh 6ad5b4a284
Merge pull request #18241 from nirs/aarch64-nvram
kvm2 driver: Remove uneeded nvram element
2024-03-07 18:31:55 -08:00
Nir Soffer 51610bcb40 kvm2 driver: Remove uneeded nvram element
The curent domain xml template includes static nvram image using the
shared template image:

    <nvram>/usr/share/AAVMF/AAVMF_VARS.fd</nvram>

This "works" when starting sinlge profile, but when starting a second
profile this breaks with:

    virError(Code=55, Domain=24, Message='Requested operation is not
    valid: Setting different SELinux label on /usr/share/AAVMF/AAVMF_VARS.fd
    which is already in use

Which tells us that we are doing the wrong thing.

If we remove the nvram element, a new per-vm nvram is created
dynamially:

    $ virsh -c qemu:///system dumpxml ex1 | grep nvram
    <nvram template='/usr/share/AAVMF/AAVMF_VARS.fd'>/var/lib/libvirt/qemu/nvram/ex1_VARS.fd</nvram>

    $ virsh -c qemu:///system dumpxml ex2 | grep nvram
    <nvram template='/usr/share/AAVMF/AAVMF_VARS.fd'>/var/lib/libvirt/qemu/nvram/ex2_VARS.fd</nvram>
2024-02-24 00:26:02 +02:00
Nir Soffer 59a59c8104 kvm2 driver: Use scsi cdrom for arm64
On linux/aarch64 (e.g. Asahi Linux on MacBook M*) booting from SATA
cdrom is broken and the VM drops into the UEFI shell.

It seems that linux/aarch64 supports only virtio and scsi devices[1].
Replace with scsi cdrom (like the x86 version) and addd a virtio-scsi
controller since the default scsi controller does not boot as well.

[1] https://kubevirt.io/user-guide/virtual_machines/virtual_machines_on_Arm64/#disks-and-volumes
2024-02-24 00:10:14 +02:00
Predrag Rogic 937d6f6ea9
Merge branch 'kubernetes:master' into ha 2024-01-18 07:24:10 +00:00
Predrag Rogic 10ecd0aeb1
kvm with containerd needs more time to stop 2024-01-15 20:59:59 +00:00
Predrag Rogic ad7fb3992c
support kubernetes ha cluster topology in minikube 2024-01-07 21:36:17 +00:00
Blaine Gardner 12c4bf5f1d
Add ability to create extra disks on qemu2 vms
Add the ability to create and attach extra disks to qemu2 vms.

Signed-off-by: Blaine Gardner <blaine.gardner@redhat.com>
2023-06-06 16:28:19 -06:00
Steven Powell 50e9147e4e fix lint errors 2023-03-20 12:43:07 -07:00
Steven Powell 63934002d8 update golang.org and godoc.org links 2022-11-30 10:49:57 -08:00
Sharif Elgamal 930427f847 revert kvm domain def for bios iso 2022-05-03 21:39:12 -07:00
Sharif Elgamal 1c31b6cb81 typo 2022-04-21 19:13:22 -07:00
Sharif Elgamal 28083d9235 keep nvram on minikube delete 2022-04-18 12:37:32 -07:00
Sharif Elgamal c82be99d3b fix nvram location for aarch64 kvm driver 2022-04-15 12:32:47 -07:00
Sharif Elgamal 684c2b4ac4 fix undefining kvm domain 2022-04-07 13:33:01 -07:00
Sharif Elgamal dc0b193b74 fix kvm stuff 2022-04-05 10:30:40 -07:00
klaases 1be70185bd Update KVM2 configuration for UEFI 2022-02-16 21:03:30 +00:00
Medya Ghazizadeh 969b5cddf1
Merge pull request #13520 from minikube-bot/auto_bump_golint_version
bump golint version to v1.44.0
2022-02-02 15:57:24 -08:00
Medya Gh 8c6f9f64c7 lint 2022-01-31 15:18:04 -08:00
Anoop C S 061fd88d2e drivers/kvm: Use ARP for retrieving interface ip addresses
On platforms where dhcp lease status is not updated immediately after
domain creation it fails to list ip addresses until next refresh
happens resulting in the following error:

8<----------8<----------8<----------8<----------8<----------8<----------

Creating kvm2 VM (CPUs=2, Memory=4096MB, Disk=20480MB) ...
Failed to start kvm2 VM. Running "minikube delete" may fix it: creating
  host: create: Error creating machine: Error in driver during machine
  creation: IP not available after waiting: machine minikube didn't
  return IP after 1 minute

Exiting due to GUEST_PROVISION: Failed to start host: creating host:
  create: Error creating machine: Error in driver during machine
  creation: IP not available after waiting: machine minikube didn't
  return IP after 1 minute

8<----------8<----------8<----------8<----------8<----------8<----------

Using ARP instead of LEASE for ip address query is justifiable as
listing is done following the domain creation. In case of failure we
fallback to listing via LEASE source.

Signed-off-by: Anoop C S <anoopcs@cryptolab.net>
2022-01-29 09:57:56 +05:30
Predrag Rogic a23f8381f7
upgrade-libvirt to 8th gen 2022-01-23 02:58:49 +00:00
KallyDev 70022d9b2e
Move from deprecated ioutil to os and io packages 2021-10-08 08:57:19 +08:00
Steven Powell 145f9fc9ab run `go fmt` 2021-09-13 11:58:43 -07:00
Raghavendra Talur dceb676527 Add extra disks capability to kvm2 driver
Having additional disks on the nodes is a requirement for developers
working on the storage components in Kubernetes. This commit adds the
extra-disks feature to the kvm2 driver.

Signed-off-by: Raghavendra Talur <raghavendra.talur@gmail.com>
2021-08-25 00:15:02 -04:00
Ilya Zuyev e3b5c2f8cf fix linter error 2021-06-25 13:49:54 -07:00
Ilya Zuyev 58754c910c update domain definition 2021-06-24 23:06:56 -07:00
Ilya Zuyev e48c8d289f fix domain definition 2021-06-21 21:16:04 -07:00
Ilya Zuyev 952b28e3b7 log out xml domain definition 2021-06-21 21:15:47 -07:00
Ilya Zuyev 37faf73207 improve logs 2021-06-21 17:56:14 -07:00
Ilya Zuyev a59e6a7341 remove acpi config from amd64 libvirt domain 2021-06-21 16:26:37 -07:00
Ilya Zuyev 84feb87502 fix arm64 libvirt domain definition 2021-06-21 16:16:10 -07:00
Ilya Zuyev 6de16a406e Add libvirt domain definition for arm64 2021-06-21 15:26:35 -07:00
Predrag Rogic 387ad774bb
multinode: fix kindnet and dns issues 2021-04-05 16:18:37 +01:00
Predrag Rogic 06d4313f3f
kvm2 driver: add static ip 2021-03-27 23:33:24 +00:00
Predrag Rogic f4a375181a
create network: use locks and reservations to solve race condition 2021-03-18 18:38:06 +00:00
Predrag Rogic 474f6734b1
create network: use locks to solve race conditions 2021-03-17 22:56:22 +00:00
Predrag Rogic 223792b993
create network: use locks to solve race conditions 2021-03-17 14:32:39 +00:00
phantooom 529881e01c fix: fix kvm2 numa simulate ut&lint 2021-03-02 22:40:42 +08:00
phantooom badc5d4532 add more check for kvm2 support simulate numa node 2021-03-02 22:27:26 +08:00
phantooom e11f23a4c9 kvm2 driver support simulate numa node 2021-03-02 22:27:26 +08:00
Medya Ghazizadeh 6bf3c23699
Merge pull request #10479 from prezha/fix-kvm-network-cleanup
improve kvm network delete/cleanup
2021-02-19 16:31:26 -08:00
Predrag Rogic 6d61795352
simplify free subnet query for oci net create 2021-02-17 03:04:47 +00:00
Predrag Rogic 4018ee3682
move to separate network package and fix naming 2021-02-17 03:04:47 +00:00
Predrag Rogic d48b0a58e8
add ip conflict auto-resolution also to kvm and consolidate 2021-02-17 03:04:47 +00:00
Predrag Rogic a5f75b4a29
fix wording 2021-02-17 02:45:22 +00:00