Commit Graph

3041 Commits

Author SHA1 Message Date
Dominik Csapak
c8bd54e9a8 fix #4553: nvidia vgpu: reuse smbios uuid for '-uuid' parameter
instead of using the mdev uuid. The nvidia driver does not actually care
that it's the same as the mdev, and in qemu the uuid parameter
overwrites the smbios1 uuid internally, so we should have been reusing
that in the first place.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2023-03-16 09:08:27 +01:00
Fiona Ebner
79f5ca393a clone: remove outdated TODO about bandwidth limit
Respecting bandwidth limit for offline clone was implemented by commit
56d16f16 ("fix #4249: make image clone or conversion respect bandwidth
limit"). It's still not respected for EFI disks, but those are small,
so just ignore it.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-02-24 08:56:28 +01:00
Thomas Lamprecht
21f4e709f7 bump version to 7.3-4
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-02-23 17:16:12 +01:00
Leo Nunner
56d16f169c fix #4249: make image clone or conversion respect bandwidth limit
Previously, cloning a stopped VM didn't respect bwlimit. Passing the -r
(ratelimit) parameter to qemu-img convert fixes this issue.

Signed-off-by: Leo Nunner <l.nunner@proxmox.com>
 [ T: reword subject line slightly ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-02-23 17:09:51 +01:00
Alexandre Derumier
62fdcfd4cf update network dev: MTU is not hot-pluggable
Avoid pretending that a MTU change on a existing network device gets
applied live to a running VM.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
 [ T: reworded and expanded commit message slightly ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-02-23 16:37:34 +01:00
Christoph Heiss
93e21fd230 vzdump: Add VM QGA option to skip fs-freeze/-thaw on backup
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
2023-02-23 16:34:10 +01:00
Matthias Heiserer
1183c8f1a0 ovmf efi disk: ignore efitype parameter for ARM VMs
Required because there's one single efi for ARM, and the 2m/4m
difference doesn't seem to apply.

Signed-off-by: Matthias Heiserer <m.heiserer@proxmox.com>
 [ T: move description to format and reword subject ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-02-23 16:29:57 +01:00
Fiona Ebner
72a5a17610 swtpm: use start time as prefix for logging
to be able to distinguish different invocations.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-02-23 12:53:25 +01:00
Fiona Ebner
b2e9c4d322 swtpm: enable logging
AFAICT, previously, errors from swtpm would not show up in any logs,
because they were just printed to the stderr of the daemonized
invocation here.

The 'truncate' option is not used, so that the log is not immediately
lost when a new instance is started. This increases the chance that
the relevant errors are still present when requesting the log from a
user.

Log level 1 contains the most relevant errors and seems to be quiet
for working-as-expected invocations. Log level 2 already includes
logging full TPM commands, some of which are 1024 bytes long. Thus,
log level 1 was chosen.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-02-23 12:53:25 +01:00
Fiona Ebner
cb64a64339 start: make not being able to set polling interval for ballooning non-critical
The guest will be running, so it's misleading to fail the start task
here. Also ensures that we clean up the hibernation state upon resume
even if there is an error here, which did not happen previously[0].

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

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-02-23 11:42:40 +01:00
Alexandre Derumier
dafb728cb8 memory: remove calls to parse_hotplug_features
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
[FE: style: avoid overly long lines]
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-02-15 14:34:25 +01:00
Alexandre Derumier
d82ae201ac memory: refactor sockets
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2023-02-15 14:34:25 +01:00
Alexandre Derumier
6eabfbd15f tests: add memory tests
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2023-02-15 14:34:25 +01:00
Alexandre Derumier
2166f6a905 memory: extract some code to their own sub for mocking
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
[FE: style: avoid overly long lines]
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-02-15 14:34:05 +01:00
Fiona Ebner
8fbae1dc8f fix #4525: clone disk: disallow mirror if it might cause problems with io_uring
The target of the drive-mirror operation is opened with (essentially)
the same flags as the source in QEMU, in particular whether io_uring
should be used is inherited.

But io_uring currently causes problems in combination with certain
storage types, sometimes even leading to crashes (LVM with Linux 6.1).
Just disallow live cloning of drives when the source uses io_uring and
the target storage is not ready for it. There is one exception, namely
when source and target storage are the same. In that case, just assume
it will keep working for the target.

Migration does not seem to be affected, because there, the target VM
opens the images with the checked aio setting and then NBD exports of
those are used as the targets for mirroring.

It can be that the default determined for the source is not what's
actually used, because after a drive-mirror to a storage with a
different default, it will still use the default from the old storage.
Unfortunately, aio doesn't seem to be part of the 'query-block' QMP
command's result, so just tolerate this edge case.

The check can be removed if either
1. drive-mirror learns to open the target with a different aio setting
or more ideally
2. there are no more bad storages for io_uring.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-02-14 10:09:04 +01:00
Fiona Ebner
b7071d6c00 drive commandline: factor out determining direct cache usage into helper
In preparation to re-use it for a check for live disk cloning.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-02-14 10:09:04 +01:00
Fiona Ebner
eec9f9fe00 drive commandline: factor out checks if io_uring is allowed by default
while getting rid of the double negation.

In preparation to re-use the check for live disk cloning.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-02-14 10:09:04 +01:00
Fiona Ebner
ea7c3b39b2 hotplug: disk: mark aio as non-hotpluggable
Previously, changing aio would be applied to the configuration, but
the drive would still be using the old setting.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-02-14 10:09:04 +01:00
Alexandre Derumier
39c074fe23 qemu_memory_hotplug: remove unused $opt arg
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2023-02-03 11:23:47 +01:00
Thomas Lamprecht
ea0bc51427 schema: OS type: note that the l26 type is also compatible with Linux 6.x
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-30 11:02:53 +01:00
Fiona Ebner
5cbf4d727d close #2792: allow online migration with replicated snapshots
Since commit 9b6efe43 ("migrate: add live-migration of replicated
disks") live-migration with replicated volumes is possible. When
handling the replication, it is checked that all local volumes
previously detected as replicatable are actually replicated. So the
check if migration with snapshots is possible can just allow volumes
that are detected as replicatable.

Note that VM state files are also replicated.

If there is an invalid configuration with a non-replicatable volume or
state file and replication is enabled, then replication will fail, and
thus migration will fail early.

Trying to live-migrate to a non-replication target (needs --force)
will still fail if there are snapshots, because they are (correctly)
detected as non-replicated.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-01-27 09:53:28 +01:00
Fiona Ebner
252e2624dc schema: memory: be precise that unit is binary prefix
In the web UI, this was fixed years ago by pve-manager commit c11c4a40
("fix #1631: change units to binary prefix").

Quickly checked with the 'query-memory-size-summary' QMP command that
this is actually the case.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-01-24 17:09:52 +01:00
Noel Ullreich
4748661ae4 fix spelling error in comment
Signed-off-by: Noel Ullreich <n.ullreich@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-23 11:20:11 +01:00
Thomas Lamprecht
eba285f594 cloud init schema: fix indentation and overly long wording
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-19 11:57:06 +01:00
Noel Ullreich
f78c9b6b44 fix #4378: standardized error for ovmf files
The error messages for missing OVMF_CODE and OVMF_VARS files were
inconsistent as well as the error for the missing base var file not
telling you the expected path.

Signed-off-by: Noel Ullreich <n.ullreich@proxmox.com>
2023-01-18 11:03:11 +01:00
Thomas Lamprecht
bdbe07dd06 bump version to 7.3-3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-16 13:53:40 +01:00
Thomas Lamprecht
4044ae1fc3 vm start: fix code style for balloon enabling
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-16 13:46:29 +01:00
Fiona Ebner
83f04be3d5 migration: nbd export: switch away from deprecated QMP command
The 'nbd-server-add' QMP command has been deprecated since QEMU 5.2 in
favor of a more general 'block-export-add'.

When using 'nbd-server-add', QEMU internally converts the parameters
and calls blk_exp_add() which is also used by 'block-export-add'. It
does one more thing, namely calling nbd_export_set_on_eject_blk() to
auto-remove the export from the server when the backing drive goes
away. But that behavior is not needed in our case, stopping the NBD
server removes the exports anyways.

It was checked with a debugger that the parameters to blk_exp_add()
are still the same after this change. Well, the block node names are
autogenerated and not consistent across invocations.

The alternative to using 'query-block' would be specifying a
predictable 'node-name' for our '-drive' commandline. It's not that
difficult for this use case, but in general one needs to be careful
(e.g. it can't be specified for an empty CD drive, but would need to
be set when inserting a CD later). Querying the actual 'node-name'
seemed a bit more future-proof.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-01-13 14:04:39 +01:00
Thomas Lamprecht
c3d151080a cdrom path: code reduction
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-13 13:52:39 +01:00
Stefan Sterz
490b730854 cd rom handling: refactor cd rom path helper function
to stop returning results of assignments

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
2023-01-13 13:20:35 +01:00
Stefan Sterz
259470ee41 cd rom handling: return a clearer error when there is no cd rom drive
when a vm is configured to use a physical cd rom drive but there is no
such drive a cryptic "uninitialized value" error is thrown. this is
due to `$path` being undefined in `sub print_drive_commandline_full`.
warn that no cd rom drive is available instead.

note that the error was cosmetic as the vm would start just fine.

forum thread: https://forum.proxmox.com/threads/119592/

Signed-off-by: Stefan Sterz <s.sterz@proxmox.com>
2023-01-13 13:20:35 +01:00
Fiona Ebner
55d0741197 migration: log error from query-migrate upon migration failure
if it is present. Should give more information for some failures and
even if it's not present, that fact helps to narrow things down.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-01-12 11:12:14 +01:00
Stefan Hanreich
30fdf99cff fix #4358: destroy_vm: Ignore 'suspended' lock when destroying VM
Since we can now differentiate between 'suspended' and 'suspending',
it is possible to ignore the 'suspended' lock when destroying a VM.
It shouldn't matter whether the VM is locked because of hibernation
when you want to remove it. Therefore we can safely ignore the lock.
2023-01-11 10:59:32 +01:00
Fiona Ebner
b3a3e92962 fix #4435: devices list: avoid error for undefined value
When $d->{'pci_bridge'}->{devices} is undef, @-dereferencing it will
die with:
> Can't use an undefined value as an ARRAY reference

This can happen (at least) when the VM is in 'prelaunch' state. The
QAPI definition for '@PciBridgeInfo' also declares the 'devices'
member as optional.

Before commit 721624b ("collect device list for nested pci-bridges"),
there was no issue, because $d->{'pci_bridge'}->{devices} was used in
foreach, so auto-vivified if undef.

Fixes: f721624b ("collect device list for nested pci-bridges")
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2023-01-11 10:14:44 +01:00
Alexandre Derumier
62b26624c6 memory hot-plug: fix check for maximal memory value
Fixes: 4d3f29e ("memory hotplug patch v10")
Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2023-01-02 13:56:43 +01:00
Stefan Hanreich
a46d039d3c rollback: Only create start task with --start if VM is not running
When rolling back to the snapshot of a VM that includes RAM, the VM
gets started by the rollback task anyway, so no additional start task
is needed. Previously, when rolling back with the start parameter and
the VM snapshot included RAM, a start task was created. That task
failed because the VM had already been started by the rollback task.

Additionally documented this behaviour in the description of the start
parameter

Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
2022-12-30 15:39:19 +01:00
Fiona Ebner
7bd9abd243 tree-wide: switch to official spelling of QEMU in descriptions/messages
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-12-20 10:26:41 +01:00
Thomas Lamprecht
9cdb3150f0 bump version to 7.3-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-12-16 12:55:00 +01:00
Thomas Lamprecht
3d07669cf1 ovmf cmd assembly: rework now that it's in a separate method
We can now do a few things that would be not really possible, or at
least mess with readability when this was still mostly inline
config2command, shaves of quite a few lines of code.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-12-12 11:43:19 +01:00
Thomas Lamprecht
2ceb59d4b1 ovmf cmd assembly: reorder arguments
in preparation of reworking the new separate method for OVMF cmd
assembly, do this in a separate very targeted commit to make it more
clear that the next reworking-commit doesn't messes with our tests at
all.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-12-12 11:41:50 +01:00
Fiona Ebner
b7d80c7905 cfg2cmd: factor out ovmf drives printing
No functional change is intended.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-12-06 16:56:30 +01:00
Fabian Grünbichler
ad9e347c46 fix #4372: fix vm_resume migration callback
the fix for the recently introduced requirement of loading the VM config while
migrating was incomplete, since the vmlist node value could already be out of
date by the time load_config is called.

extend the fallback behaviour even further, by doing the following sequence:
- try regular load_config (likely case, rename already fully processed)
- if it fails, get node from vmlist, and load_config using that
- it that fails, invalidate the PVE::Cluster cache, retry regular load_config

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-11-30 16:21:39 +01:00
Thomas Lamprecht
a116a7e08e bump version to 7.3-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-21 13:44:02 +01:00
Fabian Grünbichler
a20dc58a1b explain 'nocheck' in more places
was only explained in git history and vm_stop, add comments in other
relevant places to avoid future breakage.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-11-21 13:42:52 +01:00
Fabian Grünbichler
270bfff2e1 vm_resume: fix nocheck/migrate handling
it's not deterministic whether the rename/move of the VM config
triggered on the source side of a migration is already visible on the
target side when vm_resume is executed. check the vmlist for the node
where the config is currently located if $nocheck is set - it is now
needed to add the forwarding DB entries to the bridge.

this fixes an issue on busier or slower clusters, where pmxcfs hasn't
yet processed the rename, and resuming would fail with an error about
the config not existing.

Reported-by: Dominik Csapak <d.csapak@proxmox.com>

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2022-11-21 13:42:52 +01:00
Thomas Lamprecht
c9a0924df8 bump version to 7.2-12
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-21 08:36:17 +01:00
Fiona Ebner
8481721f22 api: create/update vm: fix clamping cpuunits function calls
When applying the series introducing those calls, the helper was moved
to pve-common's CGroup.pm (see 07c10d5 ("cgroup: move get_cpuunits
helper from qemu-server as clamp_cpu_shares") in pve-common) instead
of pve-guest-common's GuestHelpers.pm. But these calls were not
updated.

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

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2022-11-21 08:27:03 +01:00
Thomas Lamprecht
28768fc317 d/control: depend on newer libpve-guest-common-perl 4.2-3
for new unique tag helper

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-21 08:21:42 +01:00
Thomas Lamprecht
db22080c33 config: ensure that tags are unique
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-21 08:19:33 +01:00
Thomas Lamprecht
eaa3a2b35a bump version to 7.2-11
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2022-11-20 16:30:32 +01:00