Powerpath and AIX

INSTALLATION:
Prereq Files:
EMCpower.base 3.0.0.0
EMCpower.multi_path_clariio 3.0.0.0
EMCpower.multi_path 3.0.0.0
EMCpower.consistency_grp 3.0.0.0

Register PowerPath on the host: emcpreg -install (Enter the 12-character license key)

Validate your registration number using :powermt check_registration

To initialize devices at the command line :powermt config

Commands:

# emc_cfgmgr
# powermt display dev=all
# powermt config
# powermt display
# powermt remove hba=hba#
# powermt restore
# powermt check

How to uninstall –

Stop all applications/processes that access powerpath hdiskpower device.
Varyoff volumegroups that contains hdiskpower device (or) remove hdiskpower devices from the volumegroups
Uninstall powerpath filesets using or use SMIT
# installp –u EMCpower

To remove powerpath from the system entirely, remove the file “/etc/emcp_registration”

Remove ESS LUN from host

Remove  ESS  LUN from one host and assign it to another

/usr/sbin/reducevg  <vg name>  vpath4

#lsvpcfg

vpath4 (Avail pv ) 30420723 = hdisk6 (Avail ) hdisk16 (Avail )

# rmdev  -l ‘vpath4’  ‘-d’

vpath4 deleted

# Run cfgmgr

cplv to move a logical volume from one vg to another

Get log list: lsvg -o | lsvg -l -i | grep log
mklv -t jfslog -y loglv02 -a’c’ newvg 1 hdiskpower0
/usr/sbin/logform /dev/loglv02

don’t move logs (make new one – above)
don’t move paging (make new paging)
LOOP FOR EACH LV
umount /
# XX comes from PP field in “lsvg -l oldvg”
mklv -t copy -y’tinfprdlv’ newvg XX hdiskpowerX
cplv -e tinfprdlv -f infprdlv
chlv -n oinfprdlv infprdlv
chlv -n infprdlv tinfprdlv
chfs -a dev=/dev/infprdlv /infoprod
chfs -a log=/dev/loglv02 /infoprod

mount /infoprod
lsvg -l newvg |grep infoprod

TSM restore to differnt node

Although there is an option to give access to another node in TSM client, but if you doesn’t know remote node’s password and need to restore remote’s nodes data localy, simply modify dsm.sys w/ vi editor and bounce the client. eg –

  • There are two nodes – node A and node B
  • You want to restore node A data on node B
  • Modify dsm.sys on node B as NODENAME nodeA (Default loc: /usr/tivoli/tsm/client/ba/bin)
  • Bounce the client ( ps -ef | grep dsmcad  and  kill < dsmcad pid>)
  • Start web client for node B, you will see all dirs for node A
  • Select destination directory and restore it w/ option – restore without base dir
  • Make sure to modify dsm.sys back to node A once restore is done or else next backup will be a mess <—this is imp point.
  • This method is the last option to do so andIf you could always use following on client cmd line though –

