Commit Graph

2945 Commits

Author SHA1 Message Date
Fiona Ebner
4de4eefcb6 vzdump: set max-workers QMP option when specified and supported
If not supported, a warning is printed and the setting is ignored.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-10-10 13:04:33 +02:00
Thomas Lamprecht
69200d4534 d/control: bump versioned dependecy for libpve-common-perl
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-09-26 11:44:27 +02:00
Fiona Ebner
34e82fa28b config2cmd: make missing EFI disk warning more visible
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-09-26 11:32:23 +02:00
Dominik Csapak
b5c39b22f0 qmeventd: send QMP 'quit' command instead of SIGTERM
this is functionally the same, but sending SIGTERM has the ugly side
effect of printing the following to the log:

> QEMU[<pid>]: kvm: terminating on signal 15 from pid <pid> (/usr/sbin/qmeventd)

while sending a QMP quit command does not.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-09-23 12:00:22 +02:00
Dominik Csapak
0a1641aee5 qmeventd: rework 'forced_cleanup' handling and set timeout to 60s
currently, the 'forced_cleanup' (sending SIGKILL to the qemu process),
is intended to be triggered 5 seconds after sending the initial shutdown
signal (SIGTERM) which is sadly not enough for some setups.

Accidentally, it could be triggered earlier than 5 seconds, if a
SIGALRM triggers in the timespan directly before setting it again.

Also, this approach means that depending on when machines are shutdown
their forced cleanup may happen after 5 seconds, or any time after, if
new vms are shut off in the meantime.

Improve this situation by reworking the way we deal with this cleanup.
We save the pidfd, time incl. timeout in the Client, and set a timeout
to 'epoll_wait' of 10 seconds, which will then trigger a forced_cleanup.
Remove entries from the forced_cleanup list when that entry is killed,
or when the normal cleanup took place.

To improve the shutdown behaviour, increase the default timeout to 60
seconds, which should be enough, but add a commandline toggle where
users can set it to a different value.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-09-23 12:00:20 +02:00
Dominik Csapak
702c2f6ebe fix net regex in qm cleanup
the '+' needs to be in the brackets, otherwise '$1' is not the right id

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-09-21 09:12:47 +02:00
Thomas Lamprecht
b4415a5253 Revert "cleanup pci devices in more situations"
irrelevant/wrong

This reverts commit 81042ce445.
2022-09-20 14:22:49 +02:00
Dominik Csapak
81042ce445 cleanup pci devices in more situations
if the preparing of pci devices or the start of the vm fails, we need
to cleanup the pci devices (reservations *and* mdevs), or else
it might happen that there are leftovers which must be manually removed.

to include also mdevs now, refactor the cleanup code from 'vm_stop_cleanup'
into it's own function, and call that instead of only 'remove_pci_reservation'

also print the errors of the cleanup steps with 'warn', otherwise we
might discard important errors

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-09-20 13:52:43 +02:00
Thomas Lamprecht
8174a894f1 qmp client: increase default fallback timeout to 5s
allowing slower or overloaded systems a higher chance to finish
commands while not being to long to be problematic for sync api calls
with their 30s total budget

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-09-16 13:01:45 +02:00
Fabian Grünbichler
df28f8cc0b vzdump: tpmstate: include HMP error in message
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-09-16 12:52:30 +02:00
Fabian Grünbichler
93e3f756c4 vzdump: tpmstate: escape drive string
the volume path could contain escaped ":" or ",", which means their '\'
needs to be escaped another time for passing to HMP.

the same approach is used for hotplugging regular drives in
PVE::QemuServer, and is needed (at least) for RBD storages with IPv6
monhosts or an explicit monhost port.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-09-16 12:52:30 +02:00
Fabian Ebner
39b56b169a api: create disks: avoid adding secondary cloud-init drives
This will break possibly existing workflows like
1. add second cloud-init
2. remove first cloud-init
to change the cloud-init storage.

On the other hand, it avoids unintended misconfiguration of having
mutliple cloud-init drives with potentially different settings.

Also in preparation for adding cloud-init-related API calls, where
not being able to assume that there's only one cloud-init drive/state
would complicate things quite a bit.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-09-12 18:04:59 +02:00
Fiona Ebner
d064764a70 snapshot: save VM state: propagate error from QEMU
So that there is a better chance to debug issues like in [0]. For
suspending, which uses the same QMP calls, this is already done.

