Commit graph

3764 commits

Author SHA1 Message Date
Fiona Ebner
9e973210ea qmp client: add $noerr argument
Using the $noerr argument will allow callers to opt-in to handling
errors themselves.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/all/20250812115652.79330-2-f.ebner@proxmox.com
2025-08-12 14:49:43 +02:00
Fiona Ebner
1441c009bc print drive commandline: prohibit using snapshot-as-volume-chain qcow2 images
Require that snapshot-as-volume-chain qcow2 images are always used in
combination with '-blockdev', rather than '-drive'. With '-drive', the
'discard-no-unref' option is not set and the fragmentation can lead to
the same issue that for '-blockdev', was solved by commit a3a9a2ab
("fix #6543: use qcow2 'discard-no-unref' option when using
snapshot-as-volume-chain").

While it would be possible to set the flag for '-drive' too, the
snapshot-as-volume-chain feature already only works with machine type
>= 10.0, see commit 6b2b45fd ("snapshot create/delete: die early for
snapshot-as-volume-chain for pre-10.0 machine version") and it's only
tested for those. Avoid accidents and other unknown issues by being
strict and prohibiting usage without '-blockdev'.

Reported-by: Friedrich Weber <f.weber@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/all/20250811135154.253817-1-f.ebner@proxmox.com
2025-08-12 11:17:37 +02:00
Fiona Ebner
240f44a369 fix #6648: api: machine versions: fix ordering
It's necessary to numerically compare versions in machine types, so
introduce a new helper which does that.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/all/20250811104812.189393-3-f.ebner@proxmox.com
2025-08-11 14:59:10 +02:00
Fiona Ebner
9e4210a025 machine: add extract_version_parts helper
Note that the regex is changed to not include the '+pve' part. No
functional change intended.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/all/20250811104812.189393-2-f.ebner@proxmox.com
2025-08-11 14:59:10 +02:00
Fiona Ebner
6b2b45fd0d snapshot create/delete: die early for snapshot-as-volume-chain for pre-10.0 machine version
As reported in the community forum [0], a running VM with pre-10.0
machine version using a storage with snapshot-as-volume-chain will run
into issues when creating a snapshot. Similarly deleting the snapshot
of such a VM would fail. Having '-blockdev' is a hard requirement for
the implementation of the snapshot-as-volume-chain feature for running
VMs, so die and suggest upgrading the machine version.

[0]: https://forum.proxmox.com/threads/lvm-thick-with-iscsi-pve-9-0-3.169319/

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Tested-by: Hannes Laimer <h.laimer@proxmox.com>
Link: https://lore.proxmox.com/20250807104832.51784-1-f.ebner@proxmox.com
2025-08-07 14:31:55 +02:00
Thomas Lamprecht
9c094a357b bump version to 9.0.16
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-08-05 12:21:06 +02:00
Christoph Heiss
6df5858a1c vmstate: always quiesce warnings on vm stop cleanup
At this point, the dbus-vmstate helper is not expected to be running
anymore.

Using $noerr here didn't really make sense - as it never should be
running anymore at this point, plus the VM should also be stopped - thus
the "happy" path here is to fail removing the dbus-vmstate helper.
It resulted in another spurious warning _after_ a migration on the
source node.

Fixes: 067a0f55 ("vmstate: improve cleaning up dbus-vmstate and avoid spurious warning")
Reported-by: Friedrich Weber <f.weber@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Link: https://lore.proxmox.com/20250805095828.301188-1-c.heiss@proxmox.com
2025-08-05 12:13:45 +02:00
Thomas Lamprecht
e4bf96735f bump version to 9.0.15
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-08-04 16:03:23 +02:00
Christoph Heiss
067a0f55bb vmstate: improve cleaning up dbus-vmstate and avoid spurious warning
First, moving to vm_stop_cleanup(), which is a better fit for this.
It gets called by the cleanup API method in case of unclean shutdown or
from inside the guest.

In every case, the dbus-vmstate daemon should _never_ be running at this
point, as it is started only before migration and stopped directly after
migration, before vm_stop_cleanup() is even called. So it should only be
left running in case of a crash during migration.

Calling it anyway here ensures that the daemon is always (cleanly) shut
down. As the dbus-vmstate is part of the VM scope unit, that would it
tear it down too as a last resort.

Fixes the following spurious warning when a VM was shutdown from inside
the guest:

  `failed to retrieve org.qemu.VMState1 owners: org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owners of name 'org.qemu.VMState1': no such name`

Reported-by: Hannes Duerr <h.duerr@proxmox.com>
Reported-by: Maximiliano Sandoval <m.sandoval@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Link: https://lore.proxmox.com/20250804133002.1625925-1-c.heiss@proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-08-04 16:02:45 +02:00
Thomas Lamprecht
43513e14ac bump version to 9.0.14
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-08-01 18:38:16 +02:00
Thomas Lamprecht
8c17743c87 re-tidy perl code
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-08-01 17:22:30 +02:00
Thomas Lamprecht
9660710462 api: migration checks: rename return prop to dependent-ha-resources and improve description
We actually query if there are any guests positive affinity rule for
the to-be migrated VM, while that normally means the they will be
migrated, it doesn't has to be (e.g., node constraints might interfere
here), and "comigrated" is not as much used compared to
"dependencies", so that might be easier to understand for non-native
speakers or users (vs devs, these details tend to leak).

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-08-01 17:22:23 +02:00
Thomas Lamprecht
eba40484c9 api: migration preconditions: fix default value for "comigrated" HA vms
By returning an object instead of a array for the default the frontend
can get confused if it's using an iterator code that expects arrays.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-08-01 17:16:15 +02:00
Thomas Lamprecht
6b084e3b6b bump version to 9.0.13
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-07-31 14:26:17 +02:00
Fiona Ebner
4a0952d985 blockdev: delete: delete format block node first
Nodes need to be deleted from top to bottom. See also commit 32102c06
("blockdev: blockdev replace: delete format block node first").

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250731104935.53039-2-f.ebner@proxmox.com
2025-07-31 14:24:24 +02:00
Fiona Ebner
f06f3a3c4a fix #6580: blockdev: commit: re-open target format node as writable if necessary
Removing the first snapshot in a snapshot-as-volume-chain is done via
block-commit for performance reasons, rather than stream, because the
snapshot volume, being the base, is usually larger than the delta
since the snapshot.

When a drive has the 'ro' flag set in the virtual machine
configuration, all three nodes in the throttle->fmt->file chain are
opened with the read-only flag set and thus the format node could not
serve as the target for the stream operation.

Fix this, by temporarily re-opening the format node as writable. Note
that from the guest perspective, nothing changes, because the
read-only flag for the top throttle node is preserved.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250731104935.53039-1-f.ebner@proxmox.com
2025-07-31 14:24:24 +02:00
Thomas Lamprecht
8eec31e92d bump version to 9.0.12
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-07-31 11:34:12 +02:00
Fiona Ebner
0b9090c6ab block job: mirror: always detach the target node upon cancelling
This is a further improvement after commit 8e671e79 ("block job:
mirror: always detach the target node upon error"). It might be
that a cancelled job ends up in concluded state without an error
being set in the result of the 'query-block-jobs' QMP command and
the target node would not be detached. To fix it, also detach the
target node when cancelling the job. This is correct even when the job
was cancelled after completion, as in that case, the drive is not
switched over to use the target node.

Reported-by: Friedrich Weber <f.weber@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Tested-by: Friedrich Weber <f.weber@proxmox.com>
Link: https://lore.proxmox.com/20250731090956.23443-1-f.ebner@proxmox.com
2025-07-31 11:33:23 +02:00
Thomas Lamprecht
0aea31ee85 d/control: bump versioned dependency on pve-ha-manager
for affinity rule migration blocker.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-07-31 11:31:00 +02:00
Daniel Kral
cae2f44f83 api: migration preconditions: add checks for ha resource affinity rules
Add information about positive and negative ha resource affinity rules,
which the VM is part of, to the migration precondition API endpoint.
These inform callees about any comigrated resources or blocking
resources that are caused by the resource affinity rules.

Signed-off-by: Daniel Kral <d.kral@proxmox.com>
Link: https://lore.proxmox.com/20250730181428.392906-21-d.kral@proxmox.com
2025-07-31 10:53:44 +02:00
Thomas Lamprecht
b2f0236a8b bump version to 9.0.11
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-07-31 04:50:13 +02:00
Aaron Lauterer
46a9005ff3 rrddata: use new pve-vm-9.0 rrd location if file is present
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Link: https://lore.proxmox.com/20250726010626.1496866-30-a.lauterer@proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-07-31 04:47:47 +02:00
Aaron Lauterer
b14ae0d9a5 vmstatus: switch mem stat to PSS of VM cgroup
Instead of RSS, let's use the same PSS values as for the specific host
view as default, in case this value is not overwritten by the balloon
info.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Link: https://lore.proxmox.com/20250726010626.1496866-29-a.lauterer@proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-07-31 04:47:47 +02:00
Thomas Lamprecht
dab637268e status api: improve description for new PSI metrics slightly
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-07-31 04:47:47 +02:00
Thomas Lamprecht
9fca6634e5 vm status: factor gathering cgroup memory usage out into dedicated method
no point in bloating the rather big vmstatus sub even further, this
way one can also add a descriptive name and comment.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-07-31 04:47:47 +02:00
Aaron Lauterer
d426de6c7d vmstatus: add memhost for host view of vm mem consumption
The mem field itself will switch from the outside view to the "inside"
view if the VM is reporting detailed memory usage informatio via the
ballooning device.

Since sometimes other processes belong to a VM too, for example swtpm,
we collect all PIDs belonging to the VM cgroup and fetch their PSS data
to account for shared libraries used.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Link: https://lore.proxmox.com/20250726010626.1496866-28-a.lauterer@proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-07-31 04:47:47 +02:00
Folke Gleumes
213200ef79 metrics: add pressure stall information to status
[AL:
    * rebased on current master
    * switch to new, more generic read_cgroup_pressure function
    * add pressures to return properties
]

Originally-by: Folke Gleumes <f.gleumes@proxmox.com>
Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Link: https://lore.proxmox.com/20250726010626.1496866-27-a.lauterer@proxmox.com
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-07-31 04:47:35 +02:00
Thomas Lamprecht
fb98d1d566 bump version to 9.0.10
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-07-30 23:06:55 +02:00
Thomas Lamprecht
b926ff9c66 d/control: bump dependency for pve-firewall & suggests for proxmox-firewall
To ensure we got the relevant rules for conntrack migration available.

Only do a suggests on the newer nft based proxmox-firewall, we do not
have any hard-dependency on it anywhere currently.

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-07-30 23:00:00 +02:00
Fiona Ebner
f27115cede image convert: make using zeroinit with target-image-opts work
Also add a test to witness this combination.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250730150325.138087-4-f.ebner@proxmox.com
2025-07-30 22:57:28 +02:00
Fiona Ebner
659b0716ce image convert: re-use generate_drive_blockdev()
This avoids having the handling for 'discard-no-unref' in two places.

In the tests, rename the relevant target images with a '-target'
suffix to test for them in the mocked volume_snapshot_info() helper.

Suggested-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250730150325.138087-3-f.ebner@proxmox.com
2025-07-30 22:57:28 +02:00
Fiona Ebner
4866264c59 image convert: avoid combining target image options and zeroinit filter
Would fail with an error
> Block format 'qcow2' does not support the option 'zeroinit:driver'
for a qcow2 target on a directory storage with
'snapshot-as-volume-chain'.

Reported-by: Friedrich Weber <f.weber@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250730150325.138087-2-f.ebner@proxmox.com
2025-07-30 22:57:28 +02:00
Christoph Heiss
a90fe981c9 migrate: flush old VM conntrack entries after successful migration
After a successful live-migration, the old VM-specific conntrack entries
are not needed anymore on the source node and can thus be flushed.

Tested-by: Stefan Hanreich <s.hanreich@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Link: https://lore.proxmox.com/20250730094549.263805-9-c.heiss@proxmox.com
2025-07-30 22:55:48 +02:00
Christoph Heiss
dc76a590a7 fix #5180: migrate: integrate helper for live-migrating conntrack info
Fixes #5180 [0].

This implements for live-migration:
a) the dbus-vmstate is started on the target side, together with the VM
b) the dbus-vmstate helper is started on the source side
c) everything is cleaned up properly, in any case

