]> git.proxmox.com Git - qemu-server.git/log
qemu-server.git
18 months agovzdump : skip special:cloudinit section
Alexandre Derumier [Wed, 22 Jun 2022 11:51:58 +0000 (13:51 +0200)]
vzdump : skip special:cloudinit section

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
18 months agoqemuconfig: load_current_config : delete cloudinit value
Alexandre Derumier [Wed, 22 Jun 2022 11:51:57 +0000 (13:51 +0200)]
qemuconfig: load_current_config : delete cloudinit value

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
18 months agoapi: create/update vm: clamp cpuunit value
Fiona Ebner [Fri, 7 Oct 2022 12:41:50 +0000 (14:41 +0200)]
api: create/update vm: clamp cpuunit value

While the clamping already happens before setting the actual systemd
CPU{Shares, Weight}, it can be done here too, to avoid writing new
out-of-range values into the config.

Can't use a validator enforcing this because existing out-of-range
values should not become errors upon parsing the config.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
18 months agochange cpu shares: drop superfluous parameter
Thomas Lamprecht [Tue, 8 Nov 2022 15:20:20 +0000 (16:20 +0100)]
change cpu shares: drop superfluous parameter

See the related commit in pve-common.

Originally-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
18 months agomove get_cpuunits helper to guest-common
Fiona Ebner [Fri, 7 Oct 2022 12:41:48 +0000 (14:41 +0200)]
move get_cpuunits helper to guest-common

while making it take the value directly instead of the config.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
18 months agobump version to 7.2-6
Thomas Lamprecht [Mon, 7 Nov 2022 15:26:42 +0000 (16:26 +0100)]
bump version to 7.2-6

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
18 months agod/control: bump versioned dependency of libpve-common-perl
Thomas Lamprecht [Mon, 7 Nov 2022 15:26:19 +0000 (16:26 +0100)]
d/control: bump versioned dependency of libpve-common-perl

for moved pve-targetstorage schema

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
18 months agoschema: move 'pve-targetstorage' to pve-common
Fabian Grünbichler [Wed, 28 Sep 2022 12:50:53 +0000 (14:50 +0200)]
schema: move 'pve-targetstorage' to pve-common

for proper re-use in pve-container.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Fiona Ebner <f.ebner@proxmox.com>
18 months agobump version to 7.2-5
Thomas Lamprecht [Mon, 7 Nov 2022 15:15:22 +0000 (16:15 +0100)]
bump version to 7.2-5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
18 months agoqm: also move 'unlink' into disk related command group
Thomas Lamprecht [Mon, 7 Nov 2022 13:51:43 +0000 (14:51 +0100)]
qm: also move 'unlink' into disk related command group

missed that this one is also a disk specific command...

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
18 months agoqm: move disk related commands to own group
Thomas Lamprecht [Mon, 7 Nov 2022 13:43:25 +0000 (14:43 +0100)]
qm: move disk related commands to own group

set aliases for the previous ones for backward compat.

There's still cleanup potential, e.g., for snapshots, but to do that
nicely we may need (or want) to extend CLIHandler to accept commands
without fixed params also on the command group itself.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
18 months agoqm: factor out setting node to local $nodename
Thomas Lamprecht [Mon, 7 Nov 2022 12:57:12 +0000 (13:57 +0100)]
qm: factor out setting node to local $nodename

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
18 months agofix #4099: disable io_uring for virtual disks on CIFS storages
Fiona Ebner [Thu, 27 Oct 2022 07:13:45 +0000 (09:13 +0200)]
fix #4099: disable io_uring for virtual disks on CIFS storages

Since kernel 5.15, there is an issue with io_uring when used in
combination with CIFS [0]. Unfortunately, the kernel developers did
not suggest any way to resolve the issue and didn't comment on my
proposed one. So for now, just disable io_uring when the storage is
CIFS, like is done for other storage types that had problematic
interactions.

It is rather easy to reproduce when writing large amounts of data
within the VM. I used
dd if=/dev/urandom of=file bs=1M count=1000
to reproduce it consistently, but your mileage may vary.

