
#get the data from the array, assumes all virtual disk have VD the name
sacommand --saurl //${MSA_USER}:${MSA_PW}@${array} "show volumes" | grep VD >
/tmp/vols
#begin the statement construction, the WWN do not line up, so only sections are compared
echo "multipaths {"
cat /tmp/vols | while read line ; do
alias=`echo $line | cut -d ' ' -f 2 | cut -c7-`
temp=`echo $line | cut -d ' ' -f 4 | cut -c 8-12``echo $line | cut -d ' ' -f 4 | cut -c 17-23`
wwid=`grep $temp /tmp/devs2 | sort -u`
if [ "$wwid" != "" ]; then
echo -e "\tmultipath {\n\t\twwid\t\t$wwid\n\t\talias\t\t${alias}_disk\n\t}"
fi
done
echo "}"
#cleanup
rm -f /tmp/devs? /tmp/vols
4. prep_ssh.sh – generates secure shell keys and configuration files, and temporarily
places these files on the GFS2 volume for passing to the other cluster member
#!/bin/bash
# This script will create a FS for temporary use on the disk to be
# used for GFS2, generate ssh config and copy the ssh config to this disk
#Create ext2 file system
mkfs /dev/mapper/GFS2_disk
#Mount temp file system
mount /dev/mapper/GFS2_disk /mnt
#Create the .ssh dir and generate individual and cluster RSA key pairs
mkdir /root/.ssh
chmod 700 /root/.ssh
ssh-keygen -q -t rsa -N "" -f /root/.ssh/id_rsa
#Add the public key to the authorized keys
/bin/cp /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys
#Add cluster key and allow ssh to automatically add all hosts to the
#host file as they connect
echo StrictHostKeyChecking no >> /root/.ssh/config
#Copy the ssh configuration to the temp file system and unmount
/bin/cp /root/.ssh/id_rsa /root/.ssh/id_rsa.pub /root/.ssh/authorized_keys /root/.ssh/config /mnt/
umount /mnt
5. create_satVM.sh – creates the satellite VM, detailed in the next section
#!/bin/bash
45 www.redhat.com
Comentarios a estos manuales