can zfs snapshot be used to back LUN in ctl.conf ?

Willem Jan Withagen wjw at digiware.nl
Sun Sep 6 14:36:20 UTC 2015


On 27-8-2015 14:00, Zeus Panchenko wrote:
> greetings,
> 
> please help me to understand where to look at ...
> 
> recently I switched from istgt to ctld and now wonder, whether can zfs
> snapshot be used to back the LUN for ctld?
> 
> istgt do allows that, while ctld fails to start and complains
> 
> but if I copy the file from zfs snapshot to some place, then ctld starts
> as expected ...

As far as I know those snapshots are read-only.

So other that mount and use for reading backup stuff it does not really
serve a purpose? And than still you'd next a "consistent" fs on the
volume to do any useful work. So that would only work for filesystems
that need a recover that does not involve writing to the volume.
Otherwise if you force mount something like UFS, you run the risk of
crashes?

So unless you promote a the volume to writable things will not work.
For files as backing volume that happens if you copy it to a writeable
location, or clone the volume the file is on. If you are using ZVOL,
than you have to clone snapshot.

So I'm not sure if ctld aborts because it tests writing the backing
storage and fails if it cannot.

--WjW
> 
> 
> bellow the details are:
> 
> ---[ ctld debug quotation start ]-------------------------------------------
> ...
> ctld: adding lun 0, target iqn.2007-09.jp.ne.peach.istgt:file011
> ctld: adding lun 0, target iqn.2007-09.jp.ne.peach.istgt:file012
> ctld: error returned from LUN creation request: ctl_be_block_open: error opening /storage/win/.zfs/snapshot/daily-2015-08-22/file013
> ctld: failed to add lun 0, target iqn.2007-09.jp.ne.peach.istgt:file013
> ctld: adding lun 0, target iqn.2007-09.jp.ne.peach.istgt:file014
> ctld: adding lun 0, target iqn.2007-09.jp.ne.peach.istgt:file015
> ...
> ctld: adding lun 0, target iqn.2007-09.jp.ne.peach.istgt:file052
> ctld: adding lun 0, target iqn.2007-09.jp.ne.peach.istgt:file053
> ctld: not listening on portal-group "default", not assigned to any target
> ctld: listening on 10.100.21.47, portal-group "alfa"
> ctld: listening on 10.100.21.47, portal-group "beta"
> ctld: failed to apply configuration; exiting
> /etc/rc.d/ctld: WARNING: failed to start ctld
> ---[ ctld debug quotation end   ]-------------------------------------------
> 
> ---[ ctl.conf quotation start ]-------------------------------------------
> target iqn.2007-09.jp.ne.peach.istgt:file013 {
>     alias "file013-users"
>     portal-group alfa
>     auth-group ag-file013
>     lun 0 {
>             path /storage/win/.zfs/snapshot/daily-2015-08-22/file013
>             size 300G
>     }
> }
> ---[ ctl.conf quotation end   ]-------------------------------------------
> 
> the very file exists:
>> stat /storagez/win/.zfs/snapshot/daily-2015-08-22/traders.ts.ibs
> 3500296891 22 -rw-r--r-- 1 root wheel 4294967295 214748364800 "Oct 23 07:41:38 2013" "Aug 21 04:00:28 2015" "Aug 21 04:00:28 2015" "Oct 23 07:41:38 2013" 131072 419838466 0x800 /storage/win/.zfs/snapshot/daily-2015-08-22/file013
> 
> 
> another question: can ctld be configured to ignore unavailable config
> parts? like unaccessible/missconfigured LUNs


More information about the freebsd-fs mailing list