First of all, contents in this entry are sort of hacking rather than the OpenSolaris solution to support iSCSI boot device. The final solution will be coming from caiman project rather than here, AFAIK caiman is actively working on the support and the draft plan may be available soon.


Currently OpenSolaris can't be installed to iSCSI boot device with the liveCD, the major issue here is that the iSCSI initiator module is not included in the liveCD. That basically limits the ability to access to the iSCSI target.


However with customizing, or hacking in another word, the AI process, it is not that difficult to experience iSCSI boot with OpenSolaris.


Requirements:


For x86, the build number of OpenSolaris should be 104+, and the machine should have at least two NICs - one to support PXE and the other to support iBFT.


For sparc, the build number of OpenSolaris should be 127+(per current plan), and the machine should have an updated OBP (should be coming out soon) to support iSCSI boot.


Seteps:


1. First an AI server needs to be configured following the AI instruction.


2. Modify the default manifest to specify the iSCSI target info by adding a harmless comment, e.g.,





3. Configure a default 'target_device' in manifest, this can be inserted before the


section.



0
0




4. Also don't forget to specify the iSCSI initiator package along with IDM in the manifest by adding following items into the section.




5. Customizing(hacking) the auto-installer in the microroot.



In case of x86 and the AI target directory on AI server is /export/home/ai_server, the microroot can be customized in this way.


# cd /export/home/ai_server/boot


# gzcat x86.microroot >/tmp/miniroot


# lofiadm -a /tmp/miniroot


/dev/lofi/1


# mount /dev/lofi/1 /mnt


Then open the /mnt/lib/svc/method/auto-installer with a preferred editor, locate the following paragragh.


===============================================


echo "Automated Installation started" | $TEE_LOGTOCONSOLE
echo "The progress of the Automated Installation can be followed by viewing " \
"the logfile at /tmp/install_log" | $TEE_LOGTOCONSOLE


===============================================


Not this is a shell script to be executed on client side, so here we need to put some customized commands to,


1) Establish the connection to the iSCSI target


2) Identify the iSCSI disk OS name


3) Update the manifest to include the iSCSI disk.


One way to do this would be add following commands just below the above paragraph.


# ========Below will add iscsi configuration for AI client. ============

echo "begin iSCSI configuration..." | $TEE_LOGTOCONSOLE

# get target name
input=`cat $AISC_MANIFEST | grep iscsi-target-name=`
target_name=`echo $input | awk -F"=" '{print$2}' `

# get target ip address
input=`cat $AISC_MANIFEST | grep iscsi-target-ip=`
target_ip=`echo $input | awk -F"=" '{print$2}' `

# get lun number
input=`cat $AISC_MANIFEST | grep iscsi-lun=`
lun=`echo $input | awk -F"=" '{print$2}' `
lun="LUN: $lun"

echo "Destination LUN from manifest is $lun on target $target_name" | $TEE_LOGTOCONSOLE

# add the static-config and enable the discovery
/usr/sbin/iscsiadm add static-config $target_name,$target_ip
/usr/sbin/iscsiadm modify discovery -s enable

# wait here for a while
sleep 10
/usr/sbin/devfsadm -C
sleep 30

/usr/sbin/iscsiadm list target -S >/tmp/client_target.out

test=`cat /tmp/client_target.out | grep "$lun" | wc -l`
if [ $test = "0" ] ; then
echo "can't find $lun on target $target_name" | $TEE_LOGTOCONSOLE
exit $SMF_EXIT_ERR_FATAL
fi

# get the os device name of the LUN
i=`sed -n -e /"$lun"/= /tmp/client_target.out`
line=`expr "$i" "+" 3`
string=`sed -n -e ${line}p /tmp/client_target.out`
tmp=`echo ${string} | awk -F"/" '{print$4}' `
name=`echo $tmp | sed 's/..$//' `
echo "Get $name from local disk table for installation" | $TEE_LOGTOCONSOLE
# replace the device name in the manifest
cat $AISC_MANIFEST | sed "s+.+${name}+" >/tmp/ai_combined_manifest.xml.2
mv /tmp/ai_combined_manifest.xml.2 $AISC_MANIFEST

echo "iSCSI configuration completes" | $TEE_LOGTOCONSOLE

# =============end of getting iscsi configuration ==================



6. Save the script and umount/delete the lofi device.


# umount /mnt


# lofiadm -d /dev/lofi/1


7. Repack and replace the microroot.


# gzip miniroot


# mv miniroot.gz /export/home/ai_server/boot/x86.microroot


Now go ahead to install the client, good luck!









More...