Home About BC DR HA Support Training Download
You are here: Home/ GlobalSysAdmin/ AIX/ Please Login or Register

-
Current Location
-

js
  GlobalSysAdmin
    AIX
-
AIX Admin Methodology
Global Consolidation Project
All AIX admins should join
www.aixexpert.com


Join our LinkedIn Group
AIX Advanced Technical Experts
Contract Opportunities

www.LinkedIn.com

-
digg Digg this page
del.icio.us Post to del.icio.us
Slashdot Slashdot it!


LPAR Leasing
Lease an AIX / i5 LPAR
Reduce your costs

www.mtxia.com

Server Leasing
Lease a Server off-site
Reduce your costs

www.mtxia.com

Data Center Automation
Business Continuity and DR
Virtualization/Consolidation

www.mtxia.com

HMC Service
Hardware Management Console
Manage Remote AIX / i5 LPARs

www.siteox.com

Business Web Site Hosting
$3.99 / month includes Tools,
Shopping Cart, Site Builder

www.siteox.com

Disaster Recovery
Small Business Oriented
Off-Site Facilities

www.mtxia.com

IBM pSeries / iSeries
Reduce your Costs
Off-Site Server Hosting

www.mtxia.com



#!/usr/bin/ksh93
################################################################
####
#### Program: mapluns.sh
####
#### Description: The purpose of this script is to map the
#### disks from a VIO server to their respective virtual SCSI
#### slot numbers, virtual adapters, and LDEV numbers.
####
#### This script is intended to be run on a VIO server in the
#### "oem_setup_env" environment. The output from this script
#### is a table of information containing the name of the VIO
#### server, hdisk name, virtual adapter name, virtual slot
#### number, and the SAN LDEV ID.
####
#### Author: Dana French
####         (Copyright 2005)
####
#### Date: 08/10/2005
####  
################################################################

IFS=$'\n'
LSMAP=( $( /usr/ios/cli/ioscli lsmap -all ) )
HOSTID=$( hostname )
HDISK=""  VHOST=""  VSLOT=""  LDEV=""  

print -u 2 "# hostname:hdisk:vadapter:vslot:ldev:"

for MAPLN in "${LSMAP[@]//Backing device/BackingDevice}"
do

  [[ "_${MAPLN}" != _@(vhost|BackingDevice)* ]] && continue

  if [[ "_${MAPLN}" = _vhost* ]]
  then
    VHOST=${MAPLN%%[$' \t']*}
    VHOST=${VHOST#*[$' \t']}
    VSLOT=${MAPLN##*-}
    VSLOT=${VSLOT%%[$' \t']*}
    continue
  fi

  HDISK=${MAPLN##*[$' \t']}
  TMPDISK="${HDISK}"

  if [[ "_${TMPDISK}" = _dlmfdrv* ]]
  then
    TMPDISK=$( /usr/DynamicLinkManager/bin/dlnkmgr view -drv |
       grep "${TMPDISK}" |
       awk '{ print $3 }' |
       head -1 )
  fi 

  LSCFG=( $( lscfg -vl ${TMPDISK} ) )

  for LINE in "${LSCFG[@]}"
  do
    if [[ "_${LINE}" = *\(Z1\)* ]]
    then
      LDEV=${LINE#*\(Z1\)}
      LDEV=${LDEV//./}
      LDEV=${LDEV%%[$' \t']*}
    fi   
  done

  print -u 2 "# ${HOSTID}:${HDISK}:${VHOST}:${VSLOT}:${LDEV}:"
  print "/usr/ios/cli/ioscli mkvdev -vdev ${HDISK} -vadapter ${VHOST} -dev v${HDISK}"

#   HDISK=""  VHOST=""  VSLOT=""  LDEV=""
  HDISK=""  LDEV=""

done


This file last modified 11/02/10

-
VIO LUN Mapper
-
 


LPAR Leasing
Lease an AIX / i5 LPAR
Reduce your costs

www.mtxia.com

Server Leasing
Lease a Server off-site
Reduce your costs

www.mtxia.com

Data Center Automation
Business Continuity and DR
Virtualization/Consolidation

www.mtxia.com

HMC Service
Hardware Management Console
Manage Remote AIX / i5 LPARs

www.siteox.com

Business Web Site Hosting
$3.99 / month includes Tools,
Shopping Cart, Site Builder

www.siteox.com

FREE Domain Registration
included with Web Site Hosting
Tools, Social Networking, Blog

www.siteox.com

Disaster Recovery
Small Business Oriented
Off-Site Facilities

www.mtxia.com

IBM pSeries / iSeries
Reduce your Costs
Off-Site Server Hosting

www.mtxia.com