From: Fiona Ebner <f.ebner@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH qemu-server 2/2] migration: local volume: activate for querying the size (required for qcow2 on LVM)
Date: Mon, 1 Jun 2026 16:55:02 +0200 [thread overview]
Message-ID: <20260601145528.285536-3-f.ebner@proxmox.com> (raw)
In-Reply-To: <20260601145528.285536-1-f.ebner@proxmox.com>
For qcow2 on LVM, it is necessary that the volumes are active to be
able to query the size. For offline migration, the volumes would be
activated later in storage_migrate() and for online migration, the
volumes are already active.
This makes an attempt to offline migrate a qcow2 on LVM volume
correctly fail with an error about lacking support, rather than an
error about not being to determine the size. See also commit
"migration: abort early when size or format cannot be determined" for
context.
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
---
src/PVE/QemuMigrate.pm | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/PVE/QemuMigrate.pm b/src/PVE/QemuMigrate.pm
index 6b563343..8da6f15d 100644
--- a/src/PVE/QemuMigrate.pm
+++ b/src/PVE/QemuMigrate.pm
@@ -449,6 +449,8 @@ sub scan_local_volumes {
$local_volumes->{$volid}->{bwlimit} = $self->get_bwlimit($sid, $targetsid);
$local_volumes->{$volid}->{targetsid} = $targetsid;
+ # For some volumes, like qcow2 on LVM, it is necessary to activate to query the size.
+ PVE::Storage::activate_volumes($storecfg, [$volid]);
$local_volumes->{$volid}->@{qw(size format)} =
PVE::Storage::volume_size_info($storecfg, $volid);
die "unable to determine size for volume '$volid'\n"
--
2.47.3
prev parent reply other threads:[~2026-06-01 14:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-01 14:55 [PATCH-SERIES qemu-server 0/2] partially fix #7554: avoid incorrectly offline migrating qcow2 on LVM as raw Fiona Ebner
2026-06-01 14:55 ` [PATCH qemu-server 1/2] migration: local volume: abort early when size or format cannot be determined Fiona Ebner
2026-06-01 14:55 ` Fiona Ebner [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260601145528.285536-3-f.ebner@proxmox.com \
--to=f.ebner@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox