Page 1 of 1

Testing openzfs-2.1.x - No /var/run/zfs/zvol links

PostPosted: Thu Feb 17, 2022 11:39 am
by Eladio
Hi all,
Just upgrade to 2.1.x on Monterey, an encrypted volume from pool did not get created a device link at /var/run/zfs/zvol/dsk.
The device at /dev is created and is usable.
I use those links for vmware vmdk 's, so I don't have to rename devices in those files each host reboot.

Re: Testing openzfs-2.1.x - No /var/run/zfs/zvol links

PostPosted: Sun Feb 20, 2022 8:34 pm
by lundman
That would suggest InvariantDisks is not running. You might need to check why, there was a situation where it would not start InvariantDisks from the installer (but it would start next reboot\).

Re: Testing openzfs-2.1.x - No /var/run/zfs/zvol links

PostPosted: Mon Feb 21, 2022 8:43 am
by Eladio
lundman wrote:That would suggest InvariantDisks is not running. You might need to check why, there was a situation where it would not start InvariantDisks from the installer (but it would start next reboot\).

Hi lundman, thanks for your work!
- A reboot or two did not solve the problem, /var/run/zfs/zvol/{dsk,rdsk} were not populated with links, they are empty.
- InvariantDisks *did* populate /var/run/disk/by-id/ with links to volumes inside a disk, but not the whole disk. I mean, a zvol /dev/disk3 with 2 partitions get links for disk3s1 and disk3s2; but disk3 is not linked.
Thanks!

Re: Testing openzfs-2.1.x - No /var/run/zfs/zvol links

PostPosted: Mon Feb 21, 2022 8:30 pm
by lundman
Why would you want a link for disk3?

Re: Testing openzfs-2.1.x - No /var/run/zfs/zvol links

PostPosted: Wed Feb 23, 2022 7:37 am
by Eladio
Well, If you want to provide hundreds of VMs cloning a base zvol, the hypervisor needs the whole disk to start and boot OSes. Version 2.1.0 create links whit whole path name of each zvol clon (e.g. /var/run/zfs/zvol/dsk/hv1/ubuntu/20.4/dsk001). This is very convenient for managing disks. Disk-by-id is a problem for me, because I can not distinguish one clon from other, or even if they had differents UUIDs i can not get a relation betwwen a zvol clon and a /dev/diskXXX easily.

Re: Testing openzfs-2.1.x - No /var/run/zfs/zvol links

PostPosted: Mon Feb 28, 2022 12:08 am
by cbreak
I don't think InvariantDisks is involved in this, the tool doesn't know about zfs specifically, and just creates symlinks inside `/var/run/disks/by-xxx` based on what DiskArbitration tells it about.

Did you unlock the encryption root for the volumes? Did you mount all the parents of the volumes?

Re: Testing openzfs-2.1.x - No /var/run/zfs/zvol links

PostPosted: Tue Mar 01, 2022 5:02 am
by Eladio
cbreak wrote:I don't think InvariantDisks is involved in this, the tool doesn't know about zfs specifically, and just creates symlinks inside `/var/run/disks/by-xxx` based on what DiskArbitration tells it about.

Did you unlock the encryption root for the volumes? Did you mount all the parents of the volumes?

Yes to all... All devices are created, but no links on /var/run/zfs/zvol. Note that this dir is different from /var/run/disks/by-xxx.
Old version did create /var/run/zfs/zvol/dsk/<pool_name>/<zvol_name> links.

Re: Testing openzfs-2.1.x - No /var/run/zfs/zvol links

PostPosted: Sun Mar 20, 2022 5:18 pm
by lundman
Ooh riight, yes, "zed" used to create symlinks for zvols! Hmm wonder if that was missed somehow. Can you see if the zvol create-link-event is sent by the kernel? You can run "zpool events -f" and see if those events are reported.

Re: Testing openzfs-2.1.x - No /var/run/zfs/zvol links

PostPosted: Wed Mar 23, 2022 9:23 am
by Eladio
lundman wrote:Ooh riight, yes, "zed" used to create symlinks for zvols! Hmm wonder if that was missed somehow. Can you see if the zvol create-link-event is sent by the kernel? You can run "zpool events -f" and see if those events are reported.


Nope, that event is not triggered: Import a pool with not encrypted zvol in it:
Code: Select all
Mar 23 2022 18:19:59.687064112 sysevent.fs.zfs.history_event
Mar 23 2022 18:19:59.739508050 sysevent.fs.zfs.config_sync
Mar 23 2022 18:19:59.739530860 sysevent.fs.zfs.pool_import
Mar 23 2022 18:19:59.740899877 sysevent.fs.zfs.history_event
Mar 23 2022 18:19:59.767504691 sysevent.fs.zfs.config_sync
Mar 23 2022 18:19:59.811686606 resource.fs.zfs.zvol_create


And exported:
Code: Select all
Mar 23 2022 18:20:15.936935897 resource.fs.zfs.zvol_remove
Mar 23 2022 18:20:15.951036001 sysevent.fs.zfs.pool_export
Mar 23 2022 18:20:16.021543642 sysevent.fs.zfs.config_sync