]> git.proxmox.com Git - qemu-server.git/log
qemu-server.git
2 years agobump version to 7.0-9
Thomas Lamprecht [Wed, 7 Jul 2021 10:02:18 +0000 (12:02 +0200)]
bump version to 7.0-9

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofix cpuunits defaults regression
Thomas Lamprecht [Wed, 7 Jul 2021 10:01:27 +0000 (12:01 +0200)]
fix cpuunits defaults regression

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump version to 7.0-8
Thomas Lamprecht [Wed, 7 Jul 2021 08:28:01 +0000 (10:28 +0200)]
bump version to 7.0-8

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoconf: cpuunits: adapt description and defaults for cgroup v2
Thomas Lamprecht [Wed, 7 Jul 2021 08:27:05 +0000 (10:27 +0200)]
conf: cpuunits: adapt description and defaults for cgroup v2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agocpu weight: clamp to maximum for cgroup v2
Thomas Lamprecht [Wed, 7 Jul 2021 07:36:17 +0000 (09:36 +0200)]
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>
2 years agoapi2: fix vmconfig_apply_pending errors handling
Alexandre Derumier [Mon, 5 Jul 2021 22:02:30 +0000 (00:02 +0200)]
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>
2 years agobump version to 7.0-7
Thomas Lamprecht [Mon, 5 Jul 2021 18:49:55 +0000 (20:49 +0200)]
bump version to 7.0-7

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofurther improve on #3329, ensure write-back is used over write-around
Thomas Lamprecht [Mon, 5 Jul 2021 18:47:42 +0000 (20:47 +0200)]
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>
2 years agobump version to 7.0-6
Thomas Lamprecht [Fri, 2 Jul 2021 07:45:10 +0000 (09:45 +0200)]
bump version to 7.0-6

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agolive-restore: add another comment for efidisk special case just to be sure
Thomas Lamprecht [Thu, 1 Jul 2021 10:57:11 +0000 (12:57 +0200)]
live-restore: add another comment for efidisk special case just to be sure

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agolive-restore: preload efidisk before starting VM
Stefan Reiter [Thu, 1 Jul 2021 09:37:29 +0000 (11:37 +0200)]
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>
2 years agocfg2cmd/drive: don't use io_uring for krbd with wb/wt cache
Stefan Reiter [Wed, 30 Jun 2021 15:18:17 +0000 (17:18 +0200)]
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>
2 years agobump version to 7.0-5
Thomas Lamprecht [Thu, 24 Jun 2021 16:58:22 +0000 (18:58 +0200)]
bump version to 7.0-5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofix #2175: PVE/API2/Qemu: update_vm_api: check old drive for permissions too
Dominik Csapak [Thu, 24 Jun 2021 14:25:11 +0000 (16:25 +0200)]
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>
2 years agoPVE/API2/Qemu/update_vm_api: refactor drive permission check
Dominik Csapak [Thu, 24 Jun 2021 14:25:10 +0000 (16:25 +0200)]
PVE/API2/Qemu/update_vm_api: refactor drive permission check

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agobump version to 7.0-5
Thomas Lamprecht [Thu, 24 Jun 2021 16:45:57 +0000 (18:45 +0200)]
bump version to 7.0-5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agocfg2cmd: add btrfs-store and test for cache mode
Thomas Lamprecht [Thu, 24 Jun 2021 16:41:45 +0000 (18:41 +0200)]
cfg2cmd: add btrfs-store and test for cache mode

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agodon't default to O_DIRECT on btrfs without nocow
Wolfgang Bumiller [Thu, 24 Jun 2021 14:58:33 +0000 (16:58 +0200)]
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>
2 years agobump version to 7.0-4
Thomas Lamprecht [Wed, 23 Jun 2021 10:57:31 +0000 (12:57 +0200)]
bump version to 7.0-4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agotemplate: add -snapshot to KVM command
Fabian Grünbichler [Fri, 4 Jun 2021 09:47:47 +0000 (11:47 +0200)]
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>
2 years agotest: add template drive read-only tests
Fabian Grünbichler [Fri, 4 Jun 2021 09:47:46 +0000 (11:47 +0200)]
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>
2 years agotemplate: mark efidisk as read-only
Fabian Grünbichler [Fri, 4 Jun 2021 09:47:45 +0000 (11:47 +0200)]
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>
2 years agodrive: factor out read-only helper
Fabian Grünbichler [Fri, 4 Jun 2021 09:47:44 +0000 (11:47 +0200)]
drive: factor out read-only helper

