Extracting Resource Allocation Data for Chargeback in a HP Virtual Server Environment for HP Integrity Servers

Elapsed Time :1 second 288 milliseconds
Node :va00np00.zko.hp.com
Status :Complete
Exit Code :0
STDOUT :
Software version: B.08.01
System ID: va00np00
Projected temporary capacity expiration:
N/A
Allocation of Instant Capacity Resources among the nPartitions
--------------------------------------------------------------
Intended Actual
nPar Total Active Active =======Inactive======= Runs
ID Cores Cores Cores Cores Memory Cells iCAP nPar Name
==== ===== ======== ====== ====================== ====
======================
0 4 2 2 2 0.0 GB 0 Yes va00np00
(local)
1 4 2 2 2 0.0 GB 0 Yes va00np10
N/A 0 N/A N/A N/A 0.0 GB 0 N/A Unassigned
Cells
CMS #
An earlier section of this paper provided an example showing how to determine the CPU cores in a
server. The following example extends that script by using mxexec, a Custom Tool, and
icapstatus to also display the number of cores with usage rights. For example:
CMS # cat ./cmplxcores_icap.sh
for i in `mxquery -e "All nPartition Servers" | grep "^DeviceName"
| awk '{print $2}'`; do
printf "%s " $i
let CCPUS=0
for n in `mxquery -e "All nPartitions" | awk -v RS="" '{
printf "%s %s\n",$34,$12}' | grep $i | awk '{print $2}'`; do
let NCPUS=`mxreport -e "CPU - Servers" -x CSV |
grep $n | wc -l`
let CCPUS="$CCPUS + $NCPUS"
done
ULCPUS=`mxexec -t "remote icapstatus" -n $n | grep "Number
of cores without usage rights" | awk '{print $7}'`
let LCPUS="$CCPUS - $ULCPUS"
printf " Physical Cores %d Cores with usage rights %d\n"
$CCPUS $LCPUS
done
CMS #
This command produces the following output:
CMS # ./cmplxcores_icap.sh
va00-cplx_USE4452HL6 Physical Cores 8 Cores with usage rights 4
CMS #
Similarly, the earlier example script that determined the physical memory of a complex can also be
modified to report the amount of memory in the complex that has usage rights:
CMS # cat cmplxmem_icap.sh
54