It is currently off-by-default and must be enabled via the optional
`with-conntrack-state` migration parameter.

The conntrack entry migration is done in such a way that it can
soft-fail, w/o impacting the actual migration, i.e. considering it
"best-effort".

A failed conntrack entry migration does not have any real impact on
functionality, other than it might exhibit the problems as lined out in
the issue [0].

For remote migrations, only a warning is thrown for now. Cross-cluster
migration has stricter requirements and is not a "one-size-fits-it-all".
E.g. the most promentient issue if the network segmentation is
different, which would make the conntrack entries useless or require
careful rewriting.

[0] https://bugzilla.proxmox.com/show_bug.cgi?id=5180

Tested-by: Stefan Hanreich <s.hanreich@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Link: https://lore.proxmox.com/20250730094549.263805-8-c.heiss@proxmox.com
2025-07-30 22:55:35 +02:00
Christoph Heiss
ef2db7e975 fix #5180: dbus-vmstate: add daemon for QEMUs dbus-vmstate interface
First part to fixing #5180 [0].

Adds a simple D-Bus server which implements the `org.qemu.VMState1`
interface as specified in the QEMU documentation [1].

Using the built-in QEMU VMState machinery saves us from having to worry
about transfer and convergence of the data and letl QEMU take care of
it.

Any object on the D-Bus path `/org/qemu/VMState1` implementing that
interface will be called by QEMU during live-migration, iif the `Id`
property is registered within the `dbus-vmstate` QEMU object for a
specific VM.

