Commit Graph

3158 Commits

Author SHA1 Message Date
Thomas Lamprecht
b236d33e4a bump version to 7.0-10
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-07 14:56:40 +02:00
Fabian Ebner
ec5d198e5b cfg2cmd: avoid io_uring with LVM and write{back, through} cache
Reported in the community forum[0]. Also tried with LVM-thin, but it
doesn't seem to be affected.

See also 628937f53a for the same fix for
krbd.

[0]: https://forum.proxmox.com/threads/after-upgrade-to-7-0-all-vms-dont-boot.92019/post-401017

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-07-07 14:55:17 +02:00
Thomas Lamprecht
d2428c7713 bump version to 7.0-9
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-07 12:07:39 +02:00
Thomas Lamprecht
d3f9db4d7a fix cpuunits defaults regression
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-07 12:07:39 +02:00
Thomas Lamprecht
60ac42335a bump version to 7.0-8
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-07 10:28:01 +02:00
Thomas Lamprecht
67498860a4 conf: cpuunits: adapt description and defaults for cgroup v2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-07 10:27:05 +02:00
Thomas Lamprecht
6c71a52acd cpu weight: clamp to maximum for cgroup v2
In v2 the range is [1, 10000], but the API allows the old limits from
2 to 262144, so clamp the upper for v2.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-07 09:36:20 +02:00
Alexandre Derumier
4a5cb613d3 api2: fix vmconfig_apply_pending errors handling
commit
https://git.proxmox.com/?p=qemu-server.git;a=commit;h=eb5e482ded9ae6aeb6575de9441b79b90a5de531

have introduced error handling for offline pending apply,

