#!/bin/ksh93 # ALTRAN_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # Copyright (C) Altran ACT S.A.S. 2017,2018,2019,2020,2021. All rights reserved. # # ALTRAN_PROLOG_END_TAG # # IBM_PROLOG_BEGIN_TAG # This is an automatically generated prolog. # # 61haes_r721 src/43haes/lib/ksh93/hacmp/KLIB_HACMP_add_repository.sh 1.29 # # Licensed Materials - Property of IBM # # COPYRIGHT International Business Machines Corp. 2012,2016 # 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 # @(#) 7d4c34b 43haes/lib/ksh93/hacmp/KLIB_HACMP_add_repository.sh, 726, 2147A_aha726, Feb 05 2021 09:50 PM #============================================================================ # # Name: KLIB_HACMP_add_repository # # Description: This is the main, FPATH function that is invoked by clmgr # to add the specified disk, in device name or PVID format, # as a CAA repository disk, whether primary or backup. # # Inputs: See the "devDoc()" function, below. # # Outputs: If the first argument is provided, it is established as # a reference, and all properties about the provided disk # are stored inside of it. Other than that, the only output # is any error messages that might occur. # # Returns: Zero if no errors are detected. Otherwise, an appropriate # non-zero value is returned. Refer to the "RETURN" section # of the "devDoc()" function, below, for the standard return # #============================================================================ function KLIB_HACMP_add_repository { . $HALIBROOT/log_entry "$0()" "$CL" : version=@(#) 7d4c34b 43haes/lib/ksh93/hacmp/KLIB_HACMP_add_repository.sh, 726, 2147A_aha726, Feb 05 2021 09:50 PM : INPUTS: $* typeset -n properties=$1 typeset disks=${2//\"/} disks=${disks##+([[:space:]])} disks=${disks%%+([[:space:]])} disks=${disks//,/ } typeset site=${3//\"/} typeset refnode=${4//\"/} typeset -l disable_validation=${5//\"/} [[ $CLMGR_LOGGING == 'med' ]] && set +x # Only trace param values #=================================== : Declare and initialize variables #=================================== typeset -A properties typeset -i rc=$RC_UNKNOWN typeset -i i=0 typeset IDENTIFIERS= disk= DISK_NAME= DISK_PVID= DISK_UUID= REFNODE= REM= typeset siteOpt="" active_disk="" typeset -A diskAry typeset -i incluster=0 typeset -i cmd_rc=$RC_UNKNOWN typeset -i added_primary_repos=0 typeset -i added_backup_repos=0 typeset NODES=$refnode if [[ $NODES == *([[:space:]]) ]]; then if [[ $site != *([[:space:]]) ]]; then NODES=$(clodmget -n -f nodelist -q name=$site HACMPsite) else NODES=$(clodmget -n -f name -q object=COMMUNICATION_PATH HACMPnode) fi #============================================================ : If the local node is included in the node list, make sure : to put it first in the list. The output/results are more : intuitive to the humans that way. #============================================================ if [[ " $NODES " == *\ $LOCAL_NODE\ * ]] then NODES="$LOCAL_NODE ${NODES/$LOCAL_NODE/}" fi fi NODES=$(CL=$LINENO trim "$NODES") #================================================================ : Check for a defined cluster. No need to continue without one. #================================================================ CL=$LINENO isClusterDefined (( $? != RC_SUCCESS )) && rc=$RC_MISSING_DEPENDENCY #================= : Validate input #================= if [[ -n $disable_validation ]]; then case $disable_validation in @(y|t)* ) disable_validation="true" ;; @(n|f)* ) disable_validation="false" ;; * ) dspmsg -s $CLMGR_SET $CLMGR_MSGS 110 "\nERROR: invalid value specified for \"%1\$s\": \"%2\$s\".\n" "DISABLE_VALIDATION" "$disable_validation" 1>&2 dspmsg -s $CLMGR_SET $CLMGR_MSGS 3 "Valid values: %1\$s\n\n" "false, true" 1>&2 rc=$RC_INCORRECT_INPUT ;; esac fi if (( $rc == RC_UNKNOWN )); then /usr/lib/cluster/incluster 2>/dev/null (( $? == RC_SUCCESS )) && incluster=1 if [[ $disks == *([[:space:]]) ]]; then CL=$LINENO cl_dspmsg -s $CLMGR_SET $CLMGR_MSGS 248 '\nERROR: one or more disks must be specified.\n\n' 1>&2 rc=$RC_MISSING_INPUT fi fi if [[ $disable_validation != "true" ]]; then for disk in $disks; do CL=$LINENO getDiskData "$disk" "$NODES" IDENTIFIERS cmd_rc=$? if (( $cmd_rc == RC_SUCCESS )); then print -- "$IDENTIFIERS" |\ IFS=: read DISK_NAME DISK_PVID DISK_UUID REFNODE REM CL=$LINENO KLIB_HACMP_is_known_repository "$DISK_PVID" "$site" "" "$IDENTIFIERS" cmd_rc=$? if (( $cmd_rc == RC_SUCCESS )); then cl_dspmsg -s $CLMGR_SET $CLMGR_MSGS 416 '\nERROR: an attempt was made to add "%1$s" as a repository, but it is already being used as a repository disk.\n\n' "$disk" 1>&2 rc=$RC_INCORRECT_INPUT elif (( $cmd_rc == RC_ERROR )); then rc=$RC_NOT_FOUND # No such disk found elif (( $cmd_rc == RC_INCORRECT_INPUT )); then rc=$cmd_rc # Disk in use already else ############################################################## # Check if tie-breaker disk is choosen as a repository disk ############################################################## typeset tie_breaker_disk=$(clodmget -n -q policy=tiebreaker -f value HACMPsplitmerge) if [[ $tie_breaker_disk == $DISK_PVID ]]; then cl_dspmsg -s $CLMGR_SET $CLMGR_MSGS 1179 "\nERROR: \"%1\$s\" is configured as a tie-breaker disk and cannot be chosen as a repository disk.\n\n" "$disk" 1>&2 rc=$RC_INCORRECT_INPUT break fi CL=$LINENO KLIB_HACMP_is_known_physical_volume "$DISK_PVID" "$REFNODE" >/dev/null 2>&1 if (( $? != RC_SUCCESS )); then CL=$LINENO cl_dspmsg -s $CLMGR_SET $CLMGR_MSGS 422 '\nERROR: "%1$s" either does not exist, or is not currently available.\n\n' "$disk" 1>&2 rc=$RC_NOT_FOUND else # REPOS_MIN_SIZE is set in func_include CL=$LINENO verify_disk "$DISK_PVID" "$REFNODE" $REPOS_MIN_SIZE cmd_rc=$? if (( $cmd_rc == RC_SUCCESS )); then diskAry[_$disk]=$IDENTIFIERS else rc=$cmd_rc fi fi fi else rc=$cmd_rc break fi done else for disk in $disks; do CL=$LINENO getDiskData "$disk" "$NODES" IDENTIFIERS cmd_rc=$? if (( $cmd_rc == RC_SUCCESS )); then print -- "$IDENTIFIERS" |\ IFS=: read DISK_NAME DISK_PVID DISK_UUID REFNODE REM ############################################################## # Check if tie-breaker disk is choosen as a repository disk ############################################################## typeset tie_breaker_disk=$(clodmget -n -q policy=tiebreaker -f value HACMPsplitmerge) if [[ $tie_breaker_disk == $DISK_PVID ]]; then cl_dspmsg -s $CLMGR_SET $CLMGR_MSGS 1179 "\nERROR: \"%1\$s\" is configured as a tie-breaker disk and cannot be chosen as a repository disk.\n\n" "$disk" 1>&2 rc=$RC_INCORRECT_INPUT break fi # REPOS_MIN_SIZE is set in func_include CL=$LINENO verify_disk "$DISK_PVID" "$REFNODE" $REPOS_MIN_SIZE cmd_rc=$? if (( $cmd_rc == RC_SUCCESS )); then diskAry[_$disk]=$IDENTIFIERS else rc=$cmd_rc fi else rc=$cmd_rc break fi done fi if [[ $CLUSTER_TYPE == "LC" ]]; then if [[ $site == *([[:space:]]) ]]; then cl_dspmsg -s $CLMGR_SET $CLMGR_MSGS 249 "\nERROR: a linked cluster requires one repository disk per site. Please use the SITE option to indicate within which site you intended to add the repository.\n\n" 1>&2 rc=$RC_MISSING_INPUT else CL=$LINENO KLIB_HACMP_is_known_site $site >/dev/null if (( $? != RC_SUCCESS )); then rc=$RC_NOT_FOUND dspmsg -s $CLMGR_SET $CLMGR_MSGS 102 "\nERROR: \"%1\$s\" does not appear to exist!\n\n" "$site" 1>&2 dspmsg -s $CLMGR_SET $CLMGR_MSGS 157 "Available Sites:\n\n" 1>&2 typeset available CL=$LINENO KLIB_HACMP_list_sites available for (( i=0; i<${#available[*]}; i++ )); do if [[ ${available[$i]} != *([[:space:]]) ]]; then print -u2 "\t${available[$i]}" fi done print -u2 "" fi fi elif [[ $site != *([[:space:]]) ]]; then if [[ $CLUSTER_TYPE != "LC" ]]; then cl_dspmsg -s $CLMGR_SET $CLMGR_MSGS 251 '\nERROR: a linked cluster requires one repository per site. Since this cluster was not defined as a linked cluster, it has a cluster type of "%1$s", it requires just one repository disk for the entire cluster. The SITE option is not appropriate for this environment.\n\n' "$CLUSTER_TYPE" 1>&2 rc=$RC_INCORRECT_INPUT fi fi #================================================= : Verify that the disks are appropriately shared #================================================= if (( $rc == RC_UNKNOWN )); then # RC_UNKNOWN means no errors yet if [[ $disable_validation != "true" ]]; then for disk in ${disks//,/ }; do unset DISK_PROPS typeset -A DISK_PROPS CL=$LINENO KLIB_HACMP_get_physical_volume_attributes "$disk" DISK_PROPS "$NODES" if (( ${#DISK_PROPS[*]} == 0 )); then # Only returns props if shared disk rc=$RC_INCORRECT_INPUT if [[ -n $site ]]; then cl_dspmsg -s $CLMGR_SET $CLMGR_MSGS 266 '\nERROR: repository disk "%1$s" is not available on all the nodes in site "%2$s" (%3$s).\n\n' "$disk" "$site" "${NODES//+([[:space:]])/, }" 1>&2 else cl_dspmsg -s $CLMGR_SET $CLMGR_MSGS 241 '\nERROR: repository disk "%1$s" is not available on all the cluster nodes.\n\n' "$disk" 1>&2 fi fi done fi fi #================================================== : Check Availability of 4KDisk Capability #================================================== typeset -i caa_4KDisk_available=0 typeset -i NO_CAA_YET=0 typeset -i flag=0 caa_4kdisk_capability=$(LC_ALL=C cl_get_capabilities -i 4KDISK 2>&1) if (( $? == 0 )) && [[ -n $caa_4kdisk_capability ]] then /usr/lib/cluster/incluster if (( $? != 0 )); then #=============================================================== : The cluster has not been formed yet, and is currently only a : local definition. Knowing this, we can avoid certain tasks. #=============================================================== NO_CAA_YET=1 fi flag=$(echo $caa_4kdisk_capability | awk -F':' '{print $NF}') if (( $NO_CAA_YET == 0 && $flag == 1 )) || (( $NO_CAA_YET == 1 ));then caa_4KDisk_available=1 fi fi #================================================== : Verify disks block size #================================================== for disk in $disks; do getDiskData "$disk" "$NODES" IDENTIFIERS cmd_rc=$? if (( $cmd_rc == RC_SUCCESS )); then print -- "$IDENTIFIERS" |\ IFS=: read DISK_NAME DISK_PVID DISK_UUID REFNODE REM # Find the disk block size on specified node/site if [[ $REFNODE == $LOCAL_NODE ]]; then blk_size=$(cl_querypv -b $DISK_NAME) else blk_size=$(cl_rsh -n $REFNODE /usr/es/sbin/cluster/events/utils/cl_querypv -b $DISK_NAME) fi if [[ -z $blk_size ]]; then print "$0()($SECONDS): cl_querypv -b $DISK_NAME. The block size of disk $DISK_NAME is NULL.This is due to failure in cl_querypv." >>$CLMGR_TMPLOG cl_dspmsg -s $CLMGR_SET $CLMGR_MSGS 1218 "\nERROR: The block size of disk %1\$s is NULL.\n\ This is due to failure in cl_querypv.\n\n" "$DISK_NAME" 1>&2 rc=$RC_INCORRECT_INPUT elif (( $blk_size == 4096 && caa_4KDisk_available == 0 )); then print "$0()($SECONDS): cl_querypv -b $DISK_NAME. The block size of disk $DISK_NAME is $blk_size, but CAA does not support \n\ 4KDISK on this AIX level. Please redefine the disk using a supported block size. " >>$CLMGR_TMPLOG cl_dspmsg -s $CLMGR_SET $CLMGR_MSGS 1222 "\nERROR: The block size of disk %1\$s is %2\$d, but CAA does not support \n\ 4KDISK on this AIX level. Please redefine the disk using a supported block size.\n\n" "$DISK_NAME" "$blk_size" 1>&2 rc=$RC_INCORRECT_INPUT elif (( caa_4KDisk_available == 1 && $blk_size != 4096 && $blk_size != 512 )); then print "$0()($SECONDS): cl_querypv -b $DISK_NAME. The block size of disk $DISK_NAME is $blk_size, but CAA supports \n\ disks with a block size of 4K and 512 bytes. Please redefine the disk using a supported block size." >>$CLMGR_TMPLOG cl_dspmsg -s $CLMGR_SET $CLMGR_MSGS 1223 "\nERROR: The block size of disk %1\$s is %2\$d, but CAA supports \n\ disks with a block size of 4K and 512 bytes. Please redefine the disk using a supported block size.\n\n" "$DISK_NAME" "$blk_size" 1>&2 rc=$RC_INCORRECT_INPUT elif (( $blk_size != 512 && caa_4KDisk_available == 0 )); then print "$0()($SECONDS): cl_querypv -b $DISK_NAME. The block size of disk $DISK_NAME is $blk_size. CAA only supports disks with a blo ck size of 512 bytes." >>$CLMGR_TMPLOG cl_dspmsg -s $CLMGR_SET $CLMGR_MSGS 1217 "\nERROR: The block size of disk %1\$s is %2\$d. CAA only supports\n\ disks with a block size of 512 bytes.\n\n" "$DISK_NAME" "$blk_size" 1>&2 rc=$RC_INCORRECT_INPUT fi else print "$0()($SECONDS): Unable to read disk data for $disk due to failure in getDiskData." >>$CLMGR_TMPLOG cl_dspmsg -s $CLMGR_SET $CLMGR_MSGS 1219 "\nError: Unable to read disk data for %1\$s due\n\ to failure in getDiskData.\n\n" "$disk" fi done #============================================================== : If all the specified disks are valid, perform the additions #============================================================== if (( $rc == RC_UNKNOWN )); then # RC_UNKNOWN means no errors yet #=============================================== : If the CAA cluster has not been created yet, : define the active repository disk. #=============================================== [[ $site != *([[:space:]]) ]] && siteOpt=" -S $site" active_disk=${disks%%+([[:space:]])*} typeset orig_active_disk=$active_disk disks=${disks#$active_disk} # Remove the disk from the list disks=${disks##+([[:space:]])} # Remove leading whitespace print -- "${diskAry[_$active_disk]}" |\ IFS=: read active_disk DISK_PVID DISK_UUID REFNODE REM typeset ACTIVE_REPOS= if [[ -n $site ]]; then ACTIVE_REPOS=$(clodmget -n -q name=${site}_sircol -f repository HACMPsircol) else ACTIVE_REPOS=$(clodmget -n -f repository HACMPsircol) fi #=============================================================== : The number of backup repository must not exceed : - $MAX_NB_OF_BACKUP_REPOSITORIES per cluster for NSC and SC : - $MAX_NB_OF_BACKUP_REPOSITORIES per site for LC #=============================================================== if [[ -z $ACTIVE_REPOS ]]; then #========================================================= : No primary/active repository disk has been defined yet #========================================================= REFNODE=${REFNODE%%\.*} print "$0()[$LINENO]($SECONDS): clmanagerepos -a -d $DISK_PVID -n $REFNODE$siteOpt" >>$CLMGR_TMPLOG clmanagerepos -a -d $DISK_PVID -n $REFNODE$siteOpt rc=$? print "$0()[$LINENO]($SECONDS): clmanagerepos RC: $rc" >>$CLMGR_TMPLOG # Always log command result (( $rc == RC_SUCCESS )) && added_primary_repos=1 # : There is not yet an active repository. : $disks contains only backup repositories. : There must not be over $MAX_NB_OF_BACKUP_REPOSITORIES # typeset -i NB_NEW_BACKUP_REPOS=$(print $disks | wc -w) if (( $NB_NEW_BACKUP_REPOS > $MAX_NB_OF_BACKUP_REPOSITORIES )) then if [[ $CLUSTER_TYPE == "LC" ]]; then cl_dspmsg -s $CLMGR_SET $CLMGR_MSGS 1001 '\nERROR: a linked cluster cannot get more than "%1$s" backup repositories per site (there were "%2$s" backup repositories, and you want to add "%3$s" backup repositories).\n\n' "$MAX_NB_OF_BACKUP_REPOSITORIES" "${NB_OLD_BACKUP_REPOS}" "${NB_NEW_BACKUP_REPOS}" 1>&2 else cl_dspmsg -s $CLMGR_SET $CLMGR_MSGS 1002 '\nERROR: a no-site cluster or a stretched cluster cannot get more than "%1$s" backup repositories (there were "%2$s" backup repositories, and you want to add "%3$s" backup repositories).\n\n' "$MAX_NB_OF_BACKUP_REPOSITORIES" "${NB_OLD_BACKUP_REPOS}" "${NB_NEW_BACKUP_REPOS}" 1>&2 fi rc=$RC_INCORRECT_INPUT fi else # : There is yet an active repository. : $disks contains only backup repositories. : Added to the existing backup repositories, there must not be over $MAX_NB_OF_BACKUP_REPOSITORIES # # : Fist step is to count the number of existing backup repository # if [[ -n $site ]]; then OLD_BACKUP_REPOS=$(clodmget -n -q name=${site}_sircol -f backup_repository HACMPsircol) else OLD_BACKUP_REPOS=$(clodmget -n -f backup_repository HACMPsircol) fi typeset -i NB_OLD_BACKUP_REPOS=$(echo $OLD_BACKUP_REPOS | wc -w) NB_OLD_BACKUP_REPOS=${NB_OLD_BACKUP_REPOS:-0} # : Second step is to count the number of new backup repository # NEW_BACKUP_REPOS=$disks disks="$orig_active_disk $disks" typeset -i NB_NEW_BACKUP_REPOS=$(print $disks | wc -w) # : Third step is to sum # typeset -i NB_BACKUP_REPOS=$((NB_NEW_BACKUP_REPOS+NB_OLD_BACKUP_REPOS)) if (( $NB_BACKUP_REPOS > $MAX_NB_OF_BACKUP_REPOSITORIES )); then if [[ $CLUSTER_TYPE == "LC" ]]; then cl_dspmsg -s $CLMGR_SET $CLMGR_MSGS 1001 '\nERROR: a linked cluster cannot get more than "%1$s" backup repositories per site (there were "%2$s" backup repositories, and you want to add "%3$s" backup repositories).\n\n' "$MAX_NB_OF_BACKUP_REPOSITORIES" "${NB_OLD_BACKUP_REPOS}" "${NB_NEW_BACKUP_REPOS}" 1>&2 else cl_dspmsg -s $CLMGR_SET $CLMGR_MSGS 1002 '\nERROR: a no-site cluster or a stretched cluster cannot get more than "%1$s" backup repositories (there were "%2$s" backup repositories, and you want to add "%3$s" backup repositories).\n\n' "$MAX_NB_OF_BACKUP_REPOSITORIES" "${NB_OLD_BACKUP_REPOS}" "${NB_NEW_BACKUP_REPOS}" 1>&2 fi rc=$RC_INCORRECT_INPUT fi fi if [[ $rc != $RC_INCORRECT_INPUT && $disks != *([[:space:]]) ]]; then #=========================================================== : Loop through the backup disks and add them one at a time #=========================================================== for disk in $disks; do print -- "${diskAry[_$disk]}" |\ IFS=: read disk DISK_PVID DISK_UUID REFNODE REM typeset nOpt="" [[ -z $REFNODE && -n $refnode ]] && REFNODE=$refnode [[ -n $REFNODE ]] && nOpt=" -n $REFNODE" #check if any leftover VGDA available on disk typeset check_vgda=$(readvgda $disk 2>/dev/null | grep '^version:') if [[ -n "$check_vgda" ]];then dspmsg -s $CLMGR_SET $CLMGR_MSGS 1450 "\nERROR: You have asked to add disk \"%1\$s\" as repository disk, but it appears to have leftover VGDA information on it.\n\ Select a different disk or clear the VGDA information on the disk using \"chpv -C %1\$s\" and try adding again.\n" "$disk" 1>&2 continue fi print "$0()[$LINENO]($SECONDS): clmanagerepos -a -d $DISK_PVID$nOpt$siteOpt" >>$CLMGR_TMPLOG clmanagerepos -a -d $DISK_PVID$nOpt$siteOpt rc=$? print "$0()[$LINENO]($SECONDS): clmanagerepos RC: $rc" >>$CLMGR_TMPLOG # Always log command result if (( $rc == RC_SUCCESS )) then added_backup_repos=1 else added_backup_repos=0 break fi done fi fi #======================================================================= : If a user input error was detected, provide some helpful suggestions #======================================================================= if (( $rc == RC_MISSING_INPUT || $rc == RC_INCORRECT_INPUT )) && \ [[ $CLMGR_GUI == *([[:space:]]) ]] then CL=$LINENO cl_dspmsg -s $CLMGR_SET $CLMGR_MSGS 104 "For more information about available options and syntax, try\n\"$HAUTILS/clmgr %1\$s\". As an\nalternative, if the PowerHA SystemMirror man pages have been installed, invoke\n\"$HAUTILS/clmgr -hv\" (or \"/usr/bin/man clmgr\"),\nsearching for \"%2\$s\" in the displayed text.\n\n" \ "add repository -h" "REPOSITORY:" "$CLMGR_PROGNAME" 1>&2 elif (( $rc == RC_SUCCESS )) then if [[ $CLUSTER_TYPE == "LC" ]]; then (( added_primary_repos )) && dspmsg -s $CLMGR_SET $CLMGR_MSGS 1440 "Successfully added a primary repository disk for site \"%1\$s\".\n" "$site" (( added_backup_repos )) && dspmsg -s $CLMGR_SET $CLMGR_MSGS 1441 "Successfully added one or more backup repository disks for site \"%1\$s\".\n" "$site" else (( added_primary_repos )) && dspmsg -s $CLMGR_SET $CLMGR_MSGS 782 "Successfully added a primary repository disk.\n" (( added_backup_repos )) && dspmsg -s $CLMGR_SET $CLMGR_MSGS 783 "Successfully added one or more backup repository disks.\n" fi (( added_primary_repos + added_backup_repos )) && dspmsg -s $CLMGR_SET $CLMGR_MSGS 1003 "To view the complete configuration of repository disks use:\n\"clmgr query repository\" or \"clmgr view report repository\"\n" fi log_return_msg "$rc" "$0()" "$LINENO" return $? } # End of "KLIB_HACMP_add_repository()" #============================================================================ # # Name: devDoc # # Description: This is a never-to-be-called, wrapper function that all the # clmgr FPATH functions implement in order to hide embedded # syntax from trace logging. This information is implemented # in POD format, and can be viewed in a number of ways using # POD tools. Some viewing suggestions for this function's POD- # formatted information are: # # perldoc # pod2text -c # pod2text -c --code # pod2html # # However, the more important use for this information is that # it is parsed by clmgr to display the syntax for this file's # operation. The information in the "SYNOPSIS" section is used # for this purpose. This feature was originally implemented # using the man page information. However, in a code review it # was pointed out that this approach had to be changed because # customers do not have to install the man pages! Therefore, a # built-in dependency on man page information would break the # automatic help feature of clmgr. So the SYNPOSIS section must # be used instead. # # IMPORTANT: As a result of this, it is imperative that the # information in this SYNOPSIS be kept in sync # with the man page information, which is owned # by the IDD team. # # Inputs: None. # # Outputs: None. # # Returns: n/a (not intended to be invoked) # #============================================================================ function devDoc { : <<'=cut' >/dev/null 2>&1 =head1 NAME KLIB_HACMP_add_repository =head1 VERSION Version Number: 1.29 Last Extracted: 5/3/16 18:53:58 Last Changed: 4/21/16 05:28:27 Path, Component, Release(, Level): src/43haes/lib/ksh93/hacmp/KLIB_HACMP_add_repository.sh, hacmp.assist, 61haes_r721, 1618A_hacmp721 =head1 SYNOPSIS clmgr add repository [,,...] \ [ SITE= ] \ [ NODE= ] \ [ DISABLE_VALIDATION={false|true} ] NOTE: the first disk will be used as the active repository, if an active repository is not already defined. Any other disks in the list will be defined as backup repository disks. NOTE: the alias for "repository" is "rp". =head1 DESCRIPTION Attempts to add the specified repository disk(s). =head1 ARGUMENTS 1. disks [OPTIONAL] [string] One or more disks to use as repositories. This value may be the device name, PVID, or UUID. Any appropriate, required format conversion will be done automatically. If no CAA cluster has been created yet, the first disk in this comma-separated list will be defined as the active repository. Any other disks will be defined as backup repository disks. For "NSC" or "SC" cluster, no more than MAX_NB_OF_BACKUP_REPOSITORIES backup repository disks may be defined per cluster. For "LC" cluster, no more than MAX_NB_OF_BACKUP_REPOSITORIES backup repository disks may be defined per site. 2. site [OPTIONAL] [string] The label of the site that this repository supports. This is only needed/valid for a linked cluster environment. 3. refnode [OPTIONAL] [string] The label of node to use as a reference for resolving the specified disk names. This is only useful if device names are specified instead of PVIDs. If no reference node is provided, an effort is made to automatically find a suitable reference node. 4. disable_validation [OPTIONAL] [boolean] Indicates whether or not to validate the specified disk(s). This may be safe to use when the disk(s) are specified in PVID or UUID form, but is generally not safe to use when the disk(s) are specified in device name form (i.e. hdisk#). The default value is "false". =head1 RETURN 0: no errors were detected; the operation appears to have been successful 1: a general error has occurred 2: a specified resource does not exist, or could not be found 3: some required input was missing 4: some detected input was incorrect in some way 5: a required dependency does not exist 6: a specified search failed to match any data =head1 COPYRIGHT COPYRIGHT International Business Machines Corp. 2005,2010 All Rights Reserved =cut } # End of "devDoc()" #============================================================================== # The following, comment block attempts to enforce coding standards when this # file is edited via emacs or vim. This block _must_ appear at the very end # of the file, or the editor will not find it, and it will be ignored. #============================================================================== # Local Variables: # indent-tabs-mode: nil # tab-width: 4 # End: #============================================================================== # vim: tabstop=4 shiftwidth=4 expandtab #==============================================================================