Main Menu

KB#01220-Live Migration Cron Job Script for Virtual Licensing

Title:

Live Migration Cron Job Script for Virtual Licensing

Description:

Virtual Licensing was introduced in BBj 10 and (V)PRO/5. Virtual Licenses allows the BASIS License Manager (BLM)to start and run in the different hardware profiles that are characterstic of the 'guest' operating systems of virtual machines. 

However, in order for the BLM to recognize the hardware profile has changed, it must be restarted. This poses a problem for virtual deployments where 'Live Migrations' of guest operating systems are required. A Live Migration is the act of moving a running guest OS to another host OS. Since the BLM has not been restarted it is unable to recognize the hardware profile change and is thus unable to register for a new license that matches the new hardware.

Resolution:

The following script can be called from a cron job to periodically scan the BLM log for the tell-tale errors associated with this scenario. The script is designed to work with the BLM bundled with the BASIS Product Suite install and must be placed in the <bbjhome>/bin directory of the install. 

============================================== 

#!/bin/sh 

# Find bbjHome 
# - this script is installed in ${bbjHome}/bin 
# -------------------------------------------- 
mydir="`dirname $0`" 
myname="`basename $0 .sh`" 

# If the baseDir is relative, we need to prepend the 
# current working directory. 
myfirst="`echo ${mydir} | cut -c 1-1`" 
if [ "${myfirst}" != "/" ] 
then 
# Adding current directory to full path 
if [ "${mydir}" = "." ] 
then 
# Change current directory to full path 
mydir="`pwd`" 
else 
# Prepend current directory to get full path 
mydir="`pwd`/${mydir}" 
fi 
fi 
# Otherwise, mydir is already a full path 

# OK, now we can strip the "/bin" off the dir path 
bbjHome="`dirname ${mydir}`" 


# These are based off the bbjHome 
# ------------------------------- 
BinDir="${bbjHome}/bin" 
BLMDir="${bbjHome}/blm" 
BLMLogDir="${BLMDir}/log" 
LogFile="${BLMLogDir}/blm.log" 

# if we want to see the output from lmutil lmdown, 
# change this to a file. 
dbgFile="/dev/null" 

# Need to detect the hardware switch 
# ---------------------------------- 
if `grep basis ${LogFile} | grep "Wrong hostid on SERVER line" > /dev/null` 
then 
wrongHID="true" 
else 
wrongHID="false" 
fi 

if [ "${wrongHID}" = "true" ] 
then 
# Make sure the BLM is down 
# ------------------------- 
cd ${BLMDir} 
./lmutil lmdown -q >> ${dbgFile} 

# Start the BLM 
# ------------- 
cd ${BinDir} 
./basisrunlm >> ${dbgFile} 
fi 
# Otherwise everything is ok



Last Modified: 11/09/2010 Product: BBj Operating System: N/A

BASIS structures five components of their technology into the BBx Generations.

  Google+ View BASIS LinkedIN ProfileVisit our Twitter Feed Check out our Facebook Public Profile Click to View the BASIS youTube channel