public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Mira Limbeck <m.limbeck@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: Re: [PATCH v2 storage 12/15] iscsi: add support for non-persistent discovery
Date: Thu, 30 Apr 2026 19:38:30 +0200	[thread overview]
Message-ID: <d9778ab3-965e-41d9-805e-d8dacbec8234@proxmox.com> (raw)
In-Reply-To: <20260430173220.441001-13-m.limbeck@proxmox.com>

On 4/30/26 7:31 PM, Mira Limbeck wrote:
> When running a discovery to gather all targets and portals to configure
> mappings it is not necessary to modify the discovery db.
> 
> For multiple discovery portals it is also important to not stop early
> when a previous portal already returned targets and portals.
> 
> Signed-off-by: Mira Limbeck <m.limbeck@proxmox.com>
> ---
> 
>  src/PVE/Storage/ISCSIPlugin.pm | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/src/PVE/Storage/ISCSIPlugin.pm b/src/PVE/Storage/ISCSIPlugin.pm
> index 5b636a8..a95edf4 100644
> --- a/src/PVE/Storage/ISCSIPlugin.pm
> +++ b/src/PVE/Storage/ISCSIPlugin.pm
> @@ -200,7 +200,7 @@ sub iscsi_portals {
>  }
>  
>  sub iscsi_discovery {
> -    my ($target_in, $portals, $cache) = @_;
> +    my ($target_in, $portals, $cache, $update_db) = @_;
>  
>      assert_iscsi_support();
>  
> @@ -209,6 +209,7 @@ sub iscsi_discovery {
>          next if !iscsi_test_portal($target_in, $portal, $cache); # fixme: raise exception here?
>  
>          my $cmd = [$ISCSIADM, '--mode', 'discovery', '--type', 'sendtargets', '--portal', $portal];
> +        push $cmd->@*, '-o', 'nonpersistent' if !$update_db;
>          eval {
>              run_command(
>                  $cmd,
> @@ -226,7 +227,7 @@ sub iscsi_discovery {
>          };
>  
>          # In case of multipath we can stop after receiving targets from any available portal
> -        last if scalar(keys %$res) > 0;
> +        last if defined($target) && scalar(keys %$res) > 0;
>      }
>  
>      return $res;
This is missing a change to the iscsi_discovery call in
update_iscsi_discovery_db. There the iscsi_discovery call needs to be
changed to:
my $res = eval { iscsi_discovery($target, $portals, $cache, 1); };

adding the `1` at the end to make sure the discovery db is updated in
that case.

I'll fix that in a v3 next week.




  reply	other threads:[~2026-04-30 17:39 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-30 17:26 [PATCH v2 cluster/storage/manager 00/15] storage mapping Mira Limbeck
2026-04-30 17:26 ` [PATCH v2 cluster 01/15] mapping: add storage.cfg Mira Limbeck
2026-04-30 17:27 ` [PATCH v2 storage 02/15] mapping: add base plugin Mira Limbeck
2026-04-30 17:35   ` Mira Limbeck
2026-04-30 17:27 ` [PATCH v2 storage 03/15] mapping: add iSCSI plugin Mira Limbeck
2026-04-30 17:27 ` [PATCH v2 storage 04/15] iscsi: introduce mapping support Mira Limbeck
2026-04-30 17:27 ` [PATCH v2 storage 05/15] iscsi: add helper to get local config Mira Limbeck
2026-04-30 17:27 ` [PATCH v2 storage 06/15] iscsi: change functions to handle mappings Mira Limbeck
2026-04-30 17:27 ` [PATCH v2 storage 07/15] iscsi: introduce helper to update discovery db Mira Limbeck
2026-04-30 17:27 ` [PATCH v2 storage 08/15] iscsi: rework to update discovery db and simplify login Mira Limbeck
2026-04-30 17:27 ` [PATCH v2 storage 09/15] iscsi: remove stale sessions in non-mapping case Mira Limbeck
2026-04-30 17:27 ` [PATCH v2 storage 10/15] api: add mapping support Mira Limbeck
2026-04-30 17:27 ` [PATCH v2 storage 11/15] mapping: iscsi: add discovery-portal config option Mira Limbeck
2026-04-30 17:27 ` [PATCH v2 storage 12/15] iscsi: add support for non-persistent discovery Mira Limbeck
2026-04-30 17:38   ` Mira Limbeck [this message]
2026-04-30 17:27 ` [PATCH v2 storage 13/15] api: add non-persistent iscsi discovery option Mira Limbeck
2026-04-30 17:27 ` [POC v2 storage 14/15] mapping: add zfspool plugin Mira Limbeck
2026-04-30 17:27 ` [PATCH v2 manager 15/15] api: mapping: add storage mapping path Mira Limbeck

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=d9778ab3-965e-41d9-805e-d8dacbec8234@proxmox.com \
    --to=m.limbeck@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
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal