OpenMediaVault-Plugin-Developers / openmediavault-zfs

OpenMediaVault plugin for zfs
74 stars 15 forks source link

It's impossible to create a pool using an encrypted device with "by-id" aliasing #52

Closed mdziekon closed 6 years ago

mdziekon commented 6 years ago

Tested using:

Consider the following scenario:

  1. You have an encrypted device (eg. using LUKS), assigned to /dev/dm-0 device
  2. Try to create a zpool using this device (a basic pool will be fine), and use the "by-id" dev aliasing
  3. Because OMVModuleZFSUtil::getDiskId does not recognise dashes in device name regexp, it fails to properly detect the aliasing (another problem related to this detection behaviour described here: https://github.com/OpenMediaVault-Plugin-Developers/openmediavault-zfs/issues/51)
  4. Pool creation fails because it was not able to properly find the device

Expected behaviour:

subzero79 commented 6 years ago

I think this was a problem of regex. If I am not mistaken I had the fix in one branch in one of my dev vm, got left behind and didn’t push the fix. Won’t be for another 3 weeks until I get back from holidays.

mdziekon commented 6 years ago

I think this was a problem of regex. If I am not mistaken I had the fix in one branch in one of my dev vm, got left behind and didn’t push the fix. Won’t be for another 3 weeks until I get back from holidays.

Yes, it is a problem with the name discovery regexp, as I've already described in point 3. The fix is pretty straightforward (simply, allowing dashes in the dev name), so I can submit a PR myself if that's OK (considering that there is a patch somewhere waiting to be pushed).

subzero79 commented 6 years ago

Sorry I read too quickly, you’re correct you mentioned the regex. I am ok if you submit the pr, if you look at omvextras github activity you will notice we are very low on dev resources. More than welcome if you want to submit pr’s to fix bugs or add features.