Some forum reports about users running into the issue [1][2][3].

[0]: https://www.spinics.net/lists/linux-cifs/msg26734.html
[1]: https://forum.proxmox.com/threads/109848/
[2]: https://forum.proxmox.com/threads/110464/
[3]: https://forum.proxmox.com/threads/111382/

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
19 months agovzdump: set max-workers QMP option when specified and supported
Fiona Ebner [Mon, 3 Oct 2022 13:52:06 +0000 (15:52 +0200)]
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>
19 months agod/control: bump versioned dependecy for libpve-common-perl
Thomas Lamprecht [Mon, 26 Sep 2022 09:44:27 +0000 (11:44 +0200)]
d/control: bump versioned dependecy for libpve-common-perl

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
19 months agoconfig2cmd: make missing EFI disk warning more visible
Fiona Ebner [Wed, 31 Aug 2022 12:46:09 +0000 (14:46 +0200)]
config2cmd: make missing EFI disk warning more visible

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
19 months agoqmeventd: send QMP 'quit' command instead of SIGTERM
Dominik Csapak [Fri, 23 Sep 2022 09:51:15 +0000 (11:51 +0200)]
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>
19 months agoqmeventd: rework 'forced_cleanup' handling and set timeout to 60s
Dominik Csapak [Fri, 23 Sep 2022 09:51:14 +0000 (11:51 +0200)]
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>
19 months agofix net regex in qm cleanup
Dominik Csapak [Tue, 20 Sep 2022 14:50:43 +0000 (16:50 +0200)]
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>
19 months agoRevert "cleanup pci devices in more situations"
Thomas Lamprecht [Tue, 20 Sep 2022 12:22:49 +0000 (14:22 +0200)]
Revert "cleanup pci devices in more situations"

irrelevant/wrong

This reverts commit 81042ce4451d796aaf878845a19054ccac30608a.

