5
0
mirror of git://git.proxmox.com/git/qemu-server.git synced 2025-02-01 05:47:18 +03:00

2393 Commits

Author SHA1 Message Date
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
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
0c9a94d2aa Revert "pbs: backup-ns parameter was renamed to ns"
This reverts commit 479c274dd344016c0b7b8333b2283c371f654180.
2022-05-13 14:54:41 +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
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
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
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
f8ea1b30ce enable spice also for virtio-gpu display
same spirit as commit 3591b62b859d940c143085510aa9b0005f42c479

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
Alexandre Derumier
c70e4ec397 memory: enable balloon free-page-reporting for auto-memory reclaim
Allow balloon device  driver to report hints of guest free pages to
the host, for auto memory reclaim

https://lwn.net/Articles/759413/
https://events19.linuxfoundation.org/wp-content/uploads/2017/12/KVMForum2018.pdf

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
[ T: fixup tests ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-27 11:08:50 +02:00
Thomas Lamprecht
baa4f62de0 fix QemuServer module
fixes d1e7b922894 ("parse vm config: remove "\s*" from multi-line
comment regex")

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-27 11:08:50 +02:00
Stefan Sterz
d1e7b92289 parse vm config: remove "\s*" from multi-line comment regex
To be consistent with PBS's implementation of multi-line comments
remove "\s*" here too. Since the regex isn't lazy .* matches
everything \s* would anyway. (Note that new lines occurs after "$").

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
2022-04-27 08:17:21 +02:00
Fabian Ebner
8a0d269b75 migrate: resume initially running VM when failing after convergence
When phase2() is aborted after the migration already converged, then
after migrate_cancel, the VM might be in POSTMIGRATE state.

(There also is a conditional for SHUTDOWN state in QEMU's
migration_iteration_finish(), so it's likely possible to end up there
if the VM is shut down at the right time during migration, but no need
to resume then).

Detect the POSTMIGRATE state and resume the VM if it wasn't paused at
the beginning of the migration. There is no direct way to go to
PAUSED, so just print an error if the VM was paused at the beginning
of the migration.

Reported-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-04-26 11:42:25 +02:00
Fabian Ebner
0028391f95 migrate: add log for guest fstrim
and make a failure noticable.

Suggested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-04-26 11:42:25 +02:00
Fabian Ebner
e8b07b29ee restore: also deactivate/destroy cloud-init disk upon error
by re-using the same hash that's used when allocating/activating the
disks in the helpers doing the opposite.

Also in preparation to allow skipping certain disks upon restore.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-04-25 18:19:17 +02:00
Fabian Ebner
ff86112c14 restore deactivate volumes: never die
Such an error shouldn't abort the whole operation.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-04-25 18:19:17 +02:00
Fabian Ebner
e60afe8273 restore destroy volumes: remove check for absolute path
Only a result from vdisk_alloc is assigned as a volid and that's never
an absolute path.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-04-25 18:19:17 +02:00
Fabian Ebner
01a4377fc1 restore: cleanup oldconf: also clean up snapshots from kept volumes
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-04-25 18:19:17 +02:00
Dylan Whyte
233fb3366b QemuServer: Fix 'keyboard' parameter description
The option has not defaulted to using the cluster-wide datacenter.cfg
since 2018.

Signed-off-by: Dylan Whyte <d.whyte@proxmox.com>
2022-04-25 18:11:21 +02:00
Fabian Ebner
db81c00754 api: create/modify: fix content type checks by re-allowing iso images
Fixes: f9be9137 ("api: create/modify: add content type checks"
Reported-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-04-22 14:28:49 +02:00
Thomas Lamprecht
6f070e39de vga: add virtio-gl display type for VIRGL
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-04-22 14:28:09 +02:00
Fabian Ebner
a183576e30 migrate: keep VM paused after migration if it was before
Also cannot issue a guest agent command in that case.

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

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-04-21 08:57:11 +02:00
Fabian Ebner
d18b5d90ee code cleanup: remove commented-out debug print
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-04-11 09:34:33 +02:00
Fabian Ebner
a9c45bd4a4 clone disk: add version guard for qemu-img dd's -l option
It's only available since QEMU 6.2 and doing a check here rather than
bumping the package dependency allows for easy downgrades.

Suggested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-04-06 17:41:49 +02:00
Fabian Ebner
3e7d9fac7c api: update vm: print drive string for newly allocated/imported drives
In the spirit of c75bf16 ("qm importdisk: tell user to what VM disk we
actually imported"), and so that the information is not lost once qm
importdisk switches to re-using the API call.

Added for cloudinit too, because a new disk is allocated.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2022-04-04 16:41:13 +02:00