we also need it for efidisks.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agotest: unbreak restore_config_test
Fabian Grünbichler [Fri, 4 Jun 2021 09:47:43 +0000 (11:47 +0200)]
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>
2 years agoapi: update vm: correctly handle warnings status for delayed task
Fabian Ebner [Wed, 12 May 2021 12:32:58 +0000 (14:32 +0200)]
api: update vm: correctly handle warnings status for delayed task

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agocli tools: correctly handle warnings task status
Fabian Ebner [Wed, 12 May 2021 12:32:57 +0000 (14:32 +0200)]
cli tools: correctly handle warnings task status

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoallow migrating raw btrfs volumes
Wolfgang Bumiller [Tue, 22 Jun 2021 12:18:28 +0000 (14:18 +0200)]
allow migrating raw btrfs volumes

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agod/control: bump versioned dependency for pve-common
Thomas Lamprecht [Wed, 23 Jun 2021 10:16:34 +0000 (12:16 +0200)]
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>
2 years agomigrate prepare: make content type check generic
Thomas Lamprecht [Wed, 23 Jun 2021 10:15:42 +0000 (12:15 +0200)]
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>
2 years agomigrate prepare: use also explicit variable for storecfg
Thomas Lamprecht [Wed, 23 Jun 2021 10:15:16 +0000 (12:15 +0200)]
migrate prepare: use also explicit variable for storecfg

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agocheck_storage_availability: make content type check generic
Thomas Lamprecht [Wed, 23 Jun 2021 10:03:35 +0000 (12:03 +0200)]
check_storage_availability: make content type check generic

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agouse KillMode 'process' for systemd scope
Stefan Reiter [Mon, 21 Jun 2021 16:35:41 +0000 (18:35 +0200)]
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>
2 years agovm_start: check if storages of volumes support correct content-type
Lorenz Stechauner [Tue, 22 Jun 2021 12:30:30 +0000 (14:30 +0200)]
vm_start: check if storages of volumes support correct content-type

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
2 years agocfg2cmd: make io_uring default
Stefan Reiter [Mon, 21 Jun 2021 15:33:18 +0000 (17:33 +0200)]
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>
2 years agoenable io-uring support
Stefan Reiter [Mon, 21 Jun 2021 15:33:17 +0000 (17:33 +0200)]
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>
2 years agobump version to 7.0-3
Thomas Lamprecht [Mon, 21 Jun 2021 09:15:21 +0000 (11:15 +0200)]
bump version to 7.0-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agomigrate: enforce that image content type is available
Fabian Ebner [Fri, 18 Jun 2021 10:59:34 +0000 (12:59 +0200)]
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>
2 years agoprefer storage_check_enabled over storage_check_node
Fabian Ebner [Fri, 18 Jun 2021 10:59:33 +0000 (12:59 +0200)]
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>
2 years agotest: fix restore config test as unprivileged user
Fabian Ebner [Mon, 31 May 2021 14:27:10 +0000 (16:27 +0200)]
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>
2 years agovmstatus: don't set PID when VM is not running
Fabian Ebner [Fri, 18 Jun 2021 11:36:40 +0000 (13:36 +0200)]
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>
2 years agoconfig: limit description/comment length to 8 KiB
Thomas Lamprecht [Fri, 18 Jun 2021 11:11:07 +0000 (13:11 +0200)]
config: limit description/comment length to 8 KiB

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agovm status: force int where appropriate
Fabian Ebner [Tue, 1 Jun 2021 06:43:06 +0000 (08:43 +0200)]
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>
2 years agoavoid setting lun number for drives when pvscsi controller is used
Fabian Ebner [Tue, 13 Apr 2021 08:24:14 +0000 (10:24 +0200)]
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>
2 years agocfg2cmd: add test for efidisk rbd cache handling
Thomas Lamprecht [Wed, 16 Jun 2021 13:24:55 +0000 (15:24 +0200)]
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>
2 years agofollowup; shorter code for efidisk rbd cache handling
Thomas Lamprecht [Wed, 16 Jun 2021 13:17:58 +0000 (15:17 +0200)]
followup; shorter code for efidisk rbd cache handling

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofix #3329: turn on cache=writeback for efidisks on rbd
Dominik Csapak [Wed, 16 Jun 2021 13:09:33 +0000 (15:09 +0200)]
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>
2 years agovm destroy: do not remove unreferenced disks by default
Fabian Ebner [Fri, 4 Jun 2021 13:49:30 +0000 (15:49 +0200)]
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>
2 years agoscan volids: remove superfluous parameter
Fabian Ebner [Fri, 4 Jun 2021 13:49:29 +0000 (15:49 +0200)]
scan volids: remove superfluous parameter

