]> git.proxmox.com Git - pve-storage.git/commit - PVE/API2/Storage/Config.pm
disks: allow add_storage for already configured local storage
authorAaron Lauterer <a.lauterer@proxmox.com>
Fri, 19 Aug 2022 15:01:21 +0000 (17:01 +0200)
committerFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 13 Sep 2022 08:05:20 +0000 (10:05 +0200)
commitbd485fd4aa02f8d1b45c5f8c78bd096754131aab
tree57eaa09f282d97fca188ac61bf8cfd38da7019c2
parent55553bd4322bef1966d6822aaec96e4321ee77bc
disks: allow add_storage for already configured local storage

One of the smaller annoyances, especially for less experienced users, is
the fact, that when creating a local storage (ZFS, LVM (thin), dir) in a
cluster, one can only leave the "Add Storage" option enabled the first
time.

On any following node, this option needed to be disabled and the new
node manually added to the list of nodes for that storage.

This patch changes the behavior. If a storage of the same name already
exists, it will verify that necessary parameters match the already
existing one.
Then, if the 'nodes' parameter is set, it adds the current node and
updates the storage config.
In case there is no nodes list, nothing else needs to be done, and the
GUI will stop showing the question mark for the configured, but until
then, not existing local storage.

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
Reviewed-by: Dominik Csapak <d.csapak@proxmox.com>
Tested-by: Dominik Csapak <d.csapak@proxmox.com>
PVE/API2/Disks/Directory.pm
PVE/API2/Disks/LVM.pm
PVE/API2/Disks/LVMThin.pm
PVE/API2/Disks/ZFS.pm
PVE/API2/Storage/Config.pm