LIO -fb in Debian

LIO -fb is the new SCSI Target for Debian. Previously, we maintained the LIO tools from the pre-fork upstream branch. But, with good reasons, we’ve now moved to the newer -fb (Free Branch).

As the maintainer for those pacakges, I have a local LIO setup. Overy the years, I’ve been tuning and using this setup with a bunch of SCSI clients. Now with the new -fb packages it was worrisome for me, on how to migrate (Note: migration is not supported by the Debian packages) my old setup to the new one.

Thanks to Andy Grover for mentioning it, migrating your configuration is doable. With some minor intervention, I was able to switch my config from old LIO setup to the new LIO -fb pacakges. As you can see from the output below, both the outputs look the same, which is a good thing.

LIO reads its configuration from /etc/target/ and passes it into the kernel. The kernel loads the config. The real time config is present in configfs, within the kernel. Users willing for such migration need to ensure that the loaded config data remains in configfs. And then, using the new -fb tools ( targetctl ), the configuration data needs to be read and written to a new format in /etc/.

/> ls
o- / ......................................................................................................................... [...]
  o- backstores .............................................................................................................. [...]
  | o- fileio ................................................................................................... [0 Storage Object]
  | o- iblock .................................................................................................. [4 Storage Objects]
  | | o- CENTOS ................................................................................................. [/dev/vdd, in use]
  | | o- SAN1 ................................................................................................... [/dev/vdb, in use]
  | | o- SAN2 ................................................................................................... [/dev/vdc, in use]
  | | o- SANROOT .............................................. [/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0, in use]
  | o- pscsi .................................................................................................... [0 Storage Object]
  | o- rd_mcp ................................................................................................... [0 Storage Object]
  o- ib_srpt ........................................................................................................... [0 Targets]
  o- iscsi ............................................................................................................. [3 Targets]
  | o- iqn.1994-05.com.redhat:23d8eb7fa1fc ................................................................................. [1 TPG]
  | | o- tpg1 ............................................................................................................ [enabled]
  | |   o- acls ............................................................................................................ [1 ACL]
  | |   | o- iqn.1994-05.com.redhat:23d8eb7fa1fc .................................................................... [1 Mapped LUN]
  | |   |   o- mapped_lun0 ............................................................................................. [lun0 (rw)]
  | |   o- luns ............................................................................................................ [1 LUN]
  | |   | o- lun0 ....................................................................................... [iblock/CENTOS (/dev/vdd)]
  | |   o- portals ..................................................................................................... [4 Portals]
  | |     o- 172.16.20.40:3260 ................................................................................. [OK, iser disabled]
  | |     o- 172.16.20.41:3260 ................................................................................. [OK, iser disabled]
  | |     o- 172.16.20.42:3260 ................................................................................. [OK, iser disabled]
  | |     o- 172.16.20.43:3260 ................................................................................. [OK, iser disabled]
  | o- iqn.2003-01.org.linux-iscsi.debian.sanboot .......................................................................... [1 TPG]
  | | o- tpg1 ............................................................................................................ [enabled]
  | |   o- acls ............................................................................................................ [1 ACL]
  | |   | o- iqn.2005-03.org.open-iscsi:fd2bc2f4652a-sanboot ........................................................ [1 Mapped LUN]
  | |   |   o- mapped_lun0 ............................................................................................. [lun0 (rw)]
  | |   o- luns ............................................................................................................ [1 LUN]
  | |   | o- lun0 .................................... [iblock/SANROOT (/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0)]
  | |   o- portals ..................................................................................................... [4 Portals]
  | |     o- 172.16.20.40:3260 ................................................................................. [OK, iser disabled]
  | |     o- 172.16.20.41:3260 ................................................................................. [OK, iser disabled]
  | |     o- 172.16.20.42:3260 ................................................................................. [OK, iser disabled]
  | |     o- 172.16.20.43:3260 ................................................................................. [OK, iser disabled]
  | o- iqn.2003-01.org.linux-iscsi.debian.x8664 ............................................................................ [1 TPG]
  |   o- tpg1 ............................................................................................................ [enabled]
  |     o- acls ............................................................................................................ [1 ACL]
  |     | o- iqn.1993-08.org.debian:01:2972f6b5fc7 ................................................................. [2 Mapped LUNs]
  |     |   o- mapped_lun0 ............................................................................................. [lun0 (rw)]
  |     |   o- mapped_lun1 ............................................................................................. [lun1 (rw)]
  |     o- luns ........................................................................................................... [2 LUNs]
  |     | o- lun0 ......................................................................................... [iblock/SAN1 (/dev/vdb)]
  |     | o- lun1 ......................................................................................... [iblock/SAN2 (/dev/vdc)]
  |     o- portals ..................................................................................................... [4 Portals]
  |       o- 172.16.20.40:3260 ................................................................................. [OK, iser disabled]
  |       o- 172.16.20.41:3260 ................................................................................. [OK, iser disabled]
  |       o- 172.16.20.42:3260 ................................................................................. [OK, iser disabled]
  |       o- 172.16.20.43:3260 ................................................................................. [OK, iser disabled]
  o- loopback .......................................................................................................... [0 Targets]
  o- qla2xxx ........................................................................................................... [0 Targets]
  o- tcm_fc ............................................................................................................ [0 Targets]
  o- vhost ............................................................................................................. [0 Targets]
