Sun Update Connection - Enterprise 1.0 User's Guide

floatingServers.sh Script

This script is called by a local script that finds the group with an overload or an idle threshold pass. Its arguments are the group with the needed resources (source) and the group that needs the resource (target).


#! /bin/bash 

host=floating 
policy=YesToAll 

function login {
 echo -n “Type your user name:”
 read user
 echo -n “Type your password:”
 read password
 } 

function deployServer {
 uce_cli -sj -P “$profile” -C “$policy” -h “$host” -dp -u “$user” -p
 “$password”
 } 

function findProfile {
 sourceG=$1
 targetG=$2
 if [ $sourceG = “Idle” -a $targetG = “WebServers” ]; then 
               profile=”WebServerProfile”
 elif [ $sourceG = “Idle” -a $targetG = “TelnetServers” ]; then
               profile=”TelnetServerProfile” 
 elif [ $sourceG = “WebServers” -o $sourceG = “TelnetServers” ]; then 
               profile=”IdleServerProfile”
 else 
   echo “Source is not in automated script.”
   echo “From the following list of known profiles, select one to deploy on floating server”
      uce_cli -lp -u “$user” -p “$password”
      echo -n “Profile to deploy:”
      read profile
 fi 
} 
login 
findProfile $1 $2
 echo “Deploying $profile on $host to make it part of $2”
 deployServer

Note –

If the servers in a pool are of one distribution, and the floating server is of another, you can use the BMI Server to recycle the floating server with a new Linux distribution while provisioning it with a profile. Consult with your Sun distributor for details.