The only caller that didn't use 'images' was removed as part of the migration
refactoring in commit 62a4c963b824c923a4fc82a48c81d0f63ebaddae, 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>
2 years agoRevert "revert spice_ticket prefix change in 7827de4"
Fabian Ebner [Fri, 4 Jun 2021 13:49:28 +0000 (15:49 +0200)]
Revert "revert spice_ticket prefix change in 7827de4"

This reverts commit ff09c795edd12b1cc4604ee28a7cdd99cdd1afa8. We wanted to wait
until PVE 7.0 for the change to not break migration new -> old until then.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
Reviewed-by: Stefan Reiter <s.reiter@proxmox.com>
2 years agobuildsys: change upload dist to bullseye
Thomas Lamprecht [Tue, 8 Jun 2021 07:47:35 +0000 (09:47 +0200)]
buildsys: change upload dist to bullseye

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agovzdump: add master key support
Fabian Grünbichler [Fri, 28 May 2021 12:09:53 +0000 (14:09 +0200)]
vzdump: add master key support

running outdated VMs without master key support will generate a warning
but proceed with a backup without encrypted key upload.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agovzdump: drop legacy fallback logging for dirty-bitmap
Thomas Lamprecht [Wed, 2 Jun 2021 14:48:13 +0000 (16:48 +0200)]
vzdump: drop legacy fallback logging for dirty-bitmap

Users need to reboot at least once for the upgrade to 7.0, so any VM
running is then using a new enough QEMU...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agobump version to 7.0-2
Thomas Lamprecht [Fri, 28 May 2021 11:08:50 +0000 (13:08 +0200)]
bump version to 7.0-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agolive-restore: merge snapshot/repo log lines into one
Thomas Lamprecht [Fri, 28 May 2021 10:14:34 +0000 (12:14 +0200)]
live-restore: merge snapshot/repo log lines into one

to many lines make task log harder to read

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agolive-restore: add more logging
Stefan Reiter [Tue, 18 May 2021 15:13:44 +0000 (17:13 +0200)]
live-restore: add more logging

To bring it better in line with regular restore, also log the
repository, the snapshot and the target for each drive.

While at it, adjust capitalization of existing log line and clean up
repeated '$1' use.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2 years agodestroy VM: also check if unused volumes are base images
Fabian Ebner [Mon, 19 Apr 2021 08:46:43 +0000 (10:46 +0200)]
destroy VM: also check if unused volumes are base images

It's arguably not likely in practice that only an unused volume is still in use
as a base image, but do it for completeness sake.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agodestroy VM: always remove (referenced) VM state volumes
Fabian Ebner [Mon, 19 Apr 2021 08:46:42 +0000 (10:46 +0200)]
destroy VM: always remove (referenced) VM state volumes

With --destroy-unreferenced-disks 0 they were not removed yet, but no use in
keeping them around.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoqm: assume correct VNC setup in 'vncproxy', disallow passwordless
Stefan Reiter [Thu, 27 May 2021 10:27:51 +0000 (12:27 +0200)]
qm: assume correct VNC setup in 'vncproxy', disallow passwordless

