
echo "Didn't find a varDefs.sh file!"
fi
# The blade profile must be passed
if [[ $# -ne 1 ]]
then
echo 'Usage - $0 <HP Virtual Connect profile name>'
exit -1
else
pname=$1
fi
# Implement a semaphore to verify that name and IP are unique
while [[ -e /tmp/AvailNameIP ]] ; do sleep 1; done
touch /tmp/AvailNameIP
vcmcommand --vcmurl //${LOGIN}:${VCM_PW}@${VCM_IP} show server | grep ${pname} > /dev/null
2>/dev/null
if [[ $? -ne 0 ]]
then
echo "HP Virtual Connect profile $pname not found!"
exit -2
fi
nblade=`vcmcommand --vcmurl //${LOGIN}:${VCM_PW}@${VCM_IP} show server | grep ${pname} | awk
'{print $3}'`
iloIP=`oacommand --oaurl //${LOGIN}:${OA_PW}@${OA_IP} show server info ${nblade} | grep "IP
Address" | awk '{print $3}'`
rawMAC=`vcmcommand --vcmurl //${LOGIN}:${VCM_PW}@${VCM_IP} show profile ${pname} | grep
public | awk '{print $5}'`
IPname=`/root/resources/GetAvailRhevh.sh | awk '{print $1}'`
IPnum=`/root/resources/GetAvailRhevh.sh | awk '{print $2}'`
# Delete any previously defined cobbler system entry
if [[ `cobbler system list | grep ${IPname}` ]]
then
cobbler system delete --name=${IPname}
fi
# Create cobbler system entry
echo -e "\nCreating cobbler system entry ...\n"
cobbler system add --name=${IPname} --profile=${RHEVH_PROFILE} --mac=${rawMAC//-/:} --ip=$
{IPnum} --hostname=${IPname} --dns-name=${IPname} --kopts="console=ttyS0,115200 nostorage"
cobbler sync
# Remove semaphore
/bin/rm /tmp/AvailNameIP
# Present storage to host
echo -e "\nPresenting storage to host ${pname} ...\n"
129 www.redhat.com
Comentarios a estos manuales