#!/bin/ksh93
# IBM_PROLOG_BEGIN_TAG 
# This is an automatically generated prolog. 
#  
# 61haes_r720 src/43haes/usr/sbin/cluster/events/utils2/cl_compute_roha.sh 1.2 
#  
# Licensed Materials - Property of IBM 
#  
# Restricted Materials of IBM 
#  
# COPYRIGHT International Business Machines Corp. 2015 
# All Rights Reserved 
#  
# US Government Users Restricted Rights - Use, duplication or 
# disclosure restricted by GSA ADP Schedule Contract with IBM Corp. 
#  
# IBM_PROLOG_END_TAG 
###############################################################################
# @(#)27  1.2  src/43haes/usr/sbin/cluster/events/utils2/cl_compute_roha.sh, hacmp.events, 61haes_r720, 1531A_hacmp720 7/13/15 10:39:16
###############################################################################

#########################################################################
#
#   COMPONENT_NAME: hacmp.events
#
#   DESCRIPTION:
#
#       This script is one of the scripts dedicated to the management of
#       Resource Optimized High Availability (ROHA) functionality for the
#       account of PowerHA SystemMirror.
#
#   FUNCTIONS:
#
#       cl_compute_roha
#
#   NOTE:
#
#       This file should not be called directly. It should be accessed
#       through FPATH environment variable. It also needs that file
#       /usr/es/sbin/cluster/events/utils/clcommonroha is sourced before
#       calling this function. Some global variables need to be exported.
#
#########################################################################

#================================================
# The following, commented line enforces coding
# standards when this file is edited via vim.
#================================================
# vim:tabstop=4:shiftwidth=4:expandtab:smarttab
#================================================

#=============================================================================
#
# Name:        cl_compute_roha
#
# Description: Determine how many total ROHA resources will be needed to reach
#              the required amount. First, consider memory resources. Then,
#              consider processors resources.
#
# Inputs:      None
#
# Outputs:     None
#
# Globals:     None
#
# Returns:     RC_SUCCESS
#              or else error code for compute step
#
#=============================================================================
function cl_compute_roha
{
    [[ $VERBOSE_LOGGING == high ]] && set -x
    : version=1.2, src/43haes/usr/sbin/cluster/events/utils2/cl_compute_roha.sh, hacmp.events, 61haes_r720, 1531A_hacmp720

    typeset -i rc=$RC_SUCCESS

    roha_compute_mem
    (( rc += $? ))
    roha_compute_mem_report

    roha_compute_cpu
    (( rc += $? ))
    roha_compute_cpu_report

    return $rc
} # End of "cl_compute_roha()"