The QMP 'change' command is no longer available since QEMU 6.0, so this
cannot work - instead of replacing it, we can just remove it however.

The 'if' branch would only set the VNC socket path anew and enable
password mode, which is always set and enabled on startup already.
The 'else' branch was intended for certificate login (?), which
according to the FIXME comment is long gone anyway - simply forbid
'vncproxy' without the PVE ticket environment variable set.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2 years agocfg2cmd: use long form QEMU parameters to avoid warning in 6.0
Stefan Reiter [Thu, 27 May 2021 10:27:50 +0000 (12:27 +0200)]
cfg2cmd: use long form QEMU parameters to avoid warning in 6.0

QEMU warns us about this:

kvm: -chardev socket,id=qmp,path=/var/run/qemu-server/100.qmp,server,nowait: warning: short-form boolean option 'server' deprecated
Please use server=on instead
kvm: -chardev socket,id=qmp,path=/var/run/qemu-server/100.qmp,server,nowait: warning: short-form boolean option 'nowait' deprecated
Please use wait=off instead
kvm: -vnc unix:/var/run/qemu-server/100.vnc,password: warning: short-form boolean option 'password' deprecated
Please use password=on instead

The new syntax is backwards compatible to at least QEMU 4.0.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2 years agovmstatus: make template property optional
Fabian Ebner [Thu, 11 Mar 2021 10:26:47 +0000 (11:26 +0100)]
vmstatus: make template property optional

to avoid printing 'template: ' with 'qm status <id> --verbose' if it's false.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoapi: clone: sort vm disks to keep numbers consistent
Lorenz Stechauner [Wed, 26 May 2021 14:19:17 +0000 (16:19 +0200)]
api: clone: sort vm disks to keep numbers consistent

reported by user in forum:
https://forum.proxmox.com/threads/problem-when-copying-template-with-2-discs.89851/

Signed-off-by: Lorenz Stechauner <l.stechauner@proxmox.com>
3 years agobump version to 7.0-1
Thomas Lamprecht [Thu, 13 May 2021 17:11:22 +0000 (19:11 +0200)]
bump version to 7.0-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agodebian: update compat, copyright, ..
Thomas Lamprecht [Thu, 13 May 2021 17:09:29 +0000 (19:09 +0200)]
debian: update compat, copyright, ..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agobump version to 6.4-2
Thomas Lamprecht [Thu, 29 Apr 2021 14:16:51 +0000 (16:16 +0200)]
bump version to 6.4-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agofix #2862: allow sata/ide template backups
Fabian Grünbichler [Mon, 26 Apr 2021 12:11:03 +0000 (14:11 +0200)]
fix #2862: allow sata/ide template backups

for IDE and SATA, setting the whole drive into readonly mode is not
possible. skip the readonly flag for such drives as a workaround until
we find a better solution.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agofix bootdisk_size for new bootorder config scheme
Dominik Csapak [Mon, 8 Mar 2021 13:43:38 +0000 (14:43 +0100)]
fix bootdisk_size for new bootorder config scheme

Previously, we ever only had a single boot *disk*, while possibly
having multiple cdroms/nics in the boot order

e.g. the config:

 boot: dnc
 bootdisk: scsi0
 ide0: media=cdrom,none
 scsi0: xxx
 net0: ...

would return the size of scsi0 even though it would first boot
from cdrom/network.

When editing the bootorder with such a legacy config, we
remove the 'bootdisk' property and replace the legacy notation
with an explicit order, but we only search the first disk
for the size now.

Restore that behaviour by iterating over all disks in the boot
order property string until we get one that is not a cdrom
and has a size.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
3 years agoRevert "migration: do not set default speed limit"
Thomas Lamprecht [Thu, 29 Apr 2021 12:27:41 +0000 (14:27 +0200)]
Revert "migration: do not set default speed limit"

