]> git.proxmox.com Git - pve-installer.git/commitdiff
fix behavior if zfs disks have no by-id path
authorAaron Lauterer <a.lauterer@proxmox.com>
Mon, 24 Feb 2020 08:37:23 +0000 (09:37 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 4 Mar 2020 14:26:43 +0000 (15:26 +0100)
in some situations it is possible, that a disk does not have a
/dev/disk/by-id path. Reported cases are KVM with virtio-blk [0] and
with VMware player / workstation when using the paravirtual SCSI disk
types [1]. It can be reproduced in Proxmox VE by using virtio-blk disks
for the VM.

> The issue at hand happens because udev does not create the
> /dev/disk/by-id symlink in
> '/lib/udev/rules.d/60-persistent-storage.rules', since it does
> not have a serial-number for the device (which in the virtio-blk case
> is in turn maybe caused by qemu-server not adding one to the
> commandline).
Quoted from [2]

This regression was introduced with commit
e1b490865f750e08f6c9c6b7e162e7def9dcc411 which always replaced the disks
in the $vdev variable even if the result of the by-id lookup was
`undef`. Thus the paths did not point to any valid disk and the zpool
creation failed.

This patch replaces the disk paths with by-id paths only if they are
present.

[0] https://forum.proxmox.com/threads/installation-on-raidz-1-fails.65603/
[1] https://forum.proxmox.com/threads/not-install-promox-6-1-zfs-0-04-disk-vmware-15-pro.65269/
[2] https://pve.proxmox.com/pipermail/pve-devel/2020-February/041841.html

Signed-off-by: Aaron Lauterer <a.lauterer@proxmox.com>
proxinstall

index bad877f5afd434ed4982292307349f23b7461afb..e9dd50a3f90aa09724f8a9afc6d784252875df49 100755 (executable)
@@ -1359,7 +1359,7 @@ sub extract_data {
                my $devname = @$hd[1];
                my $by_id = find_stable_path ("/dev/disk/by-id", $devname);
 
-               $vdev =~ s/ $devname/ $by_id/;
+               $vdev =~ s/ $devname/ $by_id/ if $by_id;
            }
 
            zfs_create_rpool($vdev);