iscsi boot fix proposal for mkinitrd scripts

Hi,
I ran into an issue with sles 11 sp2 and it looks like this issue persists in opensuse as well.

When installing on an iSCSI SAN LUN, one of the advantages is that you should be able to switch the physical server and boot the same LUN off iSCSI. With a changed set of iSCSI boot parameters, configured in the iSCSI capable network card and passed to the OS in the iBFT.

Unfortunately, during the creation of the initrd file, mkinitrd *persists * ip & iscsi information of the current server setup into the init or run_all.sh script.
Example:

 "$debug" ] && echo preping 12-network.sh
 "$static_macaddresses" ] || static_macaddresses='eth0:11:22:33:44:55:66'
 "$static_ips" ] || static_ips='10.10.10.10:::255.255.255.0:linux:eth0:none'
 "$drvlink" ] || drvlink='pci:v00008086d000010FBsv000010CFsd000015A4bc02sc00i00'
if   "$interface" -o "$dhcp" -o "$ip" -o "$nfsaddrs" -o "$drvlink" ]; then
  modules=" af_packet $bonding_module"
   "$debug" ] && echo running 12-network.sh
  source boot/12-network.sh
   "$modules" ] && load_modules
fi
 "$debug" ] && echo preping 13-iscsi.sh
 "$root_iscsi" ] || root_iscsi='1'
 "$iscsi_sessions" ] || iscsi_sessions='1'
 "$TargetName1" ] || TargetName1='iqn.1992-08.com.myiscsistorage:sn.111111111'
 "$TargetAddress1" ] || TargetAddress1='10.10.10.100'
 "$TargetPort1" ] || TargetPort1='3260'
 "$TargetPort" ] || TargetPort='3260'
if   "$root_iscsi" -o "$TargetAddress" ]; then
  modules=" iscsi_tcp crc32c scsi_transport_iscsi iscsi_ibft bnx2i"
   "$debug" ] && echo running 13-iscsi.sh
  source boot/13-iscsi.sh
   "$modules" ] && load_modules
fi

The information should rather be dynamically read from the iBFT table when booting via iscsi.
Which is actually also done in /lib/mkinitrd/scripts/boot-ibft.sh:

    ip="$(ibft_get_att ip-addr)::$(ibft_get_att gateway):$(ibft_get_att subnet-mask):$ibft_hostname:$(ibft_get_ethdev):$nettype"    
    interface=$(ibft_get_ethdev)
    macaddress=$(ibft_get_att mac)
    InitiatorName=$(ibft_get_initiatorname)

But the network activation in boot-network.sh expects different variables and format, see /lib/mkinitrd/scripts/boot-network.sh:

  static_ips=($static_ips)
  for macaddr in $static_macaddresses -- $dhcp_macaddresses; do

My fix proposal for /lib/mkinitrd/scripts/boot-ibft.sh is to create the variables required for boot-network.sh:

...
    ip="$(ibft_get_att ip-addr)::$(ibft_get_att gateway):$(ibft_get_att subnet-mask):$ibft_hostname:$(ibft_get_ethdev):$nettype"
    interface=$(ibft_get_ethdev)
    macaddress=$(ibft_get_att mac)
    InitiatorName=$(ibft_get_initiatorname)
##################################################
    if test "$nettype" = "dhcp"; then
        dhcp_macaddresses="$interface:$macaddress"
    else
        static_macaddresses="$interface:$macaddress"
        static_ips=$ip
    fi
##################################################

Hope, somebody can make use of this fix and include it into the next patch/release.

(sles 11 sp1 actually worked correctly in this respect)

Best,
Vasu

For this to happen you need open bug report against mkinitrd in bugzilla.

Thanx for the notice. Done: https://bugzilla.novell.com/show_bug.cgi?id=785818

I have the same problem with new installed SLES 11 on ML620 with 4nics. I corrected initrd scripts and SLESboots ok using different NIC but it’s not a solution. ISCSI Network adapter should be automatic configured during boot ( now we have static entry in initrd with mac and interface name).

On 10/24/2012 09:16 PM, rob206 wrote:
>
> I have the same problem with new installed SLES 11

oh wow, the OP should have been directed to the correct forum…these
are the openSUSE forums while SLES and SLED are provided and supported
by the commercial side, over at http://forums.suse.com/

the Pass/ID you used here works there…


dd

This thread is closed. As pointed out above, this is not openSUSE at all. SLES/SLED questions/problems should go to the URL mentioned in the post above.