The default was changed for 5.2, so while it is not 32 MiB/s anymore,
it is still 128 MiB/s which I did not notice on my 1 Gbps (or < 125
MiB/s) setup. For users with links faster than one gigabit it now did
some limiting - so setup a very high limit so than even 100G should
not max this out.

This reverts commit a89bd100846f8e923aa7d15863b92e6e2d7264d2.

3 years agobump version to 6.4-1
Thomas Lamprecht [Fri, 23 Apr 2021 14:26:59 +0000 (16:26 +0200)]
bump version to 6.4-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agomigrate: fix memory migration start time
Fabian Ebner [Fri, 23 Apr 2021 12:31:40 +0000 (14:31 +0200)]
migrate: fix memory migration start time

The variable is only ever used for calculating the average speed of memory
migration, but it was set before disk mirroring already. But the disk
sizes are not included in the calculation, resulting in (very) wrong values.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agoqemu_img_convert: add missing newline for progress output
Fabian Ebner [Thu, 22 Apr 2021 06:57:57 +0000 (08:57 +0200)]
qemu_img_convert: add missing newline for progress output

which was accidentally removed by b5e9d97bdf8a63a542f8cbb3c1d0821ee731f796.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agofix #3369: auto-start vm after failed stopmode backup
Dylan Whyte [Tue, 20 Apr 2021 13:14:37 +0000 (15:14 +0200)]
fix #3369: auto-start vm after failed stopmode backup

Fixes an issue in which a VM/CT fails to automatically restart after a
failed stop-mode backup.

Also fixes a minor typo in a comment

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
3 years agolive-restore: hold 'create' lock during operation
Stefan Reiter [Wed, 21 Apr 2021 14:25:25 +0000 (16:25 +0200)]
live-restore: hold 'create' lock during operation

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agolive-restore: don't remove VM on error
Stefan Reiter [Wed, 21 Apr 2021 14:25:24 +0000 (16:25 +0200)]
live-restore: don't remove VM on error

Potentially an admin can still recover some data, or wants to inspect
the state.

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agoqmrestore: add live-restore option
Stefan Reiter [Wed, 21 Apr 2021 14:25:23 +0000 (16:25 +0200)]
qmrestore: add live-restore option

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agodrive: volume in-use check: remove unused closure parameter
Fabian Ebner [Mon, 19 Apr 2021 13:39:50 +0000 (15:39 +0200)]
drive: volume in-use check: remove unused closure parameter

and simplify the calling iteration.

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agomigration: keep log rate steady if polling gets more frequent
Thomas Lamprecht [Mon, 19 Apr 2021 20:01:05 +0000 (22:01 +0200)]
migration: keep log rate steady if polling gets more frequent

Either we're done in a few seconds anyway, or if the VM dirties lots
of pages we need quite a bit of time, and then it does not help to
output roughly the same status 10 times a second...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agomigration: rework logging to more humand friendly, less spammy
Thomas Lamprecht [Mon, 19 Apr 2021 19:54:33 +0000 (21:54 +0200)]
migration: rework logging to more humand friendly, less spammy

* use render_bytes where possible, to get quick to read and grasp
  units printed
* xbzrle is only interesting if actually pages/bytes are send using
  it, so only log in that case
* log if VM dirties more than we send
* log current speed we get from QEMU

In general there are less lines logged and huge integers are avoided.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agomigration: factor out variable + code cleanup
Thomas Lamprecht [Mon, 19 Apr 2021 19:51:21 +0000 (21:51 +0200)]
migration: factor out variable + code cleanup

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agomigration: log: s/migration_caps/migration capabilities/
Thomas Lamprecht [Mon, 19 Apr 2021 19:48:31 +0000 (21:48 +0200)]
migration: log: s/migration_caps/migration capabilities/

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agomigration: do not set default speed limit
Thomas Lamprecht [Mon, 19 Apr 2021 19:46:49 +0000 (21:46 +0200)]
migration: do not set default speed limit

the claim that QEMU limits this to 32M otherwise is bogus, at least
with any current QEMU version..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agomigration: refactor and tidy-up code
Thomas Lamprecht [Mon, 19 Apr 2021 12:56:12 +0000 (14:56 +0200)]
migration: refactor and tidy-up code

