the new workflow is:
1)
PVE::Storage::volume_snapshot: rename the current to snap
+ allocate the new current with snap backing
(the qemu process have still the inode opened)
2) replace the current to snap in the blockdev graph with reopen
3) add a new current blockdev
3) use block-snapshot to replace the active image with the new current blockdev
with the qemu
also:
move PVE::Storage::volume_rename outside blockdev_replace,
and rename 'blockdev_rename()' to 'blockdev_replace()'.
as we only replace/reopen the blockdev nodes now.
Signed-off-by: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
not sure if it was an error, but it's failing now with new more
restricted volname parsing
Signed-off-by: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
fixme:
- add test for internal (was missing) && external qemu snapshots
- is it possible to use blockjob transactions for commit && steam
for atomatic disk commit ?
Signed-off-by: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
We need to define name-nodes for all backing chain images,
to be able to live rename them with blockdev-reopen
For linked clone, we don't need to definebase image(s) chain.
They are auto added with #block nodename.
Signed-off-by: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
for external snapshot, we simply use snap volname as src.
don't use internal snapshot option in the command line.
Signed-off-by: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
For aarch64, the virt machine has an initial pcie.0 bus. The other pci
bridges that get added on top are called pci.N, see the relevant
section in config_to_command() which adds them.
In particular this fixes adding an RNG device, which is require for
OVMF PXE boot.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Link: https://lore.proxmox.com/20250618152009.120524-4-f.ebner@proxmox.com
when creating or cleaning up NVIDIA vGPUs, we mistakenly assumed a
PCI domain of 0000, but this might be different.
Use 'normalize_pci_id' from PVE::SysFSTools, which handles this already
correctly.
Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Link: https://lore.proxmox.com/20250704061852.251189-3-d.csapak@proxmox.com
had an older version installed on a dev VM that still had some issues
with not honoring the mft option correctly, resulting in multiple
params perl line even though the params got wrapped already.
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
pve-firewall introduced a new helper for deciding whether to create a
firewall bridge for a given tap interface. In addition to checking for
nftables, it also checks for the type of the bridge. This fixes an
issue with OVS and the nftables firewall, where firewall bridges are
still required in order for the guest firewall to work and the new
helper in pve-firewall checks for that condition now.
Previously, only the vm network script checked the condition for
creating a firewall bridge properly, but not the function for
hotplugging VM network devices. This caused a firewall bridge to
always get created when hotplugging a network device. The additional
firewall bridge had no influence on the functionality of nftables, but
was unnecessary.
For that matter a helper in qemu-server is introduced that should be
used by all call sites.
Signed-off-by: Stefan Hanreich <s.hanreich@proxmox.com>
Reviewed-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
FG: adapted context slightly
FG: bump versioned dependency
Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
When the format is raw, the size can be explicitly passed. When the
format is a container format like qcow2, the image should already be
allocated with the correct virtual size.
It is not possible to resize a disk with an explicit 'size' set, so
only set this for EFI disks.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
In preparation for the switch to -blockdev.
Otherwise, there would be an error:
> An error occurred during live-restore: VM 103 qmp command
> 'block-stream' failed - Permission conflict on node
> 'a25d9b2028b5a364dddbb033603b68c': permissions 'write' are both
> required by node 'drive-ide0' (uses node
> 'a25d9b2028b5a364dddbb033603b68c' as 'file' child) and unshared
> by stream job 'restore-drive-ide0' (uses node
> 'a25d9b2028b5a364dddbb033603b68c' as 'intermediate node' child).
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
There will be no block node for 'none' after switching to '-blockdev'.
[FE: split out from larger patch
do it also for non-SCSI cases]
Co-developed-by: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
With blockdev-mirror, it is possible to change the aio setting on the
fly and this is useful for migrations between storages where one wants
to use io_uring by default and the other doesn't.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
The new helper will be used after the switch to blockdev starting with
machine version 10.0.
Co-developed-by: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
There is a slight change in behavior for cloud-init disks, when the
file for the new cloud-init disk is 'none'. Previously, the current
drive would not be ejected, now it is. Not sure if that edge case can
even happen in practice and it is more correct, becuase the config was
already updated.
Co-developed-by: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
With blockdev-mirror, it is possible to change the aio setting on the
fly and this is useful for migrations between storages where one wants
to use io_uring by default and the other doesn't.
The node below the top throttle node needs to be replaced so that the
limits stay intact and that the top node still has the drive ID as the
node name. That node is not necessarily a format node. For example, it
could also be a zeroinit node from an earlier mirror operation. So
query QEMU itself.
QEMU automatically drops nodes after mirror only if they were
implicitly added, i.e. not explicitly added via blockdev-add. Since a
previous mirror target is explicitly added (and not just implicitly as
the child of a top throttle node), it is necessary to detach the
appropriate block node after mirror.
Already mock blockdev_mirror in the tests.
Co-developed-by: Alexandre Derumier <alexandre.derumier@groupe-cyllene.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
In preparation for blockdev-mirror, where the node that is not used
anymore (either source when switching to target, or otherwise target)
needs to be detached.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
Callers outside the module should only use generate_drive_blockdev()
and specific functionality should be controlled via the $options
parameter.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
The zeroinit filter is used for cloning/mirroring and importing with
target volumes that are known to produce zeros when reading parts that
were not written before and can be helpful for performance.
Since it is the target of the mirror, it won't have a 'throttle' node
associated with it, but be added as a top node itself. Therefore, it
requires an explicit node-name.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This also works for -blockdev, which will be used instead of -drive
starting with machine version 10.0.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
When querying the block info, with -blockdev, it is necessary to look
at the 'qdev' property of the QMP result, because the 'device'
property is not initialized. See also commit 9af3ef69 ("vm devices
list: prepare querying block device names for -blockdev").
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
To be re-used by users of the query-block QMP command. With -blockdev,
the 'device' property is not initialized. See also commit 9af3ef69
("vm devices list: prepare querying block device names for -blockdev")
for context.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
The function is called 'get_scsi_device_type' and all callers already
use the full package prefix to call it.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>