From: Daniel Herzig <d.herzig@proxmox.com>
To: "Daniel Kral" <d.kral@proxmox.com>
Cc: pve-devel@lists.proxmox.com
Subject: Re: [PATCH qemu-server] fix #7786: migrate: deactivate shared storage volumes of offline VMs
Date: Thu, 09 Jul 2026 15:30:30 +0200 [thread overview]
Message-ID: <87tsq8z3wp.fsf@proxmox.com> (raw)
In-Reply-To: <DJU0AT5RY86Q.2WOYRYI2SOJ4C@proxmox.com>
Thanks for looking into this!
"Daniel Kral" <d.kral@proxmox.com> writes:
>> @@ -846,6 +866,13 @@ sub phase1 {
>> $self->handle_replication($vmid);
>>
>> $self->sync_offline_local_volumes();
>> +
>> + # make sure that volumes of non-running VMs on shared storage
>> + # are deactivated.
>> + if (! $self->{running}) {
>> + $self->deactivate_volumes_on_shared_storage();
>> + }
>
> As discussed off-list, I wonder whether this can be a
>
> if (!$self->{running}) {
> my $vollist = PVE::QemuServer::get_vm_volumes($conf);
> PVE::Storage::deactivate_volumes($self->{storecfg}, $vollist);
> }
>
> Just to be sure that there are no active volumes in the case of a
> offline migration.
>
I guess a call to `deactivate_volumes` without restricting to shared
storage (as in `deactivate_volumes_on_shared_storage()`) would also
do. But in such a case we won't have complications anyway, as
`sync_offline_local_volumes` is taking care of these with its own
call to `deactivate_volumes` in the end.
I'm not against shortening down the code (will see what I can
do) -- but I'd like to keep the `eval->error->log` sequence and not
bloat `phase1` at the same time, as it's such a lean sub.
> I wonder whether there are any assumptions in later migration steps
> where this might break something that I'm not aware of?
I'll double-check, but for now I think the issue is, that we
currently don't do anything with the activation state in case of an
offline migration on shared storage. Clearly the `if (!self->{running})`
check is important, as it would cause issues with online-migrations,
where volume deactivation is handled in a dedicated step.
>
>> +
>> $self->phase1_remote($vmid) if $self->{opts}->{remote};
>> }
>>
next prev parent reply other threads:[~2026-07-09 13:31 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-08 7:31 [PATCH qemu-server] fix #7786: migrate: deactivate shared storage volumes of offline VMs Daniel Herzig
2026-07-09 11:33 ` Daniel Kral
2026-07-09 13:30 ` Daniel Herzig [this message]
2026-07-09 14:20 ` Daniel Kral
2026-07-09 14:54 ` Daniel Herzig
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=87tsq8z3wp.fsf@proxmox.com \
--to=d.herzig@proxmox.com \
--cc=d.kral@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