OpenSUSE: installing on and booting from iSCSI

From Perswiki
Revision as of 12:12, 11 December 2011 by Per Jessen (Talk | contribs) (Fixing yast2-iscsi-client)

Jump to: navigation, search

iSCSI is probably not exactly the most exercised functionalitry in openSUSE (openSUSE 12.1 was even released with a buggy YaST iSCSI client module, which prevented installation on and/or configuration of iSCSI disks). Apart from that essentially quite minor hurdle, iSCSI works very well with openSUSE.

I've recently completed an exercise in installing openSUSE 12.1 on IBM HS20 blades without local disks, only iSCSI access, and it was suggested to me I do a short write-up.


Having a working iSCSI server is obviously essential - I have a server running openSUSE - not sure which version, but with the lastest iSCSI target software. The config looks roughly like this:

iSCSI target 

Additionally, I have a DHCP+TFTP setup that allows me to boot/install machines without local media, i.e. PXE network boot. It's not a requirement as such, booting or installing from CD or a USB flash should work equally well.

Installing over ssh

I almost always install openSUSE from the NET version over an ssh session - our downstairs datacenter is not a really comfortable environment for longer periods of time, so I prefer getting the installation going, then return to the comforts of my office and continue from there. Installing over ssh also means we get access to a shell before starting YaST, which is quite important. I believe it is possible to achieve this with a command line argument too, but I'm not sure what it is.

Fixing yast2-iscsi-client

To the uninitiated, this may sound a little too involved, but it's really quite easy. Unfortunately, openSUSE 12.1 was released with a buggy iscsi-client module, but we can fix this before we start the installation.
7Dec2011: I have submitted a fix for updating YaST, but it has not yet gone through.

Once you have booted the machine and logged over ssh:

mkdir -p /y2update/modules
cp /usr/share/YaST2/modules/IscsiClientLib.ycp /y2update/modules
cd /y2update/modules

The patch is really simple, I suggest you apply it by hand:

--- modold/IscsiClientLib.ycp   2011-11-03 16:54:24.000000000 +0100
+++ modules/IscsiClientLib.ycp  2011-12-06 16:18:06.056886330 +0100
@@ -255,7 +255,8 @@
    string iface = "";
    foreach( string row, data,
-       row = deletechars(row,"\t");
+       row = substring(row,findfirstnotof(row,"\t "),999);
       if( search(row,"Target:")!=nil )
           target = splitstring(row, " ")[1]:"";
       else if( search(row,"Portal:")!=nil )

Compile to bytecode:
ycpc -c IscsiClientLib.ycp

Once that is done, you start YaST like this:

Y2DIR=/y2updates yast

YaST will now work with the fixed module.