dsmc -virtualnodename=nodeA
tsm> restore -subdir=yes “/path/to/fileOrDirFromA/*” /tmp/newDir

  • W/ 5.4, TSM also allows to select differnt node in client web GUI, I believe its under utlities –> access another node.

AIX rdist Script to sync users acrosse hosts

# cron following as a script

rdist -b -y -f /usr/local/bin/distfile

#:more /usr/local/bin/distfile
HOSTS = (< > < >)
FILES = (/etc/group /etc/passwd /etc/security/group /etc/security/environ /etc/s
ecurity/passwd /etc/security/limits /etc/security/user /etc/sudoers  )
${FILES} -> ${HOSTS}

HMC Commands

lshmc –n (lists dynamic IP addresses served by HMC)
lssyscfg –r sys –F name,ipaddr (lists managed system attributes)
lssysconn –r sys (lists attributes of managed systems)
lssysconn –r all (lists all known managed systems with attributes)
rmsysconn –o remove –ip (removes a managed system from the HMC)
mkvterm –m {msys} –p {lpar} (opens a command line vterm from an ssh session)
rmvterm –m {msys} –p {lpar} (closes an open vterm for a partition)
Activate a partition
chsysstate –m managedsysname –r lpar –o on –n partitionname –f profilename –b normal
chsysstate –m managedsysname –r lpar –o on –n partitionname –f profilename –b sms
Shutdown a partition
chsysstate –m managedsysname –r lpar –o {shutdown/ossshutdown} –n partitionname [-immed][-restart]
VIO Server Commands
lsdev –virtual (list all virtual devices on VIO server partitions)
lsmap –all (lists mapping between physical and logical devices)
oem_setup_env (change to OEM [AIX] environment on VIO server)
Create Shared Ethernet Adapter (SEA) on VIO Server
mkvdev –sea{physical adapt} –vadapter {virtual eth adapt} –default {dflt virtual adapt} –defaultid {dflt vlan ID}
SEA Failover
ent0 – GigE adapter
ent1 – Virt Eth VLAN1 (Defined with a priority in the partition profile)
ent2 – Virt Eth VLAN 99 (Control)
mkvdev –sea ent0 –vadapter ent1 –default ent1 –defaultid 1 –attr ha_mode=auto ctl_chan=ent2
(Creates ent3 as the Shared Ethernet Adapter)
Create Virtual Storage Device Mapping
mkvdev –vdev {LV or hdisk} –vadapter {vhost adapt} –dev {virt dev name}
Sharing a Single SAN LUN from Two VIO Servers to a Single VIO Client LPAR
hdisk = SAN LUN (on vioa server)
hdisk4 = SAN LUN (on viob, same LUN as vioa)
chdev –dev hdisk3 –attr reserve_policy=no_reserve (from vioa to prevent a reserve on the disk)
chdev –dev hdisk4 –attr reserve_policy=no_reserve (from viob to prevent a reserve on the disk)
mkvdev –vdev hdisk3 –vadapter vhost0 –dev hdisk3_v (from vioa)
mkvdev –vdev hdisk4 –vadapter vhost0 –dev hdisk4_v (from viob)
VIO Client would see a single LUN with two paths.
spath –l hdiskx (where hdiskx is the newly discovered disk)
This will show two paths, one down vscsi0 and the other down vscsi1.
AIX Performance TidBits and Starter Set of Tuneables
Current starter set of recommended AIX 5.3 Performance Parameters. Please ensure you test these first before implementing in production as your mileage may vary.
Network
no –p –o rfc1323=1
no –p –o sb_max=1310720
no –p –o tcp_sendspace=262144
no –p –o tcp_recvspace=262144
no –p –o udp_sendspace=65536
no –p –o udp_recvspace=655360
nfso –p –o rfc_1323=1
NB Network settings also need to be applied to the adapters
nfso –p –o nfs_socketsize=600000
nfso –p –o nfs_tcp_socketsize=600000
Memory Settings
vmo – p –o minperm%=5
vmo –p –o maxperm%=80
vmo –p –o maxclient%=80
Let strict_maxperm and strict_maxclient default
vmo –p –o minfree=960
vmo –p –o maxfree=1088
vmo –p –o lru_file_repage=0
vmo –p –o lru_poll_interval=10
IO Settings
Let minpgahead and J2_minPageReadAhead default
ioo –p –o j2_maxPageReadAhead=128
ioo –p –o maxpgahead=16
ioo –p –o j2_maxRandomWrite=32
ioo –p –o maxrandwrt=32
ioo –p –o j2_nBufferPerPagerDevice=1024
ioo –p –o pv_min_pbug=1024
ioo –p –o numfsbufs=2048
If doing lots of raw I/O you may want to change lvm_bufcnt
Default is 9
ioo –p –o lvm_bufcnt=12
Others left to default that you may want to tweak include:
ioo –p –o numclust=1
ioo –p –o j2_nRandomCluster=0
ioo –p –o j2_nPagesPerWriteBehindCluster=32
Useful Commands
vmstat –v or –l or –s lvmo
vmo –o iostat (many new flags)
ioo –o svmon
schedo –o filemon
lvmstat fileplace

Rsync with expect to pass password on AIX

#!/usr/bin/expect -f
set timeout -1
# now connect to remote UNIX box with given script to execute
spawn rsync -avzW –stats <local dir> id@remotehost: <remote dir>
match_max 100000
# Look for passwod prompt
expect “*?assword:*”
# Send password aka $password
send — “<password>\r”
# send blank line (\r) to make sure we get back to gui
send — “\r”
expect eof

This script can be a  cron  schedule.  For security reasons, I would still prefer to exchange public private keys to schedule rsync but for some reasons (as in my case remote host was behind DMZ and could see only gateway IPs as an IP of my local machine).  We can always revoke permissions to this script as 600 to not to show pwd to others. I’ll post “how to” generate (key-gen) and exchange public/ private keys later.

Posted in AIX. 1 Comment »

Install expect on AIX

ftp ftp.software.ibm.com
cd /aix/freeSoftware/aixtoolbox/RPMS/ppc/tcltk
bin
prompt
mget expect-5.42.1-3.aix5.1.ppc.rpm tcl-8.4.7-3.aix5.1.ppc.rpm tk-8.4.7-3.aix5.1.ppc.rpm

bye

Network – common line designations

  • DS0 – 64 kilobits per second
  • ISDN – Two DS0 lines plus signaling (16 kilobytes per second), or 128 kilobits per second
  • T1 – 1.544 megabits per second (24 DS0 lines)
  • T3 – 43.232 megabits per second (28 T1s)
  • OC3 – 155 megabits per second (84 T1s)
  • OC12 – 622 megabits per second (4 OC3s)
  • OC48 – 2.5 gigabits per seconds (4 OC12s)
  • OC192 – 9.6 gigabits per second (4 OC48s)

Add volumes to TSM server primary storagepool -disk storage volume

Our TSM server is hosted on AIX 5.3 attached to fastT and ESS shark.

Add LUN from SAN. Our TSM server is attached to fastT as well as ESS shark. In this example I’ve already created a 500 gb LUN from fastT and assigned to tsm server. (some other time I’ll blog about how to assign lun to host)

Anyway here we are …

#fget_config -Av
hdisk73 dac1 2 tsmpool_tsm640

Within than LUN, create a VG and create lv and file system. I’ve created five LVs- file systems on AIX server which servers as our TSM server
#lsvg -l poolvg
poolvg:
LV NAME TYPE LPs PPs PVs LV STATE MOUNT POINT
loglv02 jfs2log 1 1 1 open/syncd N/A
fslv05 jfs2 3040 3040 1 open/syncd /tsm/pool01
fslv06 jfs2 3040 3040 1 open/syncd /tsm/pool02
fslv07 jfs2 3040 3040 1 open/syncd /tsm/pool03
fslv08 jfs2 3040 3040 1 open/syncd /tsm/pool04
fslv09 jfs2 3040 3040 1 open/syncd /tsm/pool05

With TSM 5.5, I still like to use old TSM console, so within TSM server console go to Object view–> Server Storage –> define disk storage volume –> Enter following details

Storage Pool Name: The name of the storage pool to which the volume will be assigned is displayed.
Volume Name: Enter the name of the storage pool volume. This name is required. The name is dependent on the operating system.

I created 10 volumes within each file system of approx 10 gig each w/ name /tsm/pool01/disk01 – /tsm/pool01/disk10 repeated same thing for other file systems.

Note that Formatting the volumes take some time as it is done as an internal TSM activity. You can see these volumes thru AIX cmd line as well –

# cd /tsm/pool01
# ls
disk01 disk03 disk05 disk07 disk09
disk02 disk04 disk06 disk08 lost+found

DONT FORGET TO ADD THESE FILES TO EXCLUDE list in dsm.sys if you back your tsm server itself.

exclude.fs /tsm/pool01
exclude.fs /tsm/pool02
exclude.fs /tsm/pool03
exclude.fs /tsm/pool04
exclude.fs /tsm/pool05