19 months agocleanup pci devices in more situations
Dominik Csapak [Wed, 27 Jul 2022 13:28:54 +0000 (15:28 +0200)]
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>
20 months agoqmp client: increase default fallback timeout to 5s
Thomas Lamprecht [Fri, 16 Sep 2022 10:56:29 +0000 (12:56 +0200)]
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>
20 months agovzdump: tpmstate: include HMP error in message
Fabian Grünbichler [Wed, 14 Sep 2022 13:07:28 +0000 (15:07 +0200)]
vzdump: tpmstate: include HMP error in message

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
20 months agovzdump: tpmstate: escape drive string
Fabian Grünbichler [Wed, 14 Sep 2022 13:07:27 +0000 (15:07 +0200)]
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>
20 months agoapi: create disks: avoid adding secondary cloud-init drives
Fabian Ebner [Fri, 6 May 2022 10:11:14 +0000 (12:11 +0200)]
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>
20 months agosnapshot: save VM state: propagate error from QEMU
Fiona Ebner [Mon, 29 Aug 2022 10:54:54 +0000 (12:54 +0200)]
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>
20 months agocpu config: fix depreacation mapping on CPU hotplug of custom types
Thomas Lamprecht [Tue, 30 Aug 2022 07:25:03 +0000 (09:25 +0200)]
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>
20 months agocpu config: map depreacated IceLake-Client CPU type to IceLake-Server
Thomas Lamprecht [Tue, 30 Aug 2022 07:04:41 +0000 (09:04 +0200)]
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>
20 months agocpu config: minor code style nits/comment
Thomas Lamprecht [Tue, 30 Aug 2022 07:01:40 +0000 (09:01 +0200)]
cpu config: minor code style nits/comment

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
20 months agoexpand error for suspend with pcie pass through a bit
Thomas Lamprecht [Tue, 30 Aug 2022 06:34:50 +0000 (08:34 +0200)]
expand error for suspend with pcie pass through a bit

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
20 months agoshorten and subjectively improve code comment
Thomas Lamprecht [Wed, 22 Jun 2022 13:08:31 +0000 (15:08 +0200)]
shorten and subjectively improve code comment

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
20 months agofix #3577: prevent suspension for VMs with pci passthrough
Dominik Csapak [Tue, 21 Jun 2022 14:07:04 +0000 (16:07 +0200)]
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>
20 months agoqmp client: increase guest fstrim timeout to 10 minutes
Fiona Ebner [Fri, 19 Aug 2022 07:01:24 +0000 (09:01 +0200)]
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>
21 months agobump version to 7.2-4
Fabian Grünbichler [Tue, 16 Aug 2022 12:01:32 +0000 (14:01 +0200)]
bump version to 7.2-4

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
21 months agovzdump/pbs: die with missing, but configured master key
Fabian Grünbichler [Tue, 16 Aug 2022 11:52:38 +0000 (13:52 +0200)]
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>
21 months agopbs: detect mismatch of encryption settings and key
Fabian Grünbichler [Tue, 16 Aug 2022 09:45:41 +0000 (11:45 +0200)]
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>
21 months agoautomatically add 'uuid' parameter when passing through NVIDIA vGPU
Dominik Csapak [Fri, 12 Aug 2022 09:29:49 +0000 (11:29 +0200)]
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>
22 months agoQemu-Server: fix wrong quotation
Matthias Heiserer [Thu, 30 Jun 2022 10:12:03 +0000 (12:12 +0200)]
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>
22 months agofix #4119: give namespace parameter to live-restore
Dominik Csapak [Wed, 22 Jun 2022 12:57:35 +0000 (14:57 +0200)]
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>
23 months agofix #4115: enable option to name QEMU threads after their main purpose
Thomas Lamprecht [Fri, 17 Jun 2022 12:25:49 +0000 (14:25 +0200)]
fix #4115: enable option to name QEMU threads after their main purpose

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
23 months agofix uninitialized value
Fabian Grünbichler [Mon, 30 May 2022 08:00:16 +0000 (10:00 +0200)]
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>
23 months agocpuconfig: add amd epyc milan model
Alexandre Derumier [Tue, 17 May 2022 15:15:26 +0000 (17:15 +0200)]
cpuconfig: add amd epyc milan model

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2 years agoqmp client: fix indendation of timeout checks
Thomas Lamprecht [Sat, 14 May 2022 07:24:21 +0000 (09:24 +0200)]
qmp client: fix indendation of timeout checks

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoRevert "bump version to 7.2-4"
Thomas Lamprecht [Fri, 13 May 2022 12:55:17 +0000 (14:55 +0200)]
Revert "bump version to 7.2-4"

bogus

This reverts commit 3613ae505d930fc33efab735328dd27e8746d06f.

2 years agoRevert "pbs: backup-ns parameter was renamed to ns"
Thomas Lamprecht [Fri, 13 May 2022 12:54:41 +0000 (14:54 +0200)]
Revert "pbs: backup-ns parameter was renamed to ns"

This reverts commit 479c274dd344016c0b7b8333b2283c371f654180.

