Difference between revisions of "OpenSUSE: installing on and booting from iSCSI"

From Perswiki
Jump to: navigation, search
(Created page with "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 o...")
 
(Fixing yast2-iscsi-client)
 
(11 intermediate revisions by the same user not shown)
Line 1: Line 1:
iSCSI is probably not exactly the most exercised functionalitry in openSUSE (openSUSE 12.1
+
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,
was even released with a buggy YaST iSCSI client module, which prevented installation on and/or
+
iSCSI works really well with openSUSE.
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  
 
I've recently completed an exercise in installing openSUSE 12.1  
Line 15: Line 14:
 
  RAID5
 
  RAID5
  
Additionally, I have a DHCP+TFTP setup that allows me to boot machines without local media, i.e. PXE network boot.
+
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 from CD or a USB flash should work equally well.
+
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 [https://bugzilla.novell.com/show_bug.cgi?id=725182 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.
 +
<br/>7Dec2011: I have submitted [https://build.opensuse.org/request/show/95672 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==

Latest revision as of 14:08, 11 December 2011

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