Commit Graph

2788 Commits

Author SHA1 Message Date
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
Fabian Ebner
692f604bb0 Revert "revert spice_ticket prefix change in 7827de4"
This reverts commit ff09c795ed. 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>
2021-06-08 14:56:10 +02:00
Thomas Lamprecht
e41fb93e17 buildsys: change upload dist to bullseye
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-06-08 09:47:35 +02:00
Fabian Grünbichler
9bf522bc1e 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>
2021-06-02 16:49:00 +02:00
Thomas Lamprecht
7908e50263 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>
2021-06-02 16:48:18 +02:00
Thomas Lamprecht
30aa458010 bump version to 7.0-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-28 13:08:50 +02:00
Thomas Lamprecht
daf829ecae 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>
2021-05-28 12:14:37 +02:00
Stefan Reiter
88cabb624d 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>
2021-05-28 12:12:50 +02:00
Fabian Ebner
3ab0f9252a 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>
2021-05-28 12:12:50 +02:00
Fabian Ebner
ba1a198481 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>
2021-05-28 12:12:50 +02:00
Stefan Reiter
2dc0eb61e8 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>
2021-05-28 11:31:15 +02:00
Stefan Reiter
378ad769dd 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>
2021-05-28 11:31:15 +02:00
Fabian Ebner
75a2a42395 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>
2021-05-26 17:40:28 +02:00
Lorenz Stechauner
1cb23b87b4 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>
2021-05-26 17:32:52 +02:00
Thomas Lamprecht
c09667bc9d bump version to 7.0-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-13 19:11:22 +02:00
Thomas Lamprecht
b818a0504c debian: update compat, copyright, ..
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-05-13 19:09:29 +02:00
Thomas Lamprecht
c948e143d8 bump version to 6.4-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-29 16:16:51 +02:00
Fabian Grünbichler
3dc33a728a 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>
2021-04-29 16:15:53 +02:00
Dominik Csapak
30664f14ff 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>
2021-04-29 16:15:33 +02:00
Thomas Lamprecht
8f43ac4893 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 a89bd10084.
2021-04-29 15:48:21 +02:00
Thomas Lamprecht
ba2a06fda2 bump version to 6.4-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-04-23 16:26:59 +02:00