OpenSUSE: installing on and booting from iSCSI

From Perswiki
Jump to: navigation, search

iSCSI is probably not exactly the most exercised functionality in openSUSE, but apart from a serious bug in the yast2-iscsi-client module in openSUSE 12.1, iSCSI works really 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.

Environment

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 
LVM
RAID5

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

Unfortunately, openSUSE 12.1 was released with a buggy iscsi-client module bug#725182, but we can fix this before we start the installation. To the uninitiated, this may sound a little too involved, but it's really quite easy.
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:

--- old/IscsiClientLib.ycp  2011-11-03 16:54:24.000000000 +0100
+++ new/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.

iSCSI config

On my LVM setup, I carve out some space for a logical volume for installing on. For this exercise I used 6Gb:

lvcreate -L6G -n blade1 <group>

To make it available over iSCSI, amend /etc/iet./ietd.conf as follows:

Target iqn.2011-10.domain.your:1234567890
   Lun 1 Path=/dev/iscsigroup/blade1,Type=blockio,ScsiId=rootblade1,Blocksize=4096

Then restart iscsitarget.

Installation

Now you go through the normal installation, configuring your iSCSI drive in the normal way etc. Not much else to say about that. Make a note of the drive as listed under /dev/disk/by-id/scsi-somethingsomethingsomething - we need this the PXE configuration. If you don't PXE or if you use filesystem labels, I'm sure you'll know what to do.

blah