In this procedure, you will use Sun Update Connection – Enterprise to install the needed server profile on the floating server when the load threshold has reached overload, and to uninstall the profile when the load threshold has reached idle.
Using Sun Update Connection – Enterprise, create the profiles of your servers.
Define what is required and what is not allowed to be on each type of server. For this scenario, define a WebServerProfile profile and a TelnetServerProfile profile.
See To Create a Profile.
Create a profile that uninstalls the software of the other two profiles.
No damage is caused by setting Uninstall to components that are not there. So, make an uninstall profile called IdleServerProfile.
If there are various distributions used in the server pools and in the floating servers, align the profiles for all relevant distributions.
Create a policy that automates all actions (Yes to all actions on all Software) and call it YesToAll.
See To Create a Policy.
Create groups for each pool of servers, and a group called Idle.
For this scenario, call the server groups WebServers and TelnetServers.
See To Create a Group.
In the Idle group, assign a spare server that is your floating server and name it floating.
Write a script that takes the output of your local resource monitoring tool when the load threshold has been passed (either on overload or on idle) and runs a script similar to floatingServers.sh.
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).
If there is an overload on WebServers of TelnetServers, the source is Idle.
If the server groups are idle, the source is the one containing the floating server.
Write your local script to call floatingServers.sh.
./floatingServers.sh source target |
For example, the floatingServers script takes those arguments in the findProfile function, which tells which profile to use in the deployServer function. The profile either installs a web server, a telnet server, or uninstalls server software (to return floating server to idle).
# ./floatingServers.sh Idle WebServers |
#! /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 |
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.