-Tweak SLES 11 iscsi install to work, with a profile to tell AutoYaST to set up for firmware iSCSI (RH autodetects this via iBFT)

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@3141 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2009-04-08 19:07:57 +00:00
parent cb0696369c
commit 0d2b8ac3b9
2 changed files with 211 additions and 0 deletions

View File

@ -0,0 +1,114 @@
<post-scripts config:type="list">
<script>
<filename>xcat.sh</filename>
<interpreter>shell</interpreter>
<source>
<![CDATA[
#!/bin/sh
RAND=$(perl -e 'print int(rand(50)). "\n"')
sleep $RAND
jsi=0
while [ $(hostname) == 'linux' ]
do
if [ $jsi -gt 10 ]; then
logger "Slept too long!"
exit
fi
let jsi=jsi+1
sleep 1
done
echo "Slept $jsi seconds before hostname made sense."
HOSTNAME=$(hostname -s)
echo $HOSTNAME
/sbin/portmap
export MASTER_IP=#XCATVAR:XCATMASTER#
export MASTER_IPS=#XCATVAR:XCATMASTER#
export MASTER="#XCATVAR:XCATMASTER#"
# for servicenode, add /install to /etc/fstab
echo "$MASTER:/install /install nfs timeo=14,intr 1 2" >>/etc/fstab
# check the arch for nodetype
NODE_ARCH=#TABLE:nodetype:$NODE:arch#
#
# This script has not yet been updated to work with service nodes
#
for i in $(seq 1 20)
do
GOTIT=0
for i in $MASTER_IPS
do
#mount -r $i:/install/postscripts /xcatpost
wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 0 -T 60 ftp://$i/postscripts
wget -l inf -N -r --waitretry=10 --random-wait --retry-connrefused -t 0 -T 60 ftp://$i/post/otherpkgs/sles11/$NODE_ARCH
if [ "$?" = "0" ]
then
if [ -x /usr/bin/openssl ]; then
USEOPENSSLFORXCAT=1
export USEOPENSSLFORXCAT
XCATSERVER=$i:3001
export XCATSERVER
else
rpm -ivh $i/post/otherpkgs/sles11/$NODE_ARCH/stunnel*.rpm
mkdir -p /usr/var/run/stunnel
mkdir -p /var/stunnel
if [ -x /usr/sbin/stunnel ]; then #Stop if no stunnel to help the next bit
echo client=yes > /etc/stunnel/stunnel.conf
echo foreground=no >> /etc/stunnel/stunnel.conf
echo output=/dev/null >> /etc/stunnel/stunnel.conf
echo verify=0 >> /etc/stunnel/stunnel.conf
echo '[xcatd]' >> /etc/stunnel/stunnel.conf
echo accept=400 >> /etc/stunnel/stunnel.conf
echo connect=$i:3001 >> /etc/stunnel/stunnel.conf
stunnel
STUN_PID=$!
sleep 1
fi
fi
mv $i/postscripts /xcatpost
rm -rf $i
chmod +x /xcatpost/*
/xcatpost/getpostscript.awk |sed -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed -e 's/^ *//' > /tmp/mypostscript
MYCONT=`cat /tmp/mypostscript`
while [ -z "$MYCONT" ]; do
let SLI=$RANDOM%10+10
sleep $SLI
/xcatpost/getpostscript.awk |sed -e 's/<[^>]*>//g'|egrep -v '^ *$'|sed -e 's/^ *//' > /tmp/mypostscript
MYCONT=`cat /tmp/mypostscript`
done
chmod +x /tmp/mypostscript
GOTIT=1
break
fi
done
if [ "$GOTIT" = "1" ]
then
break
fi
RAND=$(perl -e 'print int(rand(5)). "\n"')
sleep $RAND
done
PATH=/xcatpost:$PATH
export PATH
/tmp/mypostscript
updateflag.awk $MASTER 3002
cd /
/xcatpost/#TABLE:nodelist:$NODE:node#
rm -Rf /xcatpost
rm -f /tmp/mypostscript
if [ ! -x /usr/bin/stunnel ]; then
rm -f /etc/stunnel/stunnel.conf
fi
rmdir /xcatpost
]]>
</source>
</script>
</post-scripts>

View File

@ -0,0 +1,97 @@
<?xml version="1.0"?>
<!DOCTYPE profile SYSTEM "/usr/share/YaST2/include/autoinstall/profile.dtd">
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
<install>
<bootloader>
<write_bootloader config:type="boolean">true</write_bootloader>
<activate config:type="boolean">true</activate>
<kernel_parameters></kernel_parameters>
<lba_support config:type="boolean">false</lba_support>
<linear config:type="boolean">false</linear>
<location>mbr</location>
</bootloader>
<iscsi-client>
<initiatorname>#TABLE:nodelist:$NODE:node#</initiatorname>
<targets config:type="list">
<listentry>
<authmethod>None</authmethod>
<portal>#TABLE:iscsi:$NODE:server#:3260,1</portal>
<startup>onboot</startup>
<target>#TABLE:iscsi:$NODE:target#</target>
</listentry>
</targets>
<version>1.0</version>
</iscsi-client>
<general>
<clock>
<hwclock>GMT</hwclock>
<timezone>#TABLE:site:key=timezone:value#</timezone>
</clock>
<keyboard>
<keymap>english-us</keymap>
</keyboard>
<language>en_US</language>
<mode>
<confirm config:type="boolean">false</confirm>
<forceboot config:type="boolean">false</forceboot>
<interactive_boot config:type="boolean">false</interactive_boot>
<reboot config:type="boolean">true</reboot>
</mode>
<mouse>
<id>non</id>
</mouse>
</general>
<partitioning config:type="list">
<drive>
<initialize config:type="boolean">true</initialize>
<use>all</use>
</drive>
</partitioning>
<software>
<patterns config:type="list">
<pattern>base</pattern>
<pattern>x11</pattern>
</patterns>
<packages config:type="list">
<package>xntp</package>
<package>rsync</package>
<package>open-iscsi</package>
</packages>
</software>
</install>
<configure>
<users config:type="list">
<user>
<username>root</username>
<user_password>#CRYPT:passwd:key=system,username=root:password#</user_password>
<encrypted config:type="boolean">true</encrypted>
<forename/>
<surname/>
</user>
</users>
<networking>
<dns>
<dhcp_hostname config:type="boolean">true</dhcp_hostname>
<dhcp_resolv config:type="boolean">true</dhcp_resolv>
<domain>#TABLE:site:key=domain:value#</domain>
<hostname>#TABLE:nodelist:$NODE:node#</hostname>
</dns>
<interfaces config:type="list">
<interface>
<bootproto>dhcp</bootproto>
<device>eth0</device>
<startmode>nfsroot</startmode>
</interface>
</interfaces>
<routing>
<ip_forward config:type="boolean">false</ip_forward>
<routes config:type="list"/>
</routing>
</networking>
<scripts>
#INCLUDE:../scripts/pre.sles#
#INCLUDE:../scripts/chroot.sles#
#INCLUDE:../scripts/post.sles11.iscsi#
</scripts>
</configure>
</profile>