-               PVE::QemuServer::vmconfig_apply_pending($vmid, $conf, $storecfg, $running);
+               PVE::QemuServer::vmconfig_apply_pending($vmid, $conf, $storecfg, $running, $errors);

 sub vmconfig_apply_pending {
-    my ($vmid, $conf, $storecfg) = @_;
+    my ($vmid, $conf, $storecfg, $errors) = @_;

but they was wrong nonused $running param, so currently $errors are not correctly handled

Fixes: eb5e482ded ("vmconfig_apply_pending: add error handling")
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Tested-by: Oguz Bektas <o.bektas@proxmox.com>
2021-07-06 12:40:43 +02:00
Thomas Lamprecht
1a947e67fe bump version to 7.0-7
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-05 20:49:55 +02:00
Thomas Lamprecht
738dc81cba further improve on #3329, ensure write-back is used over write-around
Suggested-by: Rick Altherr <kc8apf@kc8apf.net>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-05 20:47:50 +02:00
Thomas Lamprecht
e43b19109e bump version to 7.0-6
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-02 09:45:10 +02:00
Thomas Lamprecht
9de049b0ad live-restore: add another comment for efidisk special case just to be sure
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-07-01 12:57:11 +02:00
Stefan Reiter
6f94e1625b live-restore: preload efidisk before starting VM
The efidisk never got restored correctly before, since we don't use the
generic print_drive_commandline_full for it, and as such it didn't get a
backing image attached. This not only causes the efidisk data to be lost
on restore, but also an error at the end, since we try to remove a
non-existing PBS blockdev.

Since it is attached differently to a regular drive, adding PBS backing
would be more difficult, but not to worry: an efidisk is small enough
that it doesn't hurt performance to just restore it via the regular
mechanism before starting the VM, and simply excluding it from the live
restore entirely.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-07-01 12:54:32 +02:00
Stefan Reiter
628937f53a cfg2cmd/drive: don't use io_uring for krbd with wb/wt cache
As reported here and locally reproduced:
https://forum.proxmox.com/threads/efi-vms-wont-start-under-7-beta-with-writeback-cache.91629/

This configuration is currently broken. Until we figure out how to fix
it properly, we can just have this (luckily very narrow) config pattern
fall back to aio=threads as it used to.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-07-01 09:40:51 +02:00
Thomas Lamprecht
defa8e21be bump version to 7.0-5
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-24 18:58:22 +02:00
Dominik Csapak
2c44ec4974 fix #2175: PVE/API2/Qemu: update_vm_api: check old drive for permissions too
otherwise a user with only VM.Config.CDROM can detach a disk from a VM
by updating it to a cdrom drive

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-06-24 18:56:04 +02:00
Dominik Csapak
bb660bc3ce PVE/API2/Qemu/update_vm_api: refactor drive permission check
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-06-24 18:56:04 +02:00
Thomas Lamprecht
6185586ebd bump version to 7.0-5
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-24 18:45:57 +02:00
Thomas Lamprecht
5620282fbd cfg2cmd: add btrfs-store and test for cache mode
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-24 18:42:55 +02:00
Wolfgang Bumiller
0fe779a62c don't default to O_DIRECT on btrfs without nocow
otherwise it'll produce a whole lot of checksum errors

and while this would be nice as a storage feature check,
it's hard to be 100% accurate there anyway since a directory
storage can point anywhere, like for instance a btrfs
directory, causing the same issue...

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-06-24 17:15:31 +02:00
Thomas Lamprecht
07dfe5391e bump version to 7.0-4
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-23 12:57:31 +02:00
Fabian Grünbichler
85fcf79e21 template: add -snapshot to KVM command
this allows effectively setting ALL volumes as read-only, even if the
disk controller does not support it. without it, IDE and SATA disks
with (base) volumes which are marked read-only/immutable on the storage
level prevent the template VM from starting for backup purposes.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-06-23 12:37:40 +02:00
Fabian Grünbichler
2c53ff94fa test: add template drive read-only tests
ensuring the current behaviour:

templates will pass readonly=on to Qemu, except for SATA and IDE drives
which don't support that flag.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-06-23 12:37:40 +02:00
Fabian Grünbichler
b4dc647557 template: mark efidisk as read-only
otherwise backups of templates using UEFI fail with storages like LVM
thin, where the volumes are not writable. disk controllers like IDE and
SATA that don't support being read-only are still broken for UEFI.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
[ drop the readonly=off when not required, resolve merger conflict
  from Dominik's EFI disk cache mode fix ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-23 12:36:20 +02:00
Fabian Grünbichler
75748d4492 drive: factor out read-only helper
we also need it for efidisks.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-06-23 12:27:54 +02:00
Fabian Grünbichler
75c430cee8 test: unbreak restore_config_test
for unprivileged users (and possibly some root setups). reading from
pmxcfs now results in a hard error for unprivileged users, so there
might be some more of these lurking somewhere..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-06-23 12:27:54 +02:00
Fabian Ebner
872cfcf5bc api: update vm: correctly handle warnings status for delayed task
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-23 12:26:53 +02:00
Fabian Ebner
831ad442a2 cli tools: correctly handle warnings task status
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-23 12:26:49 +02:00
Wolfgang Bumiller
205dbf39b1 allow migrating raw btrfs volumes
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2021-06-23 12:26:40 +02:00
Thomas Lamprecht
a799cf5b64 d/control: bump versioned dependency for pve-common
to ensure the newer systemd properties required for KillMode=none
replacement can be used

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-23 12:16:36 +02:00
Thomas Lamprecht
db861a4617 migrate prepare: make content type check generic
to avoid false-positives, e.g., from a ISO on a ISO only storage.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-23 12:15:43 +02:00
Thomas Lamprecht
8a5bd88907 migrate prepare: use also explicit variable for storecfg
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-23 12:15:16 +02:00
Thomas Lamprecht
3148f0b053 check_storage_availability: make content type check generic
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-23 12:03:35 +02:00
Stefan Reiter
354e61aacc use KillMode 'process' for systemd scope
KillMode 'none' is deprecated, and systemd loudly complains about that
in the journal. To avoid the warning, but keep the behaviour the same,
use KillMode 'process'.

This mode does two things differently, which we have to stop it from
doing:
* it sends SIGTERM right when the scope is cancelled (e.g. on shutdown)
 -> but only to the "root" process, which in our case is the worker
 instance forking QEMU, so it is already dead by the time this happens
* it sends SIGKILL to *all* children after a timeout
 -> can be avoided by setting either SendSIGKILL to false, or
 TimeoutStopUSec to infinity - for safety, we do both

In my testing, this replicated the previous behaviour exactly, but
without using the deprecated 'none' mode.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-06-23 12:02:59 +02:00
Lorenz Stechauner
3f11f0d7e2 vm_start: check if storages of volumes support correct content-type
Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
2021-06-23 12:02:50 +02:00
Stefan Reiter
6d5673c3b6 cfg2cmd: make io_uring default
The 'aio' setting is not visible to the guest, and so can be changed
during migrations or snapshots without issue. It is thus only
dependendent on the actual QEMU version being >= 6.0, not machine
version.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-06-23 12:02:44 +02:00
Stefan Reiter
59e5934270 enable io-uring support
Note that the value in this enum directly represents the value passed to
QEMU, so we need to use the underscore.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-06-23 12:01:59 +02:00
Thomas Lamprecht
a83b2330fc bump version to 7.0-3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-21 11:18:39 +02:00
Fabian Ebner
24b84b4766 migrate: enforce that image content type is available
and use it for the vdisk_list call too. This avoids scanning (and picking up
volumes from!) storages that are not even configured to hold images.

Previously, the content type was only enforced when a storage map was present.

Also serves a bit as a preparation to enforce content type on guest startup,
because now migration failure happens early and not only when trying to start
the guest on the remote node.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-21 11:17:48 +02:00
Fabian Ebner
0d2db08414 prefer storage_check_enabled over storage_check_node
storage_check_enabled simply checks for the 'disable' option and then calls
storage_check_node.

While not strictly necessary for a second call where only the storage differs,
e.g. in case of clone, it is more future-proof: if support for a target storage
is added at some point, it might be easy to miss adapting the call.

For the migration checks, the situation is improved by now always catching
disabled (target) storages.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-21 11:17:48 +02:00
Fabian Ebner
cc1cdadbf4 test: fix restore config test as unprivileged user
after upgrading to bullseye, the cfs_read_file call within
restore_update_config_line() results in an error:
    Is a directory!
when done as an unprivileged user.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-18 17:26:24 +02:00
Fabian Ebner
8a0addab87 vmstatus: don't set PID when VM is not running
by avoiding int(undef)

Reported-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-18 14:05:35 +02:00
Thomas Lamprecht
a200af1084 config: limit description/comment length to 8 KiB
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-18 13:11:07 +02:00
Fabian Ebner
ad2cad72be vm status: force int where appropriate
to avoid potential problems with stringified numbers in Javascript and
elsewehere.

The vmid was not always an integer as the return schema expects, namely
when there was an opt_vmid argument, because the 'ne' comparision coerced the
vmid to be a string then.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-06-17 14:47:35 +02:00
Fabian Ebner
ef88eaaa58 avoid setting lun number for drives when pvscsi controller is used
Reported in the community forum[0].

In QEMU's hw/scsi/vmw_pvscsi.c in the SCSIBusInfo struct, the max_lun property
is set to 0. This means that in our stack, one cannot have multiple disks and
use 'scsihw: pvscsi' currently, as kvm would fail with
    bad scsi device lun: 1

Instead of increasing the lun number, increase the scsi-id, as we already do for
lsi.* (in hw/scsi/lsi53c895a.c the max_lun property is also 0).

[0]: https://forum.proxmox.com/threads/kvm-bad-scsi-device-lun-1.84318/

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
Reviewed-by: Stefan Reiter <s.reiter@proxmox.com>
Tested-by: Stefan Reiter <s.reiter@proxmox.com>
2021-06-16 20:26:27 +02:00
Thomas Lamprecht
9da0feb5e5 cfg2cmd: add test for efidisk rbd cache handling
I don't think this is something which will get broken by accident but
still nice to "document" this behavior in a regression test

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-16 15:24:57 +02:00
Thomas Lamprecht
26d717252a followup; shorter code for efidisk rbd cache handling
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-16 15:18:03 +02:00
Dominik Csapak
6aaad2306d fix #3329: turn on cache=writeback for efidisks on rbd
on slower ceph clusters, the write pattern of the ovmf booting process
slows down the boot of the vm, so we turn on caching by default

it seems no other storage (until now) behaves like this. if it does in
the future, we can still add them too, or add a 'cache' property for
the efidisk

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-06-16 15:14:30 +02:00
Fabian Ebner
16e66777a0 vm destroy: do not remove unreferenced disks by default
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
Reviewed-by: Stefan Reiter <s.reiter@proxmox.com>
2021-06-08 14:56:39 +02:00
Fabian Ebner
9a8ba1272c scan volids: remove superfluous parameter
The only caller that didn't use 'images' was removed as part of the migration
refactoring in commit 62a4c963b8, so this is not
even a breaking change as the 'PVE 7' comment might've suggested.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
Reviewed-by: Stefan Reiter <s.reiter@proxmox.com>
2021-06-08 14:56:30 +02:00