/> 







/> ls
o- / ......................................................................................................................... [...]
  o- backstores .............................................................................................................. [...]
  | o- block .................................................................................................. [Storage Objects: 4]
  | | o- CENTOS ........................................................................... [/dev/vdd (2.0GiB) write-thru activated]
  | | o- SAN1 ............................................................................. [/dev/vdb (1.0GiB) write-thru activated]
  | | o- SAN2 ............................................................................. [/dev/vdc (1.0GiB) write-thru activated]
  | | o- SANROOT ........................ [/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0 (8.0GiB) write-thru activated]
  | o- fileio ................................................................................................. [Storage Objects: 0]
  | o- pscsi .................................................................................................. [Storage Objects: 0]
  | o- ramdisk ................................................................................................ [Storage Objects: 0]
  o- iscsi ............................................................................................................ [Targets: 3]
  | o- iqn.1994-05.com.redhat:23d8eb7fa1fc ............................................................................... [TPGs: 1]
  | | o- tpg1 ............................................................................................... [no-gen-acls, no-auth]
  | |   o- acls .......................................................................................................... [ACLs: 1]
  | |   | o- iqn.1994-05.com.redhat:23d8eb7fa1fc .................................................................. [Mapped LUNs: 1]
  | |   |   o- mapped_lun0 ................................................................................ [lun0 block/CENTOS (rw)]
  | |   o- luns .......................................................................................................... [LUNs: 1]
  | |   | o- lun0 ........................................................................................ [block/CENTOS (/dev/vdd)]
  | |   o- portals .................................................................................................... [Portals: 4]
  | |     o- 172.16.20.40:3260 ................................................................................................ [OK]
  | |     o- 172.16.20.41:3260 ................................................................................................ [OK]
  | |     o- 172.16.20.42:3260 ................................................................................................ [OK]
  | |     o- 172.16.20.43:3260 ................................................................................................ [OK]
  | o- iqn.2003-01.org.linux-iscsi.debian.sanboot ........................................................................ [TPGs: 1]
  | | o- tpg1 ............................................................................................... [no-gen-acls, no-auth]
  | |   o- acls .......................................................................................................... [ACLs: 1]
  | |   | o- iqn.2005-03.org.open-iscsi:fd2bc2f4652a-sanboot ...................................................... [Mapped LUNs: 1]
  | |   |   o- mapped_lun0 ............................................................................... [lun0 block/SANROOT (rw)]
  | |   o- luns .......................................................................................................... [LUNs: 1]
  | |   | o- lun0 ..................................... [block/SANROOT (/dev/disk/by-id/scsi-0QEMU_QEMU_HARDDISK_drive-scsi0-0-0-0)]
  | |   o- portals .................................................................................................... [Portals: 4]
  | |     o- 172.16.20.40:3260 ................................................................................................ [OK]
  | |     o- 172.16.20.41:3260 ................................................................................................ [OK]
  | |     o- 172.16.20.42:3260 ................................................................................................ [OK]
  | |     o- 172.16.20.43:3260 ................................................................................................ [OK]
  | o- iqn.2003-01.org.linux-iscsi.debian.x8664 .......................................................................... [TPGs: 1]
  |   o- tpg1 ............................................................................................... [no-gen-acls, no-auth]
  |     o- acls .......................................................................................................... [ACLs: 1]
  |     | o- iqn.1993-08.org.debian:01:2972f6b5fc7 ................................................................ [Mapped LUNs: 2]
  |     |   o- mapped_lun0 .................................................................................. [lun0 block/SAN1 (rw)]
  |     |   o- mapped_lun1 .................................................................................. [lun1 block/SAN2 (rw)]
  |     o- luns .......................................................................................................... [LUNs: 2]
  |     | o- lun0 .......................................................................................... [block/SAN1 (/dev/vdb)]
  |     | o- lun1 .......................................................................................... [block/SAN2 (/dev/vdc)]
  |     o- portals .................................................................................................... [Portals: 4]
  |       o- 172.16.20.40:3260 ................................................................................................ [OK]
  |       o- 172.16.20.41:3260 ................................................................................................ [OK]
  |       o- 172.16.20.42:3260 ................................................................................................ [OK]
  |       o- 172.16.20.43:3260 ................................................................................................ [OK]
  o- loopback ......................................................................................................... [Targets: 0]
  o- vhost ............................................................................................................ [Targets: 0]
/> 

See also