From: "Lukas Sichert" <l.sichert@proxmox.com>
To: "Friedrich Weber" <f.weber@proxmox.com>, <pve-devel@lists.proxmox.com>
Subject: Re: [PATCH storage v3 1/2] fix #7339: lvmthick: add worker to free space of to be deleted VMs
Date: Wed, 06 May 2026 11:59:37 +0200 [thread overview]
Message-ID: <DIBI84269L7Y.YERWCXP60RD@proxmox.com> (raw)
In-Reply-To: <24d217bf-5b9f-48d2-8754-9614bbbc5484@proxmox.com>
On 2026-05-05 17:59, Friedrich Weber <f.weber@proxmox.com> wrote:
>> diff --git a/src/PVE/Storage.pm b/src/PVE/Storage.pm
>> index 6e87bac..ef1596f 100755
>> --- a/src/PVE/Storage.pm
>> +++ b/src/PVE/Storage.pm
>> @@ -1192,7 +1192,7 @@ sub vdisk_free {
>>
>> activate_storage($cfg, $storeid);
>>
>> - my $cleanup_worker;
>> + my $discard_worker;
>>
>> # lock shared storage
>> $plugin->cluster_lock_storage(
>> @@ -1206,16 +1206,24 @@ sub vdisk_free {
>>
>> my (undef, undef, undef, undef, undef, $isBase, $format) =
>> $plugin->parse_volname($volname);
>> - $cleanup_worker = $plugin->free_image($storeid, $scfg, $volname, $isBase, $format);
>> + $discard_worker = $plugin->free_image($storeid, $scfg, $volname, $isBase, $format);
>> },
>> );
>>
>> - return if !$cleanup_worker;
>> + return if !$discard_worker;
>>
>> my $rpcenv = PVE::RPCEnvironment::get();
>> my $authuser = $rpcenv->get_user();
>>
>> - $rpcenv->fork_worker('imgdel', undef, $authuser, $cleanup_worker);
>> + if ($scfg->{saferemove} && $scfg->{'issue-blkdiscard'}) {
>> + $rpcenv->fork_worker('diskzerodiscard', undef, $authuser, $discard_worker);
>> + } elsif ($scfg->{saferemove}) {
>> + $rpcenv->fork_worker('diskzero', undef, $authuser, $discard_worker);
>> + } elsif ($scfg->{'issue-blkdiscard'}) {
>> + $rpcenv->fork_worker('diskdiscard', undef, $authuser, $discard_worker);
>> + } else {
>> + $rpcenv->fork_worker('imgdel', undef, $authuser, $discard_worker);
>> + }
>> }
>
> Is this change necessary? To me it seems like the fairly general
> PVE::Storage::vdisk_free shouldn't check for plugin-specific config
> options (like saferemove/issue-blkdiscard) -- in a way, it breaks the
> abstraction provided by PVE::Storage. Wouldn't it be nicer to keep
> PVE::Storage::vdisk_free as-is, have it spawn the dedicated 'imgdel'
> task, and the 'imgdel' task returned by the LVM plugin then
> zeroouts+discards/only-zeroouts/only-discards depending on the LVM
> storage settings?
This patch is there to improve the worker description displayed in the
task log. An 'imgdel' worker is currently displayed as an 'Erase data'
task. This can be misleading if 'saferemove' is not enabled, as no data
is actually erased. With these changes, the description for
'saferemove' enabled becomes 'Zero out disk', for 'issue-blkdiscard'
enabled it becomes 'Discard disk', and for both enabled it becomes
'Zero out and discard disk'.
That said, this is also suboptimal because if other plugins return
worker tasks from their '$free_image' implementations, then their
descriptions could also be altered if these flags are set. In the
default Proxmox stack this is currently not the case, but it could
affect external plugins.
Another option would be to rename the displayed name for an 'imgdel'
task in the UI to 'Destroy image'. That would fit the generic worker
task better and would also make the naming consistent with
'unknownimgdel', which is currently displayed as
'Destroy image from unknown guest'.
Does anybody have opinions on how to go forward with this?
Thanks in advance!
next prev parent reply other threads:[~2026-05-06 10:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-23 14:47 [PATCH manager/storage v3 0/2] fix #7339: lvmthick: add option to free storage for deleted VMs Lukas Sichert
2026-04-23 14:47 ` [PATCH storage v3 1/2] fix #7339: lvmthick: add worker to free space of to be " Lukas Sichert
2026-05-05 15:59 ` Friedrich Weber
2026-05-06 9:59 ` Lukas Sichert [this message]
2026-05-06 10:11 ` Friedrich Weber
2026-05-07 9:47 ` Thomas Lamprecht
2026-04-23 14:47 ` [PATCH manager v3 2/2] fix #7339: lvmthick: ui: add UI fields for option to free storage Lukas Sichert
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=DIBI84269L7Y.YERWCXP60RD@proxmox.com \
--to=l.sichert@proxmox.com \
--cc=f.weber@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