[0]: https://forum.proxmox.com/threads/114203/

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-08-30 12:45:40 +02:00
Thomas Lamprecht
adc67fe917 cpu config: fix depreacation mapping on CPU hotplug of custom types
we need to do the independent of is_custom_model to ensure the
reported model is understood by QEMU

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Reported-by: Fiona Ebner <f.ebner@proxmox.com>
2022-08-30 09:25:06 +02:00
Thomas Lamprecht
0d6962f935 cpu config: map depreacated IceLake-Client CPU type to IceLake-Server
the former CPU type never existed on the market and will be dropped
by QEMU 7.1, so map it to the server variant as they're pretty much
identical anyway FIWCT.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-08-30 09:09:13 +02:00
Thomas Lamprecht
b0ab346381 cpu config: minor code style nits/comment
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-08-30 09:09:13 +02:00
Thomas Lamprecht
161c2dde4b expand error for suspend with pcie pass through a bit
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-08-30 08:34:50 +02:00
Thomas Lamprecht
876b24f228 shorten and subjectively improve code comment
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-08-30 08:32:43 +02:00
Dominik Csapak
227a298f7f fix #3577: prevent suspension for VMs with pci passthrough
Prevent the user from suspending the vm at all, as while suspension
itself may finish, the saved state is incomplete as we can neither
save nor restore PCIe device state in any generic fashion, so
resuming will almost certainly break.

The single case when it could work is when the guest OS didn't uses
the passed through device at all, so there's no state, but that's
really odd (as why bother passing through then), and the user should
rather remove the hostpci entry in that case.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
 [ T: reword commit message slightly ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-08-30 08:32:43 +02:00
Fiona Ebner
50164179db qmp client: increase guest fstrim timeout to 10 minutes
like for other drive-related operations. The default of 3 seconds is
just not enough for large (or slow) disks.

Reported in the community forum:
https://forum.proxmox.com/threads/49543/

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-08-19 09:40:04 +02:00
Fabian Grünbichler
2bdd35e75d bump version to 7.2-4
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-08-16 14:32:09 +02:00
Fabian Grünbichler
1629b483e2 vzdump/pbs: die with missing, but configured master key
the created backups are encrypted, but are not restorable with the
master key in case the original PVE system is lost.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-08-16 14:32:09 +02:00
Fabian Grünbichler
24e632818b pbs: detect mismatch of encryption settings and key
if the key file doesn't exist (anymore), but the storage.cfg references
one, die when starting a backup that should use encryption instead of
falling back to plain-text operations.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-08-16 13:52:50 +02:00
Dominik Csapak
bbf96e0f1e automatically add 'uuid' parameter when passing through NVIDIA vGPU
When passing through an NVIDIA vGPU via mediated devices, their
software needs the qemu process to have the 'uuid' parameter set to the
one of the vGPU. Since it's currently not possible to pass through multiple
vGPUs to one VM (seems to be an NVIDIA driver limitation at the moment),
we don't have to take care about that.

Sadly, the place we do this, it does not show up in 'qm showcmd' as we
don't (want to) query the pci devices in that case, and then we don't
have a way of knowing if it's an NVIDIA card or not. But since this
is informational with QEMU anyway, i'd say we can ignore that.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2022-08-12 13:42:33 +02:00
Matthias Heiserer
bd49ecb435 Qemu-Server: fix wrong quotation
Before, the two strings were one single string each, rather than multiple
separated by newlines.

In the docs, this looked very strange as there were linebreaks and the
dots were shown. Can be seen e.g. in api-viewer /nodes/{node}/qemu/{vmid}/config.

Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-30 12:32:25 +02:00
Dominik Csapak
2dda626d1e fix #4119: give namespace parameter to live-restore
we forgot to give the namespace parameter here, so do that.
while we're at it, give the pbs options as a hash instead of adding
another parameter.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-06-29 13:07:12 +02:00
Thomas Lamprecht
6884a7d7fa fix #4115: enable option to name QEMU threads after their main purpose
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-06-17 14:25:49 +02:00
Fabian Grünbichler
e88ceecac1 fix uninitialized value
if the configured display hardware has the (optional) default type, but
some other attribute is set, this would match against `undef` and spew
lots of warnings in the logs.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-05-30 12:12:08 +02:00
Alexandre Derumier
9b1971c5c9 cpuconfig: add amd epyc milan model
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2022-05-20 09:45:18 +02:00
Thomas Lamprecht
46336bd283 qmp client: fix indendation of timeout checks
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-14 09:24:21 +02:00
Thomas Lamprecht
4bb19a2559 Revert "bump version to 7.2-4"
bogus

This reverts commit 3613ae505d.
2022-05-13 14:55:24 +02:00
Thomas Lamprecht
0c9a94d2aa Revert "pbs: backup-ns parameter was renamed to ns"
This reverts commit 479c274dd3.
2022-05-13 14:54:41 +02:00
Thomas Lamprecht
3613ae505d bump version to 7.2-4
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-13 14:51:36 +02:00
Thomas Lamprecht
479c274dd3 pbs: backup-ns parameter was renamed to ns
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-13 14:51:01 +02:00
Stefan Hrdlicka
3b6479ff28 fix #3754: encode JSON as utf8 for CLI
since this output is printed to the command line it should
be encoded to avoid the wide character warnings

Signed-off-by: Stefan Hrdlicka <s.hrdlicka@proxmox.com>
2022-05-12 17:20:47 +02:00
Thomas Lamprecht
23ead37984 bump version to 7.2-3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-12 15:14:44 +02:00
Thomas Lamprecht
d41511259f d/control: add versioned recommends on proxmox-backup-file-restore
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-12 15:12:25 +02:00
Wolfgang Bumiller
21a9ec2ad3 support pbs namespaces
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2022-05-12 13:45:37 +02:00
Thomas Lamprecht
80cf523b0f bump version to 7.2-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-02 17:26:36 +02:00
Thomas Lamprecht
8884a8bfb9 virgl: library check: refactor/code style nits
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-02 17:20:39 +02:00
Stoiko Ivanov
9f979d9f31 check prerequisites for virtio-gl display
and exit early if they are not met.
The necessary libraries were taken from Thomas' post in our community
forum:
https://forum.proxmox.com/threads/.61801/post-466767 (ff)

The /dev/dri/renderD.* check is based on util/drm.c in the current
qemu source code.

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
2022-05-02 17:15:42 +02:00
Thomas Lamprecht
96670745a6 api: reassign disk: drop moved disk from boot order
Reported-by: Matthias Heiserer <m.heiserer@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-05-02 13:28:08 +02:00
Thomas Lamprecht
0182efa7a0 bump version to 7.2-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-28 18:35:35 +02:00
Fabian Ebner
13d121d79b fix #3861: migrate: fix live migration when cloud-init changes storage
Generalizes fd95d780 ("migrate: send updated TPM state volid to target
node") to also handle other offline migrated disks appearing in the
VM config, which currently should only be cloud-init.

Breaks migration new -> old under similar (edge-case-)conditions as
fd95d780 did.

Keep sending the 'tpmstate0' STDIN parameter to avoid breaking new ->
old in the scenario fd95d780 fixed.

Keep parsing the vm_start 'tpmstate0' STDIN parameter to avoid
breaking old -> new, and to be able to keep sending it.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-04-28 18:29:12 +02:00
Thomas Lamprecht
188eb9c374 tests: preset RBD fsid to avoid unavailable rados command
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-28 18:20:52 +02:00
Thomas Lamprecht
f8ea1b30ce enable spice also for virtio-gpu display
same spirit as commit 3591b62b85

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-28 17:47:07 +02:00
Fabian Ebner
202a2a0bee api: create: allow overriding non-disk options during restore
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-04-28 08:43:09 +02:00
Fabian Ebner
325b32cc40 api: create: refactor parameter check logic
In preparation to allow passing along certain parameters together with
'archive'. Moving the parameter checks to after the
conflicts-with-'archive' to ensure that the more telling error will
trigger first.

All check helpers should handle empty params fine, but check first
just to make sure and to avoid all the superfluous function calls.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-04-28 08:43:09 +02:00
Thomas Lamprecht
3591b62b85 api: status: report spice also for virtio-gl display
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-28 08:16:02 +02:00
Thomas Lamprecht
463bb05f93 enable spice also for virtio-gl display
It can be used with that and the agent features can make it a nicer
experience.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-28 08:07:14 +02:00