Commit Graph

2769 Commits

Author SHA1 Message Date
Thomas Lamprecht
e3e34a10e7 bump version to 7.1-4
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-22 17:07:17 +01:00
Fabian Grünbichler
fd95d780a2 migrate: send updated TPM state volid to target node
The volid may change if local-storage migration is involved, we need
to tell the target node the new one and update the in-memory config
for starting the target VM accordingly.

Reported here: https://forum.proxmox.com/threads/99906/#post-431345

this possibly breaks migration new -> old iff
- spice is not used (else the explicit ticket wins because it comes
  later)
- a local TPM state volume is used
- that local TPM state volume has a different volume id on the target
  node (switched storage, volname already taken, ..)

because the target node will then mis-interpret the tpmstate0 line as
spice ticket and set it accordingly. if the old tpm state volume ID does
not exist on the target node, migration will fail. if it exists by
chance, it might work albeit with a wrong spice ticket (new because of
this patch) and tpm state volume (pre-existing breakage).

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-11-22 16:55:17 +01:00
Fabian Grünbichler
399ca0d66e migrate: improve start STDIN-parameter parsing
only do the compat fallback if no explicit spice ticket was given, and
warn on unknown parameters on STDIN.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-11-22 16:53:09 +01:00
Thomas Lamprecht
dce63c70c8 bump version to 7.1-3
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-16 14:04:49 +01:00
Fabian Grünbichler
41c8671e78 migrate: skip tpmstate for NBD migration
This patch fixes the wrong attempt of setting up an NBD server for
the replicated TPM state volume, in contrast to the other volumes the
TPM state is managed by swtpm and isn't available to QEMU for
block-migration/bitmap tracking.

Note that we do migrate the state volume via a storage migration
anyway if necessary.

This code path was only triggered for replicated VMs with TPM.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-16 14:03:01 +01:00
Thomas Lamprecht
248fab7a08 bump version to 7.1-2
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-15 16:59:27 +01:00
Dominik Csapak
1319908f5d exclude efidisk and tpmstate for boot disk selection
else we cannot create a vm without a disk but with a tpmstate/efidisk,
since the api tries to generate the default bootorder with them included

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-11-15 16:57:52 +01:00
Thomas Lamprecht
701a86f267 bump version to 7.1-1
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-15 16:27:06 +01:00
Dominik Csapak
9c85548fa1 pci: do not reserve pci-ids for mediated devices
else a user cannot use more than one mdev per card per host.
We do not need to reserve them at all, since sysfs will error out
on creation/reuse anyway

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-11-15 15:01:12 +01:00
Thomas Lamprecht
ce3fbcd456 api: update: fix missing newline in background-delayed task error
this error path is mostly used for re-attaching disks and the like,
and the "check if task is already done" part uses a method to read
the task status that will never include a trailing newline, so add it
our self to avoid "... at /usr/share/perl5/PVE/API2/Qemu.pm line
1480. (500)"

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-15 09:21:50 +01:00
Oguz Bektas
bec8742495 cfg2cmd: disable SMM when display=none and SeaBIOS is both used
issue reported in community forum [0][1], like "serial[n]" display we
also need to set this option for "none", otherwise we get a boot
loop.

[0]: https://forum.proxmox.com/threads/99508
[1]: https://forum.proxmox.com/threads/97310/post-427129

Signed-off-by: Oguz Bektas <o.bektas@proxmox.com>
Reviewed-by: Fabian Ebner <f.ebner@proxmox.com>
Tested-by: Fabian Ebner <f.ebner@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-11 14:16:09 +01:00
Thomas Lamprecht
2db2ecc69a bump version to 7.0-19
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-11 14:01:04 +01:00
Thomas Lamprecht
f519ab0b76 api: move disk: schema indentation and style-nit fixes
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-11 14:01:04 +01:00
Thomas Lamprecht
c41439ac5b qm: move-disk: to not make reassign specific options fixed
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-11 14:01:04 +01:00
Thomas Lamprecht
e849ff6f91 qm: style/indentation/cleanup fixes for command definition
and record some possible FIXMEs for a next point/major release

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-11 14:01:04 +01:00
Thomas Lamprecht
3b43845ad1 d/control: bump versioned dependency on libpve-common-perl
to ensure the renamed 'storage-pair' is handled correctly..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-11 12:40:21 +01:00
Fabian Grünbichler
9fb295d095 migrate: factor out storage checks
to re-use them for incoming remote migrations.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Fabian Ebner <f.ebner@proxmox.com>
2021-11-11 10:47:26 +01:00
Fabian Grünbichler
a4d828e35e adapt to renamed storage-pair format
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Fabian Ebner <f.ebner@proxmox.com>
2021-11-11 10:47:26 +01:00
Fabian Grünbichler
e52415c15b d/control: add pve-ha-manager to B-D
it's needed for tests to succeed.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Reviewed-by: Fabian Ebner <f.ebner@proxmox.com>
2021-11-11 10:47:26 +01:00
Fabian Ebner
e5a6919c38 cfg2cmd: turn smm off when SeaBIOS and serial display are used
Since commit 277d33454f77ec1d1e0bc04e37621e4dd2424b67 in pve-qemu,
smm=off is no longer the default, but with SeaBIOS and serial display,
this can lead to a boot loop.

