I got your LUNs right here, pal

Posted by Dick on December 21, 2006

I spotted iSCSI in the autumn and it seemed to tick a lot of boxes
(think SANs without the hype, HBAs, fibre channel, vendor lock-in or horrendous cost).

b54 SXCR has really nice ZFS iscsi integration :

zfs create tank/iscsi
zfs set mountpoint=legacy tank/iscsi
zfs set shareiscsi=on tank/iscsi

Then start the iSCSI target daemon1. Nothing is shared yet.

sol# svcadm enable iscsitgt
sol# iscsitadm list target
sol#

Thanks to ZFS inheritance, any zvols (not filesystems, I checked) created under tank/iscsi will automatically become LUNs:

zfs create -V 4G tank/iscsi/lefty
zfs create -V 4G tank/iscsi/righty

And that’s it.

iscsitadm list target -v
Target: tank/iscsi/lefty
    iSCSI Name: iqn.1986-03.com.sun:02:5ee25ac8-4930-ea8e-bc86-9d475793e277
    Alias: tank/iscsi/lefty
    Connections: 0
    ACL list:
    TPGT list:
    LUN information:
        LUN: 0
            GUID: 0x0
            VID: SUN
            PID: SOLARIS
            Type: disk
            Size: 4.0G
            Backing store: /dev/zvol/rdsk/tank/iscsi/lefty
            Status: online
Target: tank/iscsi/righty
    iSCSI Name: iqn.1986-03.com.sun:02:9cdcfa4d-a1dc-40f2-d70d-f294d5d9151f
    Alias: tank/iscsi/righty
    Connections: 0
    ACL list:
    TPGT list:
    LUN information:
        LUN: 0
            GUID: 0x0
            VID: SUN
            PID: SOLARIS
            Type: disk
            Size: 4.0G
            Backing store: /dev/zvol/rdsk/tank/iscsi/righty
            Status: online

Renaming the ZVOLs causes the iSCSI target/alias to update (the IQN is preserved so clients should be OK) :

zfs rename tank/iscsi/lefty tank/iscsi/pinky
zfs rename tank/iscsi/righty tank/iscsi/perky
iscsitadm list target
Target: tank/iscsi/pinky
   iSCSI Name: iqn.1986-03.com.sun:02:5ee25ac8-4930-ea8e-bc86-9d475793e277
   Connections: 0
Target: tank/iscsi/perky
   iSCSI Name: iqn.1986-03.com.sun:02:9cdcfa4d-a1dc-40f2-d70d-f294d5d9151f
   Connections: 0

When you do the usual zfs magic, iscsitadm seems to keeps up:

zfs snapshot tank/iscsi/lefty@snap
zfs clone tank/iscsi/lefty@snap tank/iscsi/sinister
iscsitadm list target
Target: tank/iscsi/righty
    iSCSI Name: iqn.1986-03.com.sun:02:4cf907ba-db89-4403-c1bb-ed5db6fcb76b
    Connections: 0
Target: tank/iscsi/lefty
    iSCSI Name: iqn.1986-03.com.sun:02:25fb9c0e-c58f-edcc-e8bc-d9686c0f0e88
    Connections: 0
Target: tank/iscsi/sinister
    iSCSI Name: iqn.1986-03.com.sun:02:c734e4a8-7d65-e427-80c7-dda523e814b7
    Connections: 0

Note the new IQN for the clone.
Adding

zfs set readonly=on  tank/iscsi/sinister

gets you the benefit of the .zfs/snapshot directory NFS clients would see if you’d set sharenfs=on (OK, you’re sharing a snapshot of the entire LUN rather than the filesystem, but clients can still get their old files without bugging you, so it does the job).

Course, you can share them out read/write too.
Combining that with ‘zfs promote’ should be more than enough rope for anyones needs :)

Having all the config in ZFS itself means that
when I upgrade the server, I just need to zpool import -f tank and I get my iscsi LUNs along with everything else.

There are a few things lacking – there’s no way to configure TPGT groups, it’s 1 LUN per target – but nothing I need badly. Discovery works fine.

(UPDATE: if you need TPGT support, you can use iscsitadm directly until it’s integrated into SXCR)

1 Without the last step, you’ll get an error (when inheriting the shareiscsi property) when you create the first zvol:

cannot share 'tank/iscsi/lefty': iscsitgtd failed request to share
filesystem successfully created, but not shared

which is bollocks, fortunately. It autostarts iscsitgtd for you.

pronounced ’sexier’

Posted by Dick on December 21, 2006

a fistful of dollars

Posted by Dick on December 13, 2006

You’ve probably noticed the
‘10% off everything within our borders’
Christmas sale the States are having.
When you combine that with the price difference between US and UK shops,
it’s tempting to import stuff (although customs are trying hard to dissuade me ).

Luckily there no duty on bytes (give them time) . So it’s a good time to get non-corporeal booty (and I don’t mean Aaliyah).

(NB: I have these already – I’m not fishing (although I wouldn’t say no to a container if you’re going to the bar).

The final version of the DRM-free 2nd edition PragProg Rails PDF
has dropped.
Unlike the book, it gets regular errata updates, is searchable and you can download the code. It’s about 12 pounds.

If you want to clear out a houseful of servers, Textdrive shared hosting is less than a pound a week if you buy a year up front.

I’ve been with them over a year now
and it’s been really good. Last winter the host I was on was a bit flaky, but it’s been fine since. I got the $99/year deal in August and have had 0 issues that weren’t of my own making since.

They’ve also said that anyone who has one of:

  • $15/month of Strongspace (5Gb of https/ssh/rsync-able disk, 5 users)
  • $15/month of Joyent Connector (groupware, 5 users )
  • $15/month of the shared hosting I just mentioned

will be automatically upgraded in the New Year to ‘Joyent Core’ – which is all the above for $15/month.

I’m with jwz on groupware , but Strongspace uses
ZFS (Thumpers) for storage , so
I’ll trust it more than some other NAS I could mention .

If it sounds worth having, get a month of shared ($12) before shelling out for a year – davie is solid, but some shared boxes are more equal than others .

(Textdrive are actually doing a referral scheme, so in theory I could pimp them out, but it’s too much of a pain in the arse to get the dollars over here (they pay in bushels of straw or something)).

poison dwarf

Posted by Dick on December 03, 2006

I am sick of GNOMEs bullshit.

Setantae recommended wmii -
I glanced at it a while back but mistook it for a ratpoison clone.
Ratpoision didn’t play nice with GIMP and the ‘1 app per desktop’ model meant you were forever switching views.

wmii is a lot nicer: sane default layouts, easy adjustments, and it uses 9P for IPC (the ruby wrapper is the icing on the cake). It’s < 10000 lines of code, which makes it the Camping of window managers.

First, I stopped using network manager (I hardly ever connect to different WLANs) and went back to a system-wide WPA setup .
All I neeeded was to set a DVORAK layout at login and I’d be happy.

Sadly, GDM contracted the Open Source disease of reimplementing everything. It doesn’t read ~/.xsession, instead using system-wide ‘foo.desktop’ files. As if this hadn’t all been solved when I was 10.

I would skip a display manager altogether, but other people use the box and I’d like to be a good neighbour.
This seems to work without needing to hack around in /etc/X11 :

$ sudo apt-get install wmii
$ # logout, choose 'wmii' session at GDM and log back in
$ cd
$ cat > .dmrc
[Desktop]
Session=custom
$ cat > .xinitrc
 setxkbmap dvorak&
 # add your own stuff here
 exec wmii
$ ln -s .xinitrc .xsession