Hi, i’m trying to run a zfs storage pool on block device exported over iscsi with multipath enabled.
At boot, zfs-import-cache service fails, obviously because the iscsi link is not ready.
After boot is complete, i can manually import the pool fine.
at shutdown/reboot, there are some errors shown in logs below, and finally the system fails to poweoff, with error message shown in spice screenshot.
This is a test VM with a test zfs pool, so no risk of dataloss. I wanted to ask for tips/advice on doing this the right way:
The setup is as follows:
the block device is exported using targetcli as follows:
o- / ......................................................................................................................... [...]
o- backstores .............................................................................................................. [...]
| o- block .................................................................................................. [Storage Objects: 3]
…
| | o- k8p-clone-storage ...................................... [/dev/zvol/rpool/k8p-clone-storage (10.0GiB) write-thru activated]
| | o- alua ................................................................................................... [ALUA Groups: 1]
| | o- default_tg_pt_gp ....................................................................... [ALUA state: Active/optimized]
…
| o- iqn.2005-01.env.pve.pve2.iscsi:k8p-clone .......................................................................... [TPGs: 1]
| o- tpg1 .......................................................................................... [no-gen-acls, auth per-acl]
| o- acls .......................................................................................................... [ACLs: 1]
| | o- iqn.1994-05.com.redhat:bbd7d03ff410 ...................................................... [1-way auth, Mapped LUNs: 1]
| | o- mapped_lun0 ..................................................................... [lun0 block/k8p-clone-storage (rw)]
| o- luns .......................................................................................................... [LUNs: 1]
| | o- lun0 ................................. [block/k8p-clone-storage (/dev/zvol/rpool/k8p-clone-storage) (default_tg_pt_gp)]
| o- portals .................................................................................................... [Portals: 2]
| o- 10.0.0.240:3260 .................................................................................................. [OK]
| o- 192.168.2.240:3260 ............................................................................................... [OK]
link is up and running:
# multipathd show maps topology
storage (360014054244e8dce0484ffc98805292a) dm-1 LIO-ORG,k8p-clone-stora
size=10G features='1 queue_if_no_path' hwhandler='1 alua' wp=rw
`-+- policy='service-time 0' prio=50 status=enabled
|- 7:0:0:0 sdb 8:16 active ready running
`- 8:0:0:0 sdc 8:32 active ready running
# cat /etc/multipath.conf
defaults {
verbosity 2
polling_interval 5
max_polling_interval 20
reassign_maps "no"
path_selector "service-time 0"
path_grouping_policy "failover"
uid_attribute "ID_SERIAL"
prio "const"
prio_args ""
features "0"
path_checker "tur"
alias_prefix "mpath"
failback "manual"
rr_min_io 1000
rr_min_io_rq 1
max_fds "max"
rr_weight "uniform"
queue_without_daemon "no"
allow_usb_devices "no"
flush_on_last_del "unused"
user_friendly_names "no"
fast_io_fail_tmo 5
log_checker_err "always"
all_tg_pt "no"
retain_attached_hw_handler "yes"
detect_prio "yes"
detect_checker "yes"
detect_pgpolicy "yes"
detect_pgpolicy_use_tpg "no"
force_sync "no"
strict_timing "no"
deferred_remove "no"
delay_watch_checks "no"
delay_wait_checks "no"
san_path_err_threshold "no"
san_path_err_forget_rate "no"
san_path_err_recovery_time "no"
marginal_path_err_sample_time "no"
marginal_path_err_rate_threshold "no"
marginal_path_err_recheck_gap_time "no"
marginal_path_double_failed_time "no"
find_multipaths "off"
uxsock_timeout 4000
retrigger_tries 3
retrigger_delay 10
missing_uev_wait_timeout 30
skip_kpartx "no"
remove_retries 0
ghost_delay "no"
auto_resize "never"
find_multipaths_timeout -10
enable_foreign "NONE"
marginal_pathgroups "off"
recheck_wwid "no"
}
blacklist {
devnode "!^(sd[a-z]|dasd[a-z]|nvme[0-9])"
device {
vendor "SGI"
product "Universal Xport"
}
device {
vendor "^DGC"
product "LUNZ"
}
device {
vendor "EMC"
product "LUNZ"
}
device {
vendor "DELL"
product "Universal Xport"
}
device {
vendor "FUJITSU"
product "Universal Xport"
}
device {
vendor "IBM"
product "Universal Xport"
}
device {
vendor "IBM"
product "S/390"
}
device {
vendor "LENOVO"
product "Universal Xport"
}
device {
vendor "(NETAPP|LSI|ENGENIO)"
product "Universal Xport"
}
device {
vendor "STK"
product "Universal Xport"
}
device {
vendor "SUN"
product "Universal Xport"
}
device {
vendor "(Intel|INTEL)"
product "VTrak V-LUN"
}
device {
vendor "Promise"
product "VTrak V-LUN"
}
device {
vendor "Promise"
product "Vess V-LUN"
}
}
blacklist_exceptions {
wwid "360014054244e8dce0484ffc98805292a"
}
devices {
device {
vendor "(LIO-ORG|SUSE)"
product ".*"
path_grouping_policy "group_by_prio"
path_checker "directio"
hardware_handler "1 alua"
prio "alua"
failback "immediate"
no_path_retry 12
detect_checker "no"
}
}
overrides {
}
multipaths {
multipath {
wwid "360014054244e8dce0484ffc98805292a"
alias "storage"
}
}
# ls -la /dev/disk/by-id/ | grep dm-1
lrwxrwxrwx. 1 root root 10 Sep 18 07:59 dm-name-storage -> ../../dm-1
lrwxrwxrwx. 1 root root 10 Sep 18 07:59 dm-uuid-mpath-360014054244e8dce0484ffc98805292a -> ../../dm-1
lrwxrwxrwx. 1 root root 10 Sep 18 07:59 scsi-360014054244e8dce0484ffc98805292a -> ../../dm-1
lrwxrwxrwx. 1 root root 10 Sep 18 07:59 wwn-0x60014054244e8dce0484ffc98805292a -> ../../dm-1
after boot, i can import pool fine:
# zpool import storage
# zpool list
NAME SIZE ALLOC FREE CKPOINT EXPANDSZ FRAG CAP DEDUP HEALTH ALTROOT
storage 9.50G 1.13M 9.50G - - 1% 0% 1.00x ONLINE -
zroot 97.5G 6.91G 90.6G - - 19% 7% 1.00x ONLINE -
# zpool status storage
pool: storage
state: ONLINE
status: One or more devices are configured to use a non-native block size.
Expect reduced performance.
action: Replace affected devices with devices that support the
configured block size, or migrate data to a properly configured
pool.
config:
NAME STATE READ WRITE CKSUM
storage ONLINE 0 0 0
wwn-0x60014054244e8dce0484ffc98805292a ONLINE 0 0 0 block size: 4096B configured, 16384B native
relevant log entries from boot:
Sep 17 18:20:02 k8p-clone multipathd[1020]: libmp_mapinfo: map 0QEMU_QEMU_HARDDISK_drive-scsi0 doesn't exist
Sep 17 18:20:02 k8p-clone multipathd[1020]: sda: setting scsi timeouts is unsupported for protocol scsi:unspec
Sep 17 18:20:02 k8p-clone multipathd[1020]: libmp_mapinfo: map 0QEMU_QEMU_HARDDISK_drive-scsi0 doesn't exist
Sep 17 18:20:02 k8p-clone multipathd[1020]: 0QEMU_QEMU_HARDDISK_drive-scsi0: addmap [0 209715200 multipath 0 0 1 1 service-time 0 1 1 8:0 1]
Sep 17 18:20:02 k8p-clone kernel: Adding 8388604k swap on /dev/zram0. Priority:100 extents:1 across:8388604k SSDsc
Sep 17 18:20:02 k8p-clone systemd[1]: Activated swap dev-zram0.swap - Compressed Swap on /dev/zram0.
Sep 17 18:20:02 k8p-clone systemd[1]: Reached target swap.target - Swaps.
Sep 17 18:20:02 k8p-clone multipathd[1020]: libdevmapper: ioctl/libdm-iface.c(1995): device-mapper: reload ioctl on 0QEMU_QEMU_HARDDISK_drive-scsi0 (252:>
Sep 17 18:20:02 k8p-clone kernel: device-mapper: multipath service-time: version 0.3.0 loaded
Sep 17 18:20:02 k8p-clone kernel: device-mapper: table: 252:0: multipath: error getting device (-EBUSY)
Sep 17 18:20:02 k8p-clone kernel: device-mapper: ioctl: error adding target to table
Sep 17 18:20:02 k8p-clone multipathd[1020]: dm_addmap: libdm task=0 error: Device or resource busy
Sep 17 18:20:02 k8p-clone multipathd[1020]: libmp_mapinfo: map 0QEMU_QEMU_HARDDISK_drive-scsi0 doesn't exist
Sep 17 18:20:02 k8p-clone multipathd[1020]: 0QEMU_QEMU_HARDDISK_drive-scsi0: failed in domap for addition of new path sda
Sep 17 18:20:02 k8p-clone multipathd[1020]: uevent trigger error
Sep 17 18:20:32 k8p-clone systemd[1]: Starting zfs-import-cache.service - Import ZFS pools by cache file...
Sep 17 18:20:32 k8p-clone (zpool)[1471]: zfs-import-cache.service: Referenced but unset environment variable evaluates to an empty string: ZPOOL_IMPORT_O>
[...]
Sep 17 18:20:34 k8p-clone zpool[1471]: cannot import 'storage': no such pool or dataset
Sep 17 18:20:34 k8p-clone zpool[1471]: cannot import '(null)': no such pool available
Sep 17 18:20:34 k8p-clone zpool[1471]: Destroy and re-create the pool from
Sep 17 18:20:34 k8p-clone zpool[1471]: a backup source.
Sep 17 18:20:34 k8p-clone zpool[1471]: cachefile import failed, retrying
Sep 17 18:20:34 k8p-clone systemd[1]: zfs-import-cache.service: Main process exited, code=exited, status=1/FAILURE
Sep 17 18:20:34 k8p-clone systemd[1]: zfs-import-cache.service: Failed with result 'exit-code'.
Sep 17 18:20:34 k8p-clone systemd[1]: Failed to start zfs-import-cache.service - Import ZFS pools by cache file.
relevant log entry from shutdown:
Sep 17 18:26:59 k8p-clone systemd[1]: Stopping multipathd.service - Device-Mapper Multipath Device Controller...
Sep 17 18:26:59 k8p-clone multipathd[1020]: multipathd: shut down
Sep 17 18:26:59 k8p-clone systemd[1]: Stopping lvm2-monitor.service - Monitoring of LVM2 mirrors, snapshots etc. using dmeventd or progress polling...
Sep 17 18:26:59 k8p-clone systemd[1]: systemd-tmpfiles-setup-dev.service: Deactivated successfully.
Sep 17 18:26:59 k8p-clone systemd[1]: Stopped systemd-tmpfiles-setup-dev.service - Create Static Device Nodes in /dev.
Sep 17 18:26:59 k8p-clone audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-tmpfiles-s>
Sep 17 18:26:59 k8p-clone systemd[1]: systemd-tmpfiles-setup-dev-early.service: Deactivated successfully.
Sep 17 18:26:59 k8p-clone systemd[1]: Stopped systemd-tmpfiles-setup-dev-early.service - Create Static Device Nodes in /dev gracefully.
Sep 17 18:26:59 k8p-clone audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=systemd-tmpfiles-s>
Sep 17 18:26:59 k8p-clone kernel: audit: type=1131 audit(1758122819.348:392): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0>
Sep 17 18:26:59 k8p-clone kernel: audit: type=1131 audit(1758122819.348:393): pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0>
Sep 17 18:26:59 k8p-clone kernel: I/O error, dev dm-1, sector 0 op 0x0:(READ) flags 0x0 phys_seg 32 prio class 0
Sep 17 18:26:59 k8p-clone systemd[1]: multipathd.service: Deactivated successfully.
Sep 17 18:26:59 k8p-clone systemd[1]: Stopped multipathd.service - Device-Mapper Multipath Device Controller.
results in hanged system:
specifically calling on @glb for this, as he is very knowledgeable about these things.
Few notes:
i don’t know if i should configure zfs vdev stuff for this:
# ls -la /etc/zfs/vdev_id.conf*
-rw-r--r--. 1 root root 165 Jun 19 19:31 /etc/zfs/vdev_id.conf.alias.example
-rw-r--r--. 1 root root 166 Jun 19 19:31 /etc/zfs/vdev_id.conf.multipath.example
-rw-r--r--. 1 root root 616 Jun 19 19:31 /etc/zfs/vdev_id.conf.sas_direct.example
-rw-r--r--. 1 root root 152 Jun 19 19:31 /etc/zfs/vdev_id.conf.sas_switch.example
-rw-r--r--. 1 root root 254 Jun 19 19:31 /etc/zfs/vdev_id.conf.scsi.example
as documented here:
https://openzfs.github.io/openzfs-docs/man/master/5/vdev_id.conf.5.html
some references i found:
https://github.com/openzfs/zfs/issues/15929
https://github.com/openzfs/zfs/issues/3918
Thanks for any tips/insight!