2 years agobump version to 7.2-4
Thomas Lamprecht [Fri, 13 May 2022 12:51:36 +0000 (14:51 +0200)]
bump version to 7.2-4

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agopbs: backup-ns parameter was renamed to ns
Thomas Lamprecht [Fri, 13 May 2022 12:51:01 +0000 (14:51 +0200)]
pbs: backup-ns parameter was renamed to ns

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofix #3754: encode JSON as utf8 for CLI
Stefan Hrdlicka [Wed, 11 May 2022 12:42:37 +0000 (14:42 +0200)]
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>
2 years agobump version to 7.2-3
Thomas Lamprecht [Thu, 12 May 2022 13:14:44 +0000 (15:14 +0200)]
bump version to 7.2-3

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agod/control: add versioned recommends on proxmox-backup-file-restore
Thomas Lamprecht [Thu, 12 May 2022 13:12:25 +0000 (15:12 +0200)]
d/control: add versioned recommends on proxmox-backup-file-restore

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agosupport pbs namespaces
Wolfgang Bumiller [Thu, 12 May 2022 08:42:32 +0000 (10:42 +0200)]
support pbs namespaces

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2 years agobump version to 7.2-2
Thomas Lamprecht [Mon, 2 May 2022 15:26:36 +0000 (17:26 +0200)]
bump version to 7.2-2

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agovirgl: library check: refactor/code style nits
Thomas Lamprecht [Mon, 2 May 2022 15:20:39 +0000 (17:20 +0200)]
virgl: library check: refactor/code style nits

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agocheck prerequisites for virtio-gl display
Stoiko Ivanov [Fri, 29 Apr 2022 16:50:07 +0000 (18:50 +0200)]
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>
2 years agoapi: reassign disk: drop moved disk from boot order
Thomas Lamprecht [Mon, 2 May 2022 11:28:03 +0000 (13:28 +0200)]
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>
2 years agobump version to 7.2-1
Thomas Lamprecht [Thu, 28 Apr 2022 16:35:35 +0000 (18:35 +0200)]
bump version to 7.2-1

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agofix #3861: migrate: fix live migration when cloud-init changes storage
Fabian Ebner [Thu, 28 Apr 2022 11:37:37 +0000 (13:37 +0200)]
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>
2 years agotests: preset RBD fsid to avoid unavailable rados command
Thomas Lamprecht [Thu, 28 Apr 2022 16:20:52 +0000 (18:20 +0200)]
tests: preset RBD fsid to avoid unavailable rados command

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoenable spice also for virtio-gpu display
Thomas Lamprecht [Thu, 28 Apr 2022 15:46:57 +0000 (17:46 +0200)]
enable spice also for virtio-gpu display

same spirit as commit 3591b62b859d940c143085510aa9b0005f42c479

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: create: allow overriding non-disk options during restore
Fabian Ebner [Tue, 26 Apr 2022 12:30:51 +0000 (14:30 +0200)]
api: create: allow overriding non-disk options during restore

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoapi: create: refactor parameter check logic
Fabian Ebner [Tue, 26 Apr 2022 12:30:50 +0000 (14:30 +0200)]
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>
2 years agoapi: status: report spice also for virtio-gl display
Thomas Lamprecht [Thu, 28 Apr 2022 06:15:57 +0000 (08:15 +0200)]
api: status: report spice also for virtio-gl display

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoenable spice also for virtio-gl display
Thomas Lamprecht [Thu, 28 Apr 2022 06:07:08 +0000 (08:07 +0200)]
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>
2 years agoadd test for virtio-balloon free-page-reporting=on. (qemu 6.2)
Alexandre Derumier [Sun, 6 Mar 2022 12:46:47 +0000 (13:46 +0100)]
add test for virtio-balloon free-page-reporting=on. (qemu 6.2)

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2 years agomemory: enable balloon free-page-reporting for auto-memory reclaim
Alexandre Derumier [Sun, 6 Mar 2022 12:46:46 +0000 (13:46 +0100)]
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>
2 years agofix QemuServer module
Thomas Lamprecht [Wed, 27 Apr 2022 09:00:00 +0000 (11:00 +0200)]
fix QemuServer module

fixes d1e7b922894 ("parse vm config: remove "\s*" from multi-line
comment regex")

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoparse vm config: remove "\s*" from multi-line comment regex
Stefan Sterz [Thu, 24 Feb 2022 14:21:51 +0000 (15:21 +0100)]
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>
2 years agomigrate: resume initially running VM when failing after convergence
Fabian Ebner [Mon, 25 Apr 2022 12:31:12 +0000 (14:31 +0200)]
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>
2 years agomigrate: add log for guest fstrim
Fabian Ebner [Mon, 25 Apr 2022 12:31:11 +0000 (14:31 +0200)]
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>
2 years agobump version to 7.1-5
Thomas Lamprecht [Mon, 25 Apr 2022 18:16:02 +0000 (20:16 +0200)]
bump version to 7.1-5

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agorestore: also deactivate/destroy cloud-init disk upon error
Fabian Ebner [Thu, 21 Apr 2022 11:26:52 +0000 (13:26 +0200)]
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>
2 years agorestore deactivate volumes: never die
Fabian Ebner [Thu, 21 Apr 2022 11:26:51 +0000 (13:26 +0200)]
restore deactivate volumes: never die

Such an error shouldn't abort the whole operation.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agorestore destroy volumes: remove check for absolute path
Fabian Ebner [Thu, 21 Apr 2022 11:26:50 +0000 (13:26 +0200)]
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>
2 years agorestore: cleanup oldconf: also clean up snapshots from kept volumes
Fabian Ebner [Thu, 21 Apr 2022 11:26:49 +0000 (13:26 +0200)]
restore: cleanup oldconf: also clean up snapshots from kept volumes

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoQemuServer: Fix 'keyboard' parameter description
Dylan Whyte [Mon, 25 Apr 2022 15:21:38 +0000 (17:21 +0200)]
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>
2 years agoapi: create/modify: fix content type checks by re-allowing iso images
Fabian Ebner [Fri, 22 Apr 2022 11:03:06 +0000 (13:03 +0200)]
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>
2 years agovga: add virtio-gl display type for VIRGL
Thomas Lamprecht [Fri, 22 Apr 2022 12:28:09 +0000 (14:28 +0200)]
vga: add virtio-gl display type for VIRGL

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agomigrate: keep VM paused after migration if it was before
Fabian Ebner [Fri, 18 Mar 2022 07:51:23 +0000 (08:51 +0100)]
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>
2 years agocode cleanup: remove commented-out debug print
Fabian Ebner [Mon, 11 Apr 2022 07:34:08 +0000 (09:34 +0200)]
code cleanup: remove commented-out debug print

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoclone disk: add version guard for qemu-img dd's -l option
Fabian Ebner [Tue, 5 Apr 2022 08:22:14 +0000 (10:22 +0200)]
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>
2 years agoapi: update vm: print drive string for newly allocated/imported drives
Fabian Ebner [Thu, 17 Mar 2022 11:31:06 +0000 (12:31 +0100)]
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>
2 years agoapi: support VM disk import
Dominic Jäger [Thu, 17 Mar 2022 11:31:05 +0000 (12:31 +0100)]
api: support VM disk import

Extend qm importdisk functionality to the API.

Co-authored-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Co-authored-by: Dominic Jäger <d.jaeger@proxmox.com>
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoschema: drive: use separate schema when disk allocation is possible
Fabian Ebner [Thu, 17 Mar 2022 11:31:04 +0000 (12:31 +0100)]
schema: drive: use separate schema when disk allocation is possible

via the special syntax <storeid>:<size>.

Not worth it by itself, but this is anticipating a new 'import-from'
parameter which is only used upon import/allocation, but shouldn't be
part of the schema for the config or other API enpoints.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoapi: add endpoint for parsing .ovf files
Fabian Ebner [Thu, 17 Mar 2022 11:31:03 +0000 (12:31 +0100)]
api: add endpoint for parsing .ovf files

Co-developed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
[split into its own patch + minor improvements/style fixes]
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
[renamed API handler, since it's not an index]
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoclone disk: also clone EFI disk from snapshot
Fabian Ebner [Thu, 17 Mar 2022 11:31:02 +0000 (12:31 +0100)]
clone disk: also clone EFI disk from snapshot

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoapi: clone vm: check against cloning running TPM state early
Fabian Ebner [Thu, 17 Mar 2022 11:31:01 +0000 (12:31 +0100)]
api: clone vm: check against cloning running TPM state early

Drive keys are sorted when cloning and 'tpmstate0' comes late, so it
was likely that potentially large disks were already copied just to be
removed again, because of the TPM state restriction at the end.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoclone disk: move check against cloning TPM state of running VM to beginning
Fabian Ebner [Thu, 17 Mar 2022 11:31:00 +0000 (12:31 +0100)]
clone disk: move check against cloning TPM state of running VM to beginning

where other similar checks are.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoclone disk: assert that drive name is the same for drive-mirror on single VM
Fabian Ebner [Thu, 17 Mar 2022 11:30:59 +0000 (12:30 +0100)]
clone disk: assert that drive name is the same for drive-mirror on single VM

because when the VM ID of target and source are the same,
qemu_drive_mirror_monitor() switches the QEMU device node over to the
new backing image. The planned import-from functionality makes it
possible to run into this, although for an a bit unusual use case.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoapi: create/modify: add content type checks
Fabian Ebner [Wed, 30 Mar 2022 10:24:37 +0000 (12:24 +0200)]
api: create/modify: add content type checks

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agofix #3957: spell 'occurred' correctly
Fabian Grünbichler [Fri, 25 Mar 2022 08:06:58 +0000 (09:06 +0100)]
fix #3957: spell 'occurred' correctly

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agoPCI: allow longer pci domains
Dominik Csapak [Mon, 28 Feb 2022 13:48:20 +0000 (14:48 +0100)]
PCI: allow longer pci domains

some systems[0] have pci domains longer than the default ('0000') of 4
characters, so change the regex to allow at least 4.

0: https://forum.proxmox.com/threads/problem-with-gpu-passthrough-in-a-virtual-machine.105720/

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2 years agocpu config: code format/whitespace fixes
Thomas Lamprecht [Wed, 16 Mar 2022 14:53:00 +0000 (15:53 +0100)]
cpu config: code format/whitespace fixes

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2 years agoapi: snapshot delete: prefix lock-fail error
Fabian Grünbichler [Tue, 15 Mar 2022 12:28:27 +0000 (13:28 +0100)]
api: snapshot delete: prefix lock-fail error

otherwise users might get confused if they just get a message about a
migrate lock not being available..

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2 years agofix #3424: api: snapshot delete: wait for active replication
Fabian Ebner [Wed, 23 Feb 2022 12:03:59 +0000 (13:03 +0100)]
fix #3424: api: snapshot delete: wait for active replication

A to-be-deleted snapshot might be actively used by replication,
resulting in a not (or only partially) removed snapshot and locked
(snapshot-delete) VM. Simply wait a few seconds for any ongoing
replication.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoapi: factor out check/cleanup for drive params
Fabian Ebner [Wed, 9 Mar 2022 10:09:15 +0000 (11:09 +0100)]
api: factor out check/cleanup for drive params

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoimage convert: allow block device as source
Fabian Ebner [Wed, 9 Mar 2022 10:09:14 +0000 (11:09 +0100)]
image convert: allow block device as source

Necessary to import from an existing storage using block-device
volumes like ZFS.

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
[split into its own patch]
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoparse ovf: untaint path when calling file_size_info
Fabian Ebner [Wed, 9 Mar 2022 10:09:12 +0000 (11:09 +0100)]
parse ovf: untaint path when calling file_size_info

Prepare for calling parse_ovf via API, where the -T switch is used.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoschema: add pve-volume-id-or-absolute-path
Fabian Ebner [Wed, 9 Mar 2022 10:09:11 +0000 (11:09 +0100)]
schema: add pve-volume-id-or-absolute-path

Signed-off-by: Dominic Jäger <d.jaeger@proxmox.com>
[split into its own patch + style fixes]
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoefivars size: allow overriding efidisk parameter
Fabian Ebner [Wed, 9 Mar 2022 10:09:10 +0000 (11:09 +0100)]
efivars size: allow overriding efidisk parameter

For disk import, it should be based on the disk properties that are
passed in rather than on those of a possibly pre-existing disk in the
config.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2 years agoclone disk: allow cloning from an unused or unreferenced disk
Fabian Ebner [Wed, 9 Mar 2022 10:09:09 +0000 (11:09 +0100)]
clone disk: allow cloning from an unused or unreferenced disk

and also when source and target drivename are different. In those
cases, it is done via qemu-img convert/dd.

In preparation to allow import from existing PVE-managed disks.

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