The actual state loading/restoring is done via the conntrack(8) tool, a
small tool which already implements hard parts of interacting with the
conntrack subsystem via netlink.

Filtering is done on CONNMARK, which is set to the specific VMID for all
packets by the firewall.

Additionally, a custom `com.proxmox.VMStateHelper` interface is
implemented by the object, adding a small `Quit` method for cleanly
shutting down the daemon via the D-Bus API.

For all to work, D-Bus needs a policy describing who is allowed to
access the interface. [2]

Currently, there is a hard-limit of 1 MiB of state enforced by QEMU.
Typical conntrack state entries as dumped by conntrack(8) in the `save`
output format are just plaintext, ASCII lines and mostly around
150-200 characters. That translates then to about ~5200 entries that can
be migrated.

Such a typical line looks like:

  -A -t 431974 -u SEEN_REPLY,ASSURED -s 10.1.0.1 -d 10.1.1.20 \
  -r 10.1.1.20 -q 10.1.0.1 -p tcp --sport 48550 --dport 22 \
  --reply-port-src 22 --reply-port-dst 48550 --state ESTABLISHED

In the future, compression could be implemented for these before sending
them to QEMU, which should increase the above number quite a bit - since
these entries are nicely compressible.

[0] https://bugzilla.proxmox.com/show_bug.cgi?id=5180
[1] https://www.qemu.org/docs/master/interop/dbus-vmstate.html
[2] https://dbus.freedesktop.org/doc/dbus-daemon.1.html#configuration_file

