Commit Graph

124 Commits (1a176c398edc70d0302952d3d0c497135b8e38a5)

Author SHA1 Message Date
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
Predrag Rogic fc07cfd395
fix wording 2021-02-17 02:45:22 +00:00
Predrag Rogic 1f50c63adb
fix wording 2021-02-17 02:45:22 +00:00
Predrag Rogic 5c8ea8dc5b
improve kvm network delete/cleanup 2021-02-17 02:45:03 +00:00
Predrag Rogic 9e114139dc
retry instead of sleep; gc cleanup 2020-11-10 16:28:14 +00:00