public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Dominik Csapak <d.csapak@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [PATCH pve-manager 2/2] ui: storage wizard: ignore disabled storages when reusing a target
Date: Thu, 26 Nov 2026 11:57:03 +0100	[thread overview]
Message-ID: <20261126105712.1420361-2-d.csapak@proxmox.com> (raw)
In-Reply-To: <20261126105712.1420361-1-d.csapak@proxmox.com>

A disabled storage that connects to the same target as an enabled one
blocked the reuse of the enabled one, although it does not actually use
it. Only consider disabled storages if no enabled one uses the target,
so that the setup still asks to enable such a storage first.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Reported-by: Mira Limbeck <m.limbeck@proxmox.com>
---
 www/manager6/storage/wizard/Target.js | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/www/manager6/storage/wizard/Target.js b/www/manager6/storage/wizard/Target.js
index 4143a44b..96b2aa8a 100644
--- a/www/manager6/storage/wizard/Target.js
+++ b/www/manager6/storage/wizard/Target.js
@@ -8,7 +8,8 @@ Ext.define('PVE.storage.wizard.Target', {
         let me = this;
         let target = me.down('field[name=target]').getValue();
         return me.storages?.find(
-            (entry) => entry.type === me.storageType && entry[me.targetKey] === target,
+            (entry) =>
+                entry.type === me.storageType && entry[me.targetKey] === target && !entry.disable,
         );
     },
 
@@ -26,9 +27,11 @@ Ext.define('PVE.storage.wizard.Target', {
         if (!users.length) {
             return undefined;
         }
-        let base = users[0];
+        let enabledUsers = users.filter((entry) => !entry.disable);
+        let relevantUsers = enabledUsers.length > 0 ? enabledUsers : users;
+        let base = relevantUsers[0];
         let format = (text, ...args) => Ext.String.format(text, ...args);
-        if (users.length !== 1) {
+        if (relevantUsers.length !== 1) {
             return format(
                 nvme
                     ? gettext(
@@ -37,7 +40,7 @@ Ext.define('PVE.storage.wizard.Target', {
                     : gettext(
                           'Storages {0} use this target. The setup can only reuse a target that one storage uses.',
                       ),
-                users.map((entry) => entry.storage).join(', '),
+                relevantUsers.map((entry) => entry.storage).join(', '),
             );
         } else if (base.type !== me.storageType) {
             return format(
-- 
2.47.3





      reply	other threads:[~2026-11-26 10:57 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-26 10:57 [PATCH pve-manager 1/2] ui: storage wizard: sort storages by id Dominik Csapak
2026-11-26 10:57 ` Dominik Csapak [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=20261126105712.1420361-2-d.csapak@proxmox.com \
    --to=d.csapak@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