Tested-by: Stefan Hanreich <s.hanreich@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Link: https://lore.proxmox.com/20250730094549.263805-7-c.heiss@proxmox.com
2025-07-30 22:55:32 +02:00
Christoph Heiss
ef1fd2e2aa api2: qemu: add module exposing node migration capabilities
Similar to the already existing ones for CPU and QEMU machine support.

Very simple for now, only provides one property for now:

  'has-dbus-vmstate' - Whether the dbus-vmstate is available/installed

Tested-by: Stefan Hanreich <s.hanreich@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Link: https://lore.proxmox.com/20250730094549.263805-6-c.heiss@proxmox.com
2025-07-30 22:55:29 +02:00
Christoph Heiss
cd61a36ac8 qmp helpers: allow passing structured args via qemu_objectadd()
No functional changes for existing code.

Tested-by: Stefan Hanreich <s.hanreich@proxmox.com>
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Link: https://lore.proxmox.com/20250730094549.263805-5-c.heiss@proxmox.com
2025-07-30 22:55:26 +02:00
Shannon Sterz
6b7598a643 qemu-server: exit delete early if we cannot find a snapshot
Die if the list of snapshots returned by `volume_snapshot_info` does
not contain the snapshot we are trying to delete.

Previously it was just assumed that the snapshot would be present,
leading to the entry in the list being autoviviefied by the following
lines of code. Hence, we tried to commit nonexistent snapshot states
here, as both `$parentsnap` and `$childsnap` would be undefined.

Signed-off-by: Shannon Sterz <s.sterz@proxmox.com>
Link: https://lore.proxmox.com/20250730103705.98313-3-s.sterz@proxmox.com
[FE: also include volid in error message]
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2025-07-30 18:27:50 +02:00
Fiona Ebner
76069e80b3 bump version to 9.0.9
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2025-07-29 17:06:36 +02:00
Fabian Grünbichler
a82bde3a99 blockdev-stream/-commit: make backing file relative
to avoid the resulting qcow2 file referencing its backing file via an absolute
path, which makes renaming the base of the storage impossible.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Link: https://lore.proxmox.com/20250729115320.579286-6-f.gruenbichler@proxmox.com
2025-07-29 14:43:52 +02:00
Fiona Ebner
8e671e795f block job: mirror: always detach the target node upon error
For example, attempting to live-migrate a disk again after failure
would not work, because a node with the same name would still be
attached.

Mirroring the disk to a shared storage after VM live-migration failure
and then attempting VM live-migration again, would result in

> migration status error: failed - Error in migration completion: Input/output error

This is because for migration completion, all attached block devices
are flushed, but the NBD export does not exist on the target side
anymore.

Fixes: 1da91175 ("block job: add blockdev mirror")
Reported-by: Hannes Dürr <h.duerr@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Tested-by: Hannes Duerr <h.duerr@proxmox.com>
Link: https://lore.proxmox.com/20250728100702.38685-1-f.ebner@proxmox.com
2025-07-29 08:07:42 +02:00
Fiona Ebner
c106f1326d migration: handle 'cancelling' and 'wait-unplug' status
When in 'cancelling' status, wait until the transition to 'cancelled'
happens. Similarly, when in 'wait-unplug' status, wait for the
transition to the next state.

According to the QMP reference docs:

cancelling:
> in the process of cancelling migration.

wait-unplug:
> wait for device unplug request by guest OS to be completed.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250728143042.103045-4-f.ebner@proxmox.com
2025-07-29 08:03:09 +02:00
Fiona Ebner
34d03f9148 migration: handle 'device' migration status newly present in QEMU 10.0+
The QMP reference docs describe the 'device' status as:

> During device serialisation (also known as switchover phase). Before
> 9.2, this is only used when (1) in precopy, and (2) when
> pre-switchover capability is enabled. After 10.0, this state will
> always be present for every migration procedure as the switchover
> phase.

Since Proxmox VE did not use the pre-switchover capability, it has not
been observed before QEMU 10.0. The state is still only reached during
block device inactivation, but it will be reached.

Reported in the community forum:
https://forum.proxmox.com/threads/168619/post-786535

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250728143042.103045-3-f.ebner@proxmox.com
2025-07-29 08:03:09 +02:00
Fiona Ebner
d3842716a1 migration: status check: order states in regex alphabetically
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250728143042.103045-2-f.ebner@proxmox.com
2025-07-29 08:03:09 +02:00
Fiona Ebner
fb7e0904b7 blockdev: ovmf: use correct cache mode for EFI disk
As reported in the community forum [0], there was a regression for EFI
disks with the switch to -blockdev.

[0]: https://forum.proxmox.com/threads/168619/post-786114

Fixes: 1d0818d6 ("ovmf: add support for using blockdev")
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Tested-by: Friedrich Weber <f.weber@proxmox.com>
2025-07-28 11:41:16 +02:00
Thomas Lamprecht
bed20fdded bump version to 9.0.8
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2025-07-25 16:14:26 +02:00
Fiona Ebner
71623e5abc qmp: device unplug: bump timeout for removing virtio scsi controller
It's possible to run into the default timeout of 5 seconds with quite
a simple and generic Debian 12, kernel 6.1 test VM. Detaching happened
right after doing a lot of IO on the associated drive.

In testing, detaching the drive itself was immediate, and detaching
the VirtIO SCSI controller always took 6 seconds. Use 15 seconds, so
that it's more than twice the value to be on the safe side for the
future.

For completeness, the VM configuration:

agent: 0
boot: order=scsi0
cores: 2
cpu: host
hotplug: disk,network,usb
ide2: none,media=cdrom
machine: q35
memory: 6144
name: Copy-of-VM-Copy-of-VM-apache
net0: virtio=BC:24:11:49:0F:85,bridge=vnet0,firewall=1
numa: 1
ostype: l26
scsi0: sharedlvm:vm-103-disk-0.qcow2,iothread=1,size=4304M
scsi1: sharedlvm:vm-103-disk-1.qcow2,iothread=1,size=4G
scsi2: sharedlvm:vm-103-disk-2.qcow2,iothread=1,size=4G
scsi3: zfs:vm-103-disk-0,size=4G
scsihw: virtio-scsi-single
smbios1: uuid=f3f9952f-aab9-45ef-933d-ee01df474b26
sockets: 2
startup: order=2
vmgenid: 529f6974-6fc8-4196-9fb2-9639f55d31d6

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2025-07-25 14:14:46 +02:00
Fiona Ebner
6d212deaad qmp: verify device deletion: allow specifying timeout
The default timeout is not appropriate in all cases, e.g. removing a
VirtIO SCSI controller can take more than 5 seconds.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2025-07-25 14:14:46 +02:00
Fabian Grünbichler
f10a4e62c4 image convert: add FIXME
https://lore.proxmox.com/pve-devel/20250725105109.54093-9-f.ebner@proxmox.com/T/#u

was proposed but is quite involved, if no better solution is found then that
approach should work as well.

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
2025-07-25 14:14:46 +02:00
Fiona Ebner
6caeb09695 tests: cfg2cmd: improve mocking File::stat
Stat-ing /dev/null worked, because the check in the blockdev module is
for block and character devices and then decides based on the
'media=cdrom' flag whether to use the host_cdrom or host_device
driver. But the result should actually be mocked to represent a block
device rather than a character device.

Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
2025-07-25 13:20:55 +02:00