Use an early die so that the rest can loose an indentation level for
the actual migration status reporting code

Extract common used members of the stat hash for shorter code.

use `git show -w --word-diff=color --word-diff-regex='\w+'` for
getting a better view of actual changes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agomigration: move finishing block jobs to phase2 for better/uniform error handling
Fabian Ebner [Fri, 29 Jan 2021 15:11:43 +0000 (16:11 +0100)]
migration: move finishing block jobs to phase2 for better/uniform error handling

avoids the possibility to die during phase3_cleanup and instead of needing to
duplicate the cleanup ourselves, benefit from phase2_cleanup doing so.

The duplicate cleanup was also very incomplete: it didn't stop the remote kvm
process (leading to 'VM already running' when trying to migrate again
afterwards), but it removed its disks, and it didn't unlock the config, didn't
close the tunnel and didn't cancel the block-dirty bitmaps.

Since migrate_cancel should do nothing after the (non-storage) migrate process
has completed, even that cleanup step is fine here.

Since phase3 is empty at the moment, the order of operations is still the same.

Also add a test, that would complain about finish_tunnel not being called before
this patch. That test also checks that local disks are not already removed
before finishing the block jobs.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agomigration: split out replication from scan_local_volumes
Fabian Ebner [Fri, 29 Jan 2021 15:11:42 +0000 (16:11 +0100)]
migration: split out replication from scan_local_volumes

and avoid one loop over the config, by extending foreach_volid to include the
drivename.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agomigration: keep track of replicated volumes via local_volumes
Fabian Ebner [Fri, 29 Jan 2021 15:11:41 +0000 (16:11 +0100)]
migration: keep track of replicated volumes via local_volumes

by extending filter_local_volumes.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agomigration: use storage_migration for checks instead of online_local_volumes
Fabian Ebner [Fri, 29 Jan 2021 15:11:40 +0000 (16:11 +0100)]
migration: use storage_migration for checks instead of online_local_volumes

Like this we don't need to worry about auto-vivifaction.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agomigration: cleanup_remotedisks: simplify and include more disks
Fabian Ebner [Fri, 29 Jan 2021 15:11:39 +0000 (16:11 +0100)]
migration: cleanup_remotedisks: simplify and include more disks

Namely, those migrated with storage_migrate by using the information from
volume_map. Call cleanup_remotedisks in phase1_cleanup as well, because that's
where we end if sync_offline_local_volumes fails, and some disks might already
have been transfered successfully. Note that the local disks are still here, so
this is fine.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agomigration: simplify removal of local volumes and get rid of self->{volumes}
Fabian Ebner [Fri, 29 Jan 2021 15:11:38 +0000 (16:11 +0100)]
migration: simplify removal of local volumes and get rid of self->{volumes}

This also changes the behavior to remove the local copies of offline migrated
volumes only after the migration has finished successfully (this is relevant
for mixed settings, e.g. online migration with unused/vmstate disks).

local_volumes contains both, the volumes previously in $self->{volumes}
and the volumes in $self->{online_local_volumes}, and hence is the place
to look for which volumes we need to remove. Of course, replicated
volumes still need to be skipped.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agomigration: add nbd migrated volumes to volume_map earlier
Fabian Ebner [Fri, 29 Jan 2021 15:11:37 +0000 (16:11 +0100)]
migration: add nbd migrated volumes to volume_map earlier

and avoid a little bit of duplication by creating a helper

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agomigration: save targetstorage and bwlimit in local_volumes hash and re-use information
Fabian Ebner [Fri, 29 Jan 2021 15:11:36 +0000 (16:11 +0100)]
migration: save targetstorage and bwlimit in local_volumes hash and re-use information

It is enough to call get_bandwith_limit once for each source_storage.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agomigration: fix calculation of bandwith limit for non-disk migration
Fabian Ebner [Fri, 29 Jan 2021 15:11:35 +0000 (16:11 +0100)]
migration: fix calculation of bandwith limit for non-disk migration

The case with:
1. no generic 'migration' limit from the storage plugin
2. a migrate_speed limit in the VM config
was broken. It would assign 0 to migrate_speed when picking the minimum value
and then default to the default value. Fix it by checking if bwlimit is 0
before picking the minimum.

Also, make it a bit more readable by avoiding the trick of //-assigning bwlimit
before the units match up and relying on getting back the original bwlimit value
as the minimum. Instead, only ||-assign after the units match up and don't rely
on other things.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agomigration: split out config_update_local_disksizes from scan_local_volumes
Fabian Ebner [Fri, 29 Jan 2021 15:11:34 +0000 (16:11 +0100)]
migration: split out config_update_local_disksizes from scan_local_volumes

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agomigration: avoid re-scanning all volumes
Fabian Ebner [Fri, 29 Jan 2021 15:11:33 +0000 (16:11 +0100)]
migration: avoid re-scanning all volumes

by using the information obtained in the first scan. This
also makes sure we only scan local storages.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agomigration: split sync_disks into two functions
Fabian Ebner [Fri, 29 Jan 2021 15:11:32 +0000 (16:11 +0100)]
migration: split sync_disks into two functions

by making local_volumes class-accessible. One functions is for scanning all local
volumes and one is for actually syncing offline volumes via storage_migrate. The
exception is replicated volumes, this still happens during the scan for now.

Also introduce a filter_local_volumes helper, to makes life easier.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agotest: migration: add parse_volume_id calls
Fabian Ebner [Fri, 29 Jan 2021 15:11:31 +0000 (16:11 +0100)]
test: migration: add parse_volume_id calls

so it fails when something bad comes in.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agorestore: update config: remove unused parameter
Fabian Ebner [Thu, 18 Mar 2021 09:44:50 +0000 (10:44 +0100)]
restore: update config: remove unused parameter

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agotest: add tests for restoring config
Fabian Ebner [Thu, 18 Mar 2021 09:44:49 +0000 (10:44 +0100)]
test: add tests for restoring config

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agod/control: bump pve-storage dependency for new vdisk param
Thomas Lamprecht [Sun, 18 Apr 2021 16:04:29 +0000 (18:04 +0200)]
d/control: bump pve-storage dependency for new vdisk param

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
3 years agofilter by content type when using vdisk_list
Fabian Ebner [Mon, 22 Mar 2021 14:32:43 +0000 (15:32 +0100)]
filter by content type when using vdisk_list

except for migration, where it would be subtly backwards-incompatible. Since
there is a scan_volids call for migration, we can't default to filtering in
scan_volids just yet.

Also allows to get rid of the existing filtering hack in rescan().

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
3 years agocfg2cmd: fix +pveN machine types with pxe
Stefan Reiter [Wed, 31 Mar 2021 14:39:23 +0000 (16:39 +0200)]
cfg2cmd: fix +pveN machine types with pxe

Pinned machine versions like "pc-i440fx-4.2+pve2.pxe" would otherwise
get a second "+pve0" suffix, which is incorrect.

Also deal with non-pve pinned versions correctly, i.e.
"pc-i440fx-5.2.pxe" becomes "pc-i440fx-5.2+pve0.pxe".

Handle .pxe suffixes in Machine.pm as well, and add two test cases.

Co-developed-by: Luca Berneking <luca@berneking.net>
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
3 years agodrive: volume in-use check: fix fallback path comparison
Fabian Ebner [Thu, 15 Apr 2021 10:10:57 +0000 (12:10 +0200)]
drive: volume in-use check: fix fallback path comparison

When checking whether a volume is still referenced by a snapshot, the volid
itself is first checked. When the volid is different, we fall back to comparing
the path.

As the first value to be compared is a volume's path, the second value better be
a volume's path too, and not a snapshot's path.

See also 77019edfe0c190c949cdc0b0e3b4ad2ca37313b3 for historical context.

The error that led me here:
* had a VM with ZFS over iSCSI storage with an exsiting snapshot
* add new unused drive
* try to remove the unsued drive
* fails, because ZFS (not Pool!) Plugin does not support snapshot paths.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>