Reported in the community forum [0] and reproduced with a Debian 10
VM.

[0]: https://forum.proxmox.com/threads/pve-7-0-all-vms-with-cloud-init-seabios-fail-during-boot-process-bootloop-disk-not-found.97310/post-427129

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-11-11 10:32:17 +01:00
Aaron Lauterer
bf67da2bf7 disk reassign: add unused disks directly to config
Using $update_vm_api for unused disks will cause them to end up as a
pending change if the VM is running.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2021-11-11 10:08:26 +01:00
Fabian Grünbichler
f4e4c77984 disk reassign: fix assigning to unused slot
this broke with the previous simplification.

Tested-by: Aaron Lauterer <a.lauterer@proxmox.com>
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-11-10 12:41:04 +01:00
Fabian Grünbichler
a6273aa8bf reassign disk: more cleanup
avoid re-using the toplevel variable name

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-11-10 12:11:03 +01:00
Fabian Grünbichler
441024921e reassign disk: fix permission checks
with `storage` being optional (and not allowed for reassign operations),
the ACL path in the schema can end up as `/storage/-`, which is wrong.
replace it with an explicit check:

- target `storage` for move disk
- storage from source disk for reassign disk (we only rename here, but
  it's still a new volume on that storage after all)

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-11-10 11:49:36 +01:00
Fabian Grünbichler
dbc817ba4a reassign disk: various improvements
some style, some missing checks. some duplication reduced a bit.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2021-11-10 11:49:36 +01:00
Aaron Lauterer
70c0ad6687 api: move-disk: cleanup very long lines
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2021-11-09 16:16:00 +01:00
Aaron Lauterer
a94532188d api: move-disk: add move to other VM
The goal of this is to expand the move-disk API endpoint to make it
possible to move a disk to another VM. Previously this was only possible
with manual intervertion either by renaming the VM disk or by manually
adding the disks volid to the config of the other VM.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2021-11-09 16:16:00 +01:00
Aaron Lauterer
1071373027 Drive: add valid_drive_names_with_unused
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2021-11-09 16:16:00 +01:00
Aaron Lauterer
2817091d33 cli: qm: change move_disk to move-disk
also add alias to keep move_disk working.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
2021-11-09 16:16:00 +01:00
Fabian Ebner
7a16336dd2 config: rollback is possible: add blockers parameter
Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-11-08 10:34:00 +01:00
Thomas Lamprecht
b20f267061 bump version to 7.0-18
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-04 15:30:30 +01:00
Thomas Lamprecht
cc18103635 cfg2cmd: switch off ACPI hotplug on bridges for q35 VMs
See commit 17858a1695 (hw/acpi/ich9: Set ACPI PCI hot-plug as default
on Q35)[0] in upstream QEMU repository for details about why the change
was made.

As that change affects systemds predictable interface naming[1],
e.g., by going from a previously `ens18` name to `enp6s18`, it may
have rather bad effects for users that did not setup some .link files
to enforce a specific naming by an more stable information like the
NIC's MAC-Address

The alternative would be making the preferred mode of hotplug an
option like `hotplug-mode=<acpi|pcie>`, but it does not seems like
one would like to change that much in the first place...

Note the changes to the tests and especially the tests with q35
machines that did not change.

[0]: https://gitlab.com/qemu-project/qemu/-/commit/17858a1695
[1]: https://www.freedesktop.org/software/systemd/man/systemd.net-naming-scheme.html#Naming

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-04 15:30:30 +01:00
Thomas Lamprecht
02cfca4b71 tests: cfg2cmd: add a few q35 related tests
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-04 15:30:30 +01:00
Thomas Lamprecht
af2a1a1cdb config: meta: also save the QEMU version installed during creation
This is intended to be used to apply some workarounds for the
non-windows ostyped VMs which we'd still like to not pin on a
specific machine version, as normally Linux et al. can cope with such
changes on fresh boot just fine and until now this was a once every
few year issue (albeit systemd's "predictable" interface naming has
some potential to pick up on churn frequency).

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-04 15:30:30 +01:00
Thomas Lamprecht
26b443c846 config: add new meta property with the VM creation time
currently we only add the creation time (ctime), that was requested
as low priority wish from some users from time to time.

Note that the meta info is not available in the update API endpoints,
and at the moment the code should not change/add/delete it either in
any place.

We may want to update in on actions like clone or backup-restore in
the future, e.g., to also save the time of that event and possibly
the original source VMID, put that can be thought out later.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Acked-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-04 15:30:22 +01:00
Thomas Lamprecht
115cb432bc cloud init: add comment regarding 3 MiB size limit
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Originally-by: Mira Limbeck <m.limbeck@proxmox.com>
2021-11-04 13:14:17 +01:00
Constantin Herold
101beafe0d fix #2429: allow to specify cloud-init vendor snippet via cicustom
Signed-off-by: Constantin Herold <proxmox8914@herold.me>
Reviewed-by: Mira Limbeck <m.limbeck@proxmox.com>
2021-11-04 12:46:07 +01:00
Thomas Lamprecht
33f8b88782 agent hotplug: small style cleanups & comment addition
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-04 08:46:22 +01:00
Alexandre Derumier
74ea2c65a9 qemu-agent: allow hotplug of fstrim_cloned_disk option.
This option don't have any impact on device itself.

Signed-off-by: Alexandre Derumier <aderumier@odiso.com>
2021-11-04 08:37:03 +01:00
Thomas Lamprecht
d08e787cae test: cfg2cmd: fix command output
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-03 16:46:28 +01:00
Thomas Lamprecht
e8a268100b vm_commandline: reduce line bloat
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-03 16:35:57 +01:00
Thomas Lamprecht
6971c38ed9 print_keyboarddevice_full: drop unused machine parameter
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-03 16:35:57 +01:00
Thomas Lamprecht
f606d5bd6f scsi_inquiry: refactor and code cleanup
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-03 16:35:57 +01:00
Thomas Lamprecht
8eb73377c1 kvm_user_version: add explicit return statement
while perl returns the (scalar) result of the last expression
automatically its still nicer to explicitly do so..

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-11-03 16:21:22 +01:00
Thomas Lamprecht
1f91f7b464 drives: ro: code reduction/refactor
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-27 17:00:24 +02:00
Dominik Csapak
12e1d472e3 drives: expose 'readonly' flag of qemu for scsi/virtio
this allows a user to set a drive to 'read-only'. This can be useful
if a disk should not be written to, or if the backing file/source is
not writable (like a mapped pbs backup to /dev/loopX).

the option is named 'ro', to achieve consistency with containers

while this could also be achieved by setting 'snapshot=1', this would
create a temporary file in /var/tmp which can get quite big.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
2021-10-27 13:53:11 +02:00
Stefan Reiter
6a5589010e vzdump: increase timeout for QMP 'cont' after backup start
Since 'backup' can now work asynchronously, QEMU may not be ready to
receive the next QMP command ('cont') immediately. Thus, increase the
timeout, to avoid aborted backups in slow environments.

There may be a deeper QEMU bug hidden under the covers here too, but at
least one user reported success with simply increasing the timeout:
https://forum.proxmox.com/threads/pve7-pbs2-backup-timeout-qmp-command-cont-failed-got-timeout.95212/page-2#post-426261

See also:
https://bugzilla.proxmox.com/show_bug.cgi?id=3693
https://forum.proxmox.com/threads/problem-seit-update-auf-7-0.97388/
https://forum.proxmox.com/threads/error-with-backup-when-backing-up-qmp-command-query-backup-failed-got-wrong-command-id.88017/page-3#post-416339

Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
2021-10-27 13:51:45 +02:00
Fabian Ebner
23bee97d05 vm start: only print tpm-related message if there is an instance
Otherwise, this can produce an undef warning and be misleading.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
2021-10-27 13:23:18 +02:00
Dominik Csapak
25de70ae59 fix removing cpulimit on running vm
like in pve-container:
04a62bd ("fix #3506: config: fix removing the cpulimit of a running CT")

reported in the forums (no bug# yet):
https://forum.proxmox.com/threads/issue-with-removing-cpu-limit-from-running-vm.97799/

note that this will break CGv1 without the following fix installed:
https://git.proxmox.com/?p=pve-common.git;a=commitdiff;h=d37a71867

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Oguz Bektas <o.bektas@proxmox.com>
Reviewed-by: Oguz Bektas <o.bektas@proxmox.com>
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2021-10-22 11:55:08 +02:00
Dominik Csapak
90b20b152c use non SMM ovmf code file for i440fx machines
ovmf with SMM enabled will not boot on i440fx (hangs on graphics
initialization), so load the non SMM variant.

should be no issue regarding live-migration since it never worked with
this anyway.

adapts the test and adds one with q35

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Stefan Reiter <s.reiter@proxmox.com>
Reviewed-by: Stefan Reiter <s.reiter@proxmox.com>
2021-10-21 12:38:58 +02:00