]> git.proxmox.com Git - pve-storage.git/commit - PVE/Diskmanage.pm
fix #2777 create zpools with stable dev paths
authorStoiko Ivanov <s.ivanov@proxmox.com>
Fri, 5 Jun 2020 13:24:56 +0000 (15:24 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Sat, 6 Jun 2020 17:32:33 +0000 (19:32 +0200)
commit0f0d99a3e5ba428f2a54ba9610dc0db3cd7d0ff8
tree0efe10ad17a18e894345600d8047419390087117
parent8b4c2a7ec60dad09eb8ffc7eaf64881612a95efc
fix #2777 create zpools with stable dev paths

when compiling the disk list add a property with a stable
/dev/disk/by-id/ path for a block device when available.

This is needed to create zpools with the stable by-id links

The /dev/disk/by-id/ directory can contain multiple links to the same device
(e.g. when it's used as a LVM PV, or one for the wwn/nvme-eui in addition
to the one with vendor and serial). We take the first one which matches
the bus where the disk is attached. For nvme disks we exclude the one
containing the nvme-eui.

The patch assumes that not all disks need to have such a link (e.g.
virtio-block devices as we pass them to guests).

Additionally the tests were adapted to run successfully.

Signed-off-by: Stoiko Ivanov <s.ivanov@proxmox.com>
PVE/API2/Disks/ZFS.pm
PVE/Diskmanage.pm
test/disk_tests/sas/disklist_expected.json