PowerVM Demos/Videos

The following IBM link will help you in understanding PowerVM concepts,
http://www.ibm.com/developerworks/wikis/display/WikiPtype/Movies

Error Codes

Display Error Codes
214,2C5,2C6,2C7,302,303,305 - Memory errors

152,287,289 - Power supply failure
447 - An error has occurred on an adapter
521 - init process has failed
551,552,554,555,556,557 - Corrupt LVM, rootvg, or JFS log
553 - inittab or /etc/environment corrupt
552,554,556 - Corrupt lesystem superblock
521 through 539 - cfgmgr (and ODM) related errors
532,558 - Out of memory during boot process
518 - Failed to mount /var or /usr
615 - Failed to config paging device
888- Dead Man Switch

Tricks

1. To mirror a terminal1 on terminal2
a. Open terminal 1 and find the pts value (ps -ef grep pts)
b. Open terminal 2 and enter 'portmir -t pts/1'
c. Now you will see commands and outputs from terminal 1 in terminal 2.
This is basically monitor a terminal.
d. Say "portmir -o" to end the mirroring after the use

2. Reset an Unknown Root Password

The following procedure describes how to recover access to root privileges when the system's root password is unavailable or unknown. The following procedure requires some system downtime. If possible, schedule your downtime when it least impacts your workload to protect yourself from a possible loss of data or functionality.

1. Insert the product media for the same version and level as the current installation into the appropriate drive.
2. Power on the machine.
3. When the screen of icons appears, or when you hear a double beep, press the F1 key repeatedly until the System Management Services menu appears.
4. Select Multiboot.
5. Select Install From.
6. Select the device that holds the product media and then select Install.
7. Select the AIX version icon.
8. Define your current system as the system console by pressing the F1 key and then press Enter.
9. Select the number of your preferred language and press Enter.
10. Choose Start Maintenance Mode for System Recovery by typing 3 and press Enter.
11. Select Access a Root Volume Group. A message displays explaining that you will not be able to return to the Installation menus without rebooting if you change the root volume group at this point.
12. Type 0 and press Enter.
13. Type the number of the appropriate volume group from the list and press Enter.
14. Select Access this Volume Group and start a shell by typing 1 and press Enter.
15. At the # (number sign) prompt, type the passwd command at the command line prompt to reset the root password. For example:

# passwd
Changing password for "root"
root's New password:
Enter the new password again:

16. To write everything from the buffer to the hard disk and reboot the system, type the following:
sync;sync;sync;reboot

When the login screen appears, the password you set in step 15 should now permit access to root privileges.

3. How to disable telnet in AIX

#vi /etc/inetd.conf

comment out telnet from this file (#telnet ... ... .. )
save it and
#refresh -s inetd
Then telnet session will be disabled in that server from now

4. Fix a corrupted BLV in AIX

Recreate BOOT LOGICAL VOLUME (BLV) in AIX


If a Boot Logical volume (BLV) is corrupted, a machine will not boot.
(Eg:bad block in a disk might cause a corrupted BLV)

To fix this situation, You must boot your machine in maintenance mode, from a CD or Tape. If a NIM has been setup for a machine, you can also boot the machine from a NIM master in maintenance mode.

The bootlists are set using the bootlist command or through the System Management Services Progam (SMS). pressing F1 will go to SMS Mode.
then change the bootlist for service(maintenance) mode as 1st device to CD ROM.

#bootlist -m service cd0 hdisk0 hdisk1

then start maintenance mode for system recovery,

Access rootvg,


access this volum group to start a shell,

then recreate BLV using bosboot command.

#bosboot -ad /dev/hdisk0

it's important that you do a proper shutdown, All changes need to be written from memory to disk.
#shutdown -Fr

Important: bosboot command requires that boot logical volume hd5 exists. If you want to create a BLV ( may be it had been deleted by mistake ), do the following,

1. boot your machine in maintenance mode,
2. Create a new hd5 logical volume, one PP size, must be in rootvg,specify boot as logical volume type,

#mklv -y hd5 -t boot rootvg 1

3. Then run bosboot command as described.

If you have an HMC, then at the time of booting select boot as SMS in the properties of that partition

5. Link Aggregation in AIX
Link Aggregation ( Network Bonding ) in AIX

Link aggregation means you can give one IP address to two network cards and connect to two different switches for redundancy purpose. In this only one network card will be active in one time, and when it got failed the other network card goes active and let us continue our work.

It is better to use through SMIT.

#smit
then goto
Devices > Communication > EtherChannel / IEEE 802.3ad Link Aggregation > Add An EtherChannel / Link Aggregation
here select the network card that you want to use, ie active.
Eg: select ent0

Important: then select Mode as 8023ad

then select backup adapter for redundancy.(press F4 to show N/W adapters.)
Eg: ent1

press enter.

now ent0 and ent1 got bonded.
then automatically a virtual adapter will be created named ent2.

then put IP address and all to this virtual adapter.

#smit
Communications Applications and Services > TCP/IP > Minimum Configuration & Startup
here select ent2 ( new bonded virtual adapter )
put IP Address and all, give start now option.

Now you are successfully completed Link aggregation and check whether it works or not by removing the 2nd cable to the network card and check ping, then put the 2nd cable and remove 1st cable. 2 - 3 drops normally occurs in my experience.

6. Configure NTP Server on AIX

1.Verify that you have a suitable NTP server.
#lssrc -ls xntpd

Note : sys peer should show a valid server or 127.127.1.0

If the server is "insane", you should need to correct it by adding a server line into /etc/ntp.conf and restarting xntpd.

Following these steps
#vi /etc/ntp.conf
Add server :
server 127.127.0.1
Double check that "broadcastclient" is commented.
#stopsrc -s xntpd
#startsrc -s xntpd

Note : If the server runs databases, use the -x flag to prevent the clock from changing in a negative direction. Enter the following:

#startsrc -s xntpd -a "-x"

2.Enter
#lssrc -ls xntpd

to verify that the server is synched. This process can take upto 12 minutes.

Configure NTP Client on AIX

1. Verify that you have a server suitable for synchronization, Enter:

#ntpdate -d ip.address.of.server

The offset must be less than 1000 seconds for xntpd to synch. If the offset is greater than 1000 seconds, change the time manually on the client and run ntpdate -d again.

If you get the message ," no server suitable for synchronization found", verify xntpd is running on the server (see above )and that no firewalls are blocking port 123.

2. Specify your xntpd server in /etc/ntop.conf, Enter

#vi /etc/ntp.conf

comment "broadcastclient" line and add

server ip.address.of.server prefer

leave the driftfile and tracefile at their defaults.

3. start the xntpd daemon,
#startsrc -s xntpd
( use the -x flag if it is appropriate in your environment.)

4. Uncomment xntpd from /etc/rc.tcpip so it will start on reboot.
#vi /etc/rc.tcpip
Unconmment the following line
start /usr/sbin/xntpd "$src-running"

If using the -x flag, add "-x" to the end oof the line. you must include the qoutes around "-x"

5. verify that the client is synched.

#lssrsc -ls xntpd

Note: sys peer should display the IP Adress or name of your xntpd server.This process may take 12 minutes.

HMC

To configure the HMC, do the following steps:

1. Turn on the HMC by pressing the power button.

2. Wait for the HMC to automatically select the default language and locale preference.

3. Accept the HMC license agreements. If you decline the HMC license agreements, you cannot complete the HMC configuration.

4. Click Log on and launch the Hardware Management Console web application.

5. Log in to the HMC:

ID: hscroot

Password: abc123

The Guided Setup wizard opens.

6. Click OK on the Guided Setup entry window.

7. Complete the steps in the Guided Setup wizard. Click Yes to continue and complete the steps in the Connectivity and Call-Home Servers wizard.

8. On the Summary window, click Finish.

9. If you have not connected the Ethernet crossover cable to your managed system, do so now and power on the managed server.

10. In the HMC navigation area, click Service Management.

11. In the contents area, click Authorize User. The Authorize User window opens.

12. Enter your IBM® ID in the field and click OK.  

Creating LPAR using SSH

Get the configuration data from existing LPAR

If you already have LPARs created you can use this command to get their configuration which can be reused as template:

lssyscfg -r prof -m SERVERNAME --filter "lpar_ids=X, profile_names=normal"

Create new LPAR using command line

Here is an example, for more information see '''man mksyscfg'''

mksyscfg -r lpar -m MACHINE -i name=LPARNAME, profile_name=normal, lpar_env=aixlinux, shared_proc_pool_util_auth=1, min_mem=512, desired_mem=2048, max_mem=4096, proc_mode=shared, min_proc_units=0.2, desired_proc_units=0.5, max_proc_units=2.0, min_procs=1, desired_procs=2, max_procs=2, sharing_mode=uncap, uncap_weight=128,boot_mode=norm, conn_monitoring=1, shared_proc_pool_util_auth=1

Create more LPARs using configuration file

If you want to create more LPARS at once you can use a configuration file and provide it as input for mksyscfg.

Here is an example for 3 LPARs, each definition starting at new line:

name=LPAR1,profile_name=normal,lpar_env=aixlinux,all_resources=0,min_mem=1024,desired_mem=9216,max_mem=9216,proc_mode=shared,min_proc_units=0.3,desired_proc_units=1.0,max_proc_units=3.0,min_procs=1,desired_procs=3,max_procs=3,sharing_mode=uncap,uncap_weight=128,lpar_io_pool_ids=none,max_virtual_slots=10,"virtual_scsi_adapters=6/client/4/vio1a/11/1,7/client/9/vio2a/11/1","virtual_eth_adapters=4/0/3//0/1,5/0/4//0/1",boot_mode=norm,conn_monitoring=1,auto_start=0,power_ctrl_lpar_ids=none,work_group_id=none,shared_proc_pool_util_auth=1
name=LPAR2,profile_name=normal,lpar_env=aixlinux,all_resources=0,min_mem=1024,desired_mem=9216,max_mem=9216,proc_mode=shared,min_proc_units=0.3,desired_proc_units=1.0,max_proc_units=3.0,min_procs=1,desired_procs=3,max_procs=3,sharing_mode=uncap,uncap_weight=128,lpar_io_pool_ids=none,max_virtual_slots=10,"virtual_scsi_adapters=6/client/4/vio1a/12/1,7/client/9/vio2a/12/1","virtual_eth_adapters=4/0/3//0/1,5/0/4//0/1",boot_mode=norm,conn_monitoring=1,auto_start=0,power_ctrl_lpar_ids=none,work_group_id=none,shared_proc_pool_util_auth=1
name=LPAR3,profile_name=normal,lpar_env=aixlinux,all_resources=0,min_mem=1024,desired_mem=15360,max_mem=15360,proc_mode=shared,min_proc_units=0.4,desired_proc_units=1.0,max_proc_units=4.0,min_procs=1,desired_procs=4,max_procs=4,sharing_mode=uncap,uncap_weight=128,lpar_io_pool_ids=none,max_virtual_slots=10,"virtual_scsi_adapters=6/client/4/vio1a/13/1,7/client/9/vio2a/13/1","virtual_eth_adapters=4/0/3//0/1,5/0/4//0/1",boot_mode=norm,conn_monitoring=1,auto_start=0,power_ctrl_lpar_ids=none,work_group_id=none,shared_proc_pool_util_auth=1

Copy this file to HMC and run:
mksyscfg -r lpar -m SERVERNAME -f /tmp/profiles.txt

To check the HMC version
lshmc -V

Eg:
Release: 3
Version: 2.5
HMC Build level 20031020.1

To check the HMC vital product data information
lshmc -v

Eg:
Vital Product Data Information:
*FC ????????
*VC 20.0
*N2 Mon Aug 20 13:12:39 BST 2007
*FC ????????
*DS pSeries Hardware Management Console
*TM eserver xSeries 335 -[7315CR2]-
*SE 651BABA
*MN IBM
*PN Unknow
*SZ 1055932416
*OS Linux 2.4.20-19.7
*NA 10.35.0.135
*FC ????????
*DS Platform Firmware
*RM R3V2.5

To check the HMC network configurations:
lshmc -n

To List last 2 days console log details
lssvcevents -t console -d 2

HMC Hints:
Power 4 HMC Commands


To view partition state:
get_partition_state

To pop a hung partiton into the debugger (aka 'soft reset'):
reset_partition -m -p -t soft

To force a reboot of a hung system (aka 'hard reset'):
reset_partition -m -p -t hard

To start a partition:
start_partition -p -f -m

To get a listing of boot profiles:
query_profile_names -m -p

Power 5 HMC Commands

To see system state for a system or the partitions on a system:
lssyscfg -r sys -m
lssyscfg -r lpar -m

To just see names and state:
lssyscfg -r lpar -m -F name,state --header

To power on an lpar with a profile:
chsysstate -m -o on -r lpar -n -f
i.e. for example:
chsysstate -m alpha -o on -r lpar -n alpha-lp1 -f default

To power on a whole machine (CEC):
chsysstate -m alpha -o on -r sys

Etc. chsysstate, lssyscfg and other commands have good explanations if they're run without arguments.

Issuing a 'soft reset', to push a hung machine into KDB/XMON, is not obvious. The magic incantation is:
chsysstate -r lpar -m -n -o dumprestart

To issue a 'hard reset', to turn off a partition, no matter what:
chsysstate -r lpar -m -n -o shutdown --immed --restart

To add one virtual CPU: (note these use -p instead of -n for the partition name)
chhwres -r proc -m -p -o a --procs 1

To add one-tenth of a cpu processing entitlement:
chhwres -r proc -m -p --procunits 0.1

Memory and Performance

Top 10 Memory usage process
ps auxw |sort -r +3 |head -10

Top 10 CPU usage process
ps auxw |sort -r +2 |head -10

List size, summary, and paging activity by paging space
lsps -a

List summary of all paging space
lsps -s

List the total amount of physical RAM in system
lsattr -El sys0 -a realmem

Create a new paging device on rootvg of 64 PPs
mkps -a -s 64 -n rootvg

topas Options

Make topas look like top
topas -P

View statistics from other partitions
topas -C View statistics for disk I/O
topas -D

Show statistics related to micro-partitions in Power5 environment
topas -L

All of the above commands are availible from within topas

Get verbose disk stats for hdisk0 every 2 sec
iostat -d hdisk0 2

Get extended vmstat info every 2 seconds
while [ 1 ]; do vmstat -vs; sleep 2; clear; done

AIX Package Management

To check if packages, installed on the machine are OK
lppchk -v

If you get report of something wrong try to get more info about the case and resolve the problem before continue with installation
lppchk -v -m3

List all files in bos.games fileset.
lslpp -f bos.games

Find out what fileset \fortune" belongs to.
lslpp -w /usr/games/fortune

List packages that are above the current OS level
oslevel -g

Find packages below a specified ML
oslevel -rl 5300-05

List recommended MLs
oslevel -rq

List installed MLs
instfix -i |grep ML

List the missing filesets to specified ML
instfix -ivk 5200-10_AIX_ML |grep : |grep not

List all filesets
lslpp -L

List all filesets in a grepable or awkable format
lslpp -Lc

Find the package that contains the filemon utility
which fileset filemon

Install the database (from CD) for which fileset
installp -ac -d /dev/cd0 bos.content list

Create a mksysb backup of the rootvg volume group
mksysb -i /mnt/server1.mksysb.`date +%m%d%y`

Cleanup after a failed install
installp -C

SRC

Start the xntpd service
startsrc -s xntpd

Stop the NFS related services
stopsrc -g nfs

Refresh the named service
refresh -s named

List all registered services on the system
lssrc -a

Show status of ctrmc subsystem
lssrc -l -s ctrmc

AIX Error Logging

Error logging is provided through:
alog, errlog and syslog.

Display the contents of the boot log
alog -o -t boot

Display the contents of the console log
alog -o -t console

List all log types that alog knows
alog -L

Send a message to errlog
errlogger "Your message here"

Display the contents of the system error log
errpt (Add -a or -A for varying levels of verbosity)

Errors listed from errpt can be limited by the -d S or -d H options. S is software and H is hardware. Error types are (P)ermanent, (T)emporary, (I)nformational, or (U)nknown. Error classes are (H)ardware, (S)oftware, (O)perator, or (U)ndetermined.

Clear all errors up until x days ago.
errclear x

List info on error ID FE2DEE00 (IDENTIFIER column in errpt output)
errpt -aDj FE2DEE00

List all errors that happened today
errpt -s `date +%m%d0000%y`

To list all errors on hdisk0
errpt -N hdisk0

To list details about the error log
/usr/lib/errdemon -l

To change the size of the error log to 2 MB
/usr/lib/errdemon -s 2097152

syslog.conf line to send all messages to log file
*.debug /var/log/messages

syslog.conf line to send all messages to error log
*.debug errlog

To identify the error details from repository
errpt -t |grep 173C787F

To open the alternate error log file
errpt -i errlog

Network

To view the route table
netstat -r

To view the route table from the ODM DB
lsattr -EHl inet0 -a route

Temporarily add a default route
route add default 192.168.1.1

Temporarily add an address to an interface
ifconfig en0 192.168.1.2 netmask 255.255.255.0

Temporarily add an alias to an interface
ifconfig en0 192.168.1.3 netmask 255.255.255.0 alias

To Delete Alias from en1
ifconfig en1 10.35.0.171 netmask 255.255.128.0 delete

To Create Alias to en2
ifconfig en2 10.35.0.171 netmask 255.255.128.0 alias

To permanently add an IP address to the en1 interface
chdev -l en1 -a netaddr=192.168.1.1 -a netmask=0xffffff00

Permanently add an alias to an interface
chdev -l en0 -a alias4=192.168.1.3,255.255.255.0

Remove a permanently added alias from an interface
chdev -l en0 -a delalias4=192.168.1.3,255.255.255.0

List ODM (next boot) IP configuration for interface
lsattr -El en0

Permanently set the hostname
chdev -l inet0 -a hostname=www.yourdomain.net

Turn on routing by putting this in rc.net
no -o ipforwarding=1

List networking devices
lsdev -Cc tcpip

List Network Interfaces
lsdev -Cc if

List attributes of inet0
lsattr -Ehl inet0

List (physical layer) attributes of ent0
lsattr -El ent0

List (networking layer) attributes of en0
lsattr -El en0

Speed is found through the entX device
lsattr -El ent0 -a media speed

Set the ent0 link to Gig full duplex
(Auto Negotiation is another option)
chdev -l ent0 -a media speed=1000 Full Duplex -P

Turn off Interface Specific Network Options
no -p -o use isno=0

Get (long) statistics for the ent0 device (no -d is shorter)
entstat -d ent0

List all open, and in use TCP and UDP ports
netstat -anf inet

List all LISTENing TCP ports
netstat -na |grep LISTEN

Remove all TCP/IP configuration from a host
rmtcpip

AIX Devices

List all devices on a system
lsdev

List all disk devices on a system (Some other devices are: adapter,driver, logical volume, processor)
lsdev -Cc disk

To verify the processor capacity
prtconf -c (64bit/32bit)

List all customized (existing) device classes (-P for complete list)
lsdev -C -r class

Remove hdisk5
rmdev -dl hdisk5

Get device address of hdisk1
getconf DISK DEVNAME hdisk1 or bootinfo -o hdisk1

Get the size (in MB) of hdisk1
getconf DISK SIZE hdisk1 or bootinfo -s hdisk1

Find the slot of a PCI Ethernet adapter
lsslot -c pci -l ent0

Find the (virtual) location of an Ethernet adapter
lscfg -l ent1

Find the location codes of all devices in the system
lscfg

List all MPIO paths for hdisk0
lspath -l hdisk0

Find the WWN of the fcs0 HBA adapter
lscfg -vl fcs0 |grep Network

Temporarily change console output to /console.out
swcons /console.out (Use swcons to change back.)

To Identify the Parent Device
lsdev -Cc disk -l hdisk1 -F parent

To Identify the Predefined Device Line number
lsdev -Cc disk -l hdisk28 -F PdDvLn

To Check the device status
lsdev -Cc disk -l hdisk1 -S A -F status

To get information about dar1 devices
odmget -q 'name = dar1 AND attribute = all_controller' CuAt
odmget -q 'PdDvLn = disk/fdar/array' HACMPdisktype
odmget -q 'name = hdisk7 AND PdDvLn = disk/fdar/array' CuDv

To Remove Devices
rmdev -l fcs1 (or) rmdev -l fcs1 -R (along with all the child devices)

Command to extract snap.pax.z
zcat ../snap.pax.Z |pax -rf -

To Check no of processors on the system
lscfg |grep proc

To know the parent devices
server1: lsdev -Cl hdisk0 -F parent
scsi0
server1: lsdev -Cl scsi0 -F parent
pci12
server1: lsdev -Cl pci12 -F parent
pci3
server1: lsdev -Cl pci3 -F parent
sysplanar0

To lists devices owned by an adapter
lsdev -p scsi0

Disk Heartbeat Verification

To Check DISK Heartbeat

On Server1,

/usr/sbin/rsct/bin/dhb_read -p /dev/hdisk17 -r

On Server2,
/usr/sbin/rsct/bin/dhb_read -p /dev/hdisk17 -t

Sample Output on Server2

Transmit Mode:
Magic number = -2023406815
Detected remote utility in receive mode. Waiting for response . . .
Magic number = -2023406815
Magic number = -2023406815
Link operating normally

HACMP

To check Disk Heartbeats
lssrc -ls topsvcs

To check cspoc log
cat /tmp/cspoc.log |egrep -p "FAIL|ERROR" |more

To check clverify log grep
"Check:" /var/hacmp/clverify/clverify.log |sort |uniq

To check clutil log for last 2 days
tail -n 2 /var/hacmp/log/clutils.log

To check the status of the cluster
lssrc -ls clstrmgrES

To check the cluster related services at one shot
lssrc -a|egrep "svcs|ES"

To identify the RG movement activities
tail -f /tmp/hacmp.out

To identify the RG location
clRGinfo

To monitor the status of HACMP in a terminal
clstat -a

SNMP based tool to show cluster state
cldump

similar to cldump, perl script to show cluster state.
cldisp

list the local view of the cluster topology.
cltopinfo

list the local view of the cluster subsystems.
clshowsrv -a

locate the resource groups and display status.
clfindres (-s)

rotate some of the log files.
clcycle

a cluster ping program with more arguments.
cl_ping

cluster rsh program that take cluster node names as argument.
clrsh

which nodes are active?
clgetactivenodes

what is the name of the local node?
get_local_nodename

check the HACMP ODM.
clconfig

online/offline or move resource groups.
clRGmove

sync/fix the cluster.
cldare

Sync the cluster topology, resources and run the verification
cldare -rtV normal

list the resource groups.
cllsgrp

create a large snapshot of the hacmp configuration.
clsnapshotinfo

list the network configuration of an hacmp cluster.
cllscf

show the resource group configuration.
clshowres

show network interface information.
cllsif

show short resource group information.
cllsres

ls clstrmgrES list the cluster manager state.
lssrc

ls topsvcs show heartbeat information.
lssrc

list a node centric overview of the hacmp configuration.
cllsnode

When using qha you need to understand the cluster manager internal states. Here’s a description of the possible cluster states:
ST_INIT: cluster configured and down
ST_JOINING: node joining the cluster
ST_VOTING: Inter-node decision state for an event
ST_RP_RUNNING: cluster running recovery program
ST_BARRIER: clstrmgr waiting at the barrier statement
ST_CBARRIER: clstrmgr is exiting recovery program
ST_UNSTABLE: cluster unstable
NOT_CONFIGURED: HA installed but not configured
RP_FAILED: event script failed
ST_STABLE: cluster services are running with managed resources (stable cluster) or cluster services have been "forced" down with resource groups potentially in the UNMANAGED state (HACMP 5.4 only)

clcomdES
(Secure remote command execution) "Cluster communication enhanced security/usr/sbin/cluster/etc/rhosts --- to accept incoming communication from clcomdES (cluster communucation enahanced security) /usr/es/sbin/cluster/etc/rhosts
The clcomdES is used for cluster configuration operations such as cluster synchronisation
cluster management (C-SPoC) * Dynamic re-configuration DARE configuration. (DARE ) operation"

cllockd
For concurrent access

HACMP log files
/tmp/hacmp.out:
It records the output generated by the event scripts as they execute. When checking the /tmp/hacmp.out file, search for EVENT FAILED messages. These messages indicate that a failure has occurred. Then, starting from the failure message, read back through the log file to determine exactly what went wrong.

The /tmp/hacmp.out file is a standard text file. The system creates a new hacmp.out log file every day and retains the last seven copies. Each copy is identified by a number appended to the file name. The most recent log file is named /tmp/hacmp.out; the oldest version of the file is named /tmp/hacmp.out.7

/usr/es/adm/cluster.log: It is the main HACMP log file. HACMP error messages and messages about HACMP-related events are appended to this log with the time and date at which they occurred

/usr/es/sbin/cluster/history/cluster.mmddyyyy: It contains time-stamped, formatted messages generated by HACMP scripts. The system creates a cluster history file whenever cluster events occur, identifying each file by the file name extension mmddyyyy, where mm indicates the month, dd indicates the day, and yyyy indicates the year.

/tmp/cspoc.log: It contains time-stamped, formatted messages generated by HACMP C-SPOC commands. The /tmp/cspoc.log file resides on the node that invokes the C-SPOC command.

LVM

Put a PVID on a disk
chdev -l hdisk1 -a pv=yes

Remove a PVID from a disk
chdev -l hdisk1 -a pv=clear

List all PVs in a system (along) with VG membership
lspv

Create a VG called datavg using hdisk1 using 64 Meg PPs
mkvg -y datavg -s 64 hdisk1

Create a Enhanced Concurrent VG (HACMP-ES must be installed) with not auto varyon
mkvg -y vgname -f -n -C hdisk3

Create a LV on (previous) datavg that is 1 Gig in size
mklv -t jfs2 -y datalv datavg 16

List all LVs on the datavg VG
lsvg -l datavg

List all PVs in the datavg VG
lsvg -p datavg

Take the datavg VG offline
varyoffvg datavg

Remove the datavg VG from the ODM
exportvg datavg

Import the VG on hdisk5 as datavg
importvg -y datavg hdisk5

Vary-on the new datavg VG (can use importvg -n)
varyonvg datavg

List all VGs (known to the ODM)
lsvg

List all VGs that are on line
lsvg -o

Check to see if underlying disk in datavg has grown in size
chvg -g datavg

Move a LV from one PV to another
migratepv -l datalv01 hdisk4 hdisk5

Move LVs from hdisk0 to hdisk1
migratepv hdisk0 hdisk1

To replace a PP from hdisk5 to hdisk6 (hdisk6 must be None state)
replacepv hdisk5 hdisk6

Delete a VG by removing all PVs with the reducevg command.
reducevg hdisk3 (-d removes any LVs that may be on that PV)

To Read VGDA information on hdisk0
lqueryvg -Atp hdisk0

List the VG id in which the PV hdisk0 resides
lqueryvg -p hdisk0 -v

List all the LV ids/names in the VG where PV hdisk0 resides
lqueryvg -p hdisk3 -L

Lists all the PV ids that reside in the VG where hdisk3 resides
lqueryvg -p hdisk3 -P
(or)
lqueryvg -g 0053485a00004c00000000f8e9a3e72c

To find the WWN of the fcs0 HBA adapter
lscfg -vl fcs0 |grep Network

To check the major number of the VG
ls -l /dev/vgname

To check the free major number
lvlstmajor

Synchronizes logical volume copies that are not current
syncvg -v vgname

Synchronizes the LV lv00 so that all copies are identical
syncvg -l lv00

Updates the ODM for a specific VG with the information stored in the VGDA
redifinevg -d hdisk0 rootvg

To Check the LVCB (Logical Volume Control Block)
getlvcb -TA LVNAME (eg: getlvcb -TA fslv03)

To Check all the configured physical volumes
getlvodm -C

To Check all the FREE configured physical volumes
getlvodm -F

To Identify the VG ID of mohivg
getlvodm -v mohivg

To Check the VGDA information and its timestamp
readvgda /dev/hdisk1

Synchronizes or rebuilds the logical volume control block, the device configuration database (CuDv), and the volume group descriptor areas on the physical volumes
synclvodm

To check current boot disk
bootinfo -b

Rebuilds the ODM database for a LV, by reading the VGDA.
synclvodm vgname lvname (eg: synclvodm rootvg hd1)

Script to Find the Missing PVs (Note:The VGs should be variedon)
lsvg > /tmp/doc/vgs
for i in `cat /tmp/doc/vgs`
do
lsvg -p $i |grep -i missing
done

Script to Find the Stale PPs (Note:The VGs should be variedon)
lsvg > /tmp/doc/vgs
for i in `cat /tmp/doc/vgs`
do
lsvg -l $i |grep -i stale
done

Mirroring rootvg to hdisk1 extendvg rootvg hdisk1
mirrorvg rootvg hdisk1
bosboot -ad hdisk0
bosboot -ad hdisk1
bootlist -m normal hdisk0 hdisk1

Mount a CD ROM to /mnt
mount -rv cdrfs /dev/cd0 /mnt

Create a VG, LV, and FS, mirror, and create mirrored LV
mkvg -s 256 -y datavg hdisk1 (PP size is 1/4 Gig)
mklv -t jfs2log -y dataloglv datavg 1
logform /dev/dataloglv
mklv -t jfs2 -y data01lv datavg 8 (2 Gig LV)
crfs -v jfs2 -d data01lv -m /data01 -A yes
extendvg datavg hdisk2
mklvcopy dataloglv 2 (Note use of mirrorvg in next example)
mklvcopy data01lv 2
syncvg -v datavg
lsvg -l datavg will now list 2 PPs for every LP
mklv -c 2 -t jfs2 -y data02lv datavg 8 (2 Gig LV)
crfs -v jfs2 -d data02lv -m /data02 -A yes
mount -a

Move a VG from hdisk1 to hdisk2 extendvg datavg hdisk2
mirrorvg datavg hdisk2
unmirrorvg datavg hdisk1
reducevg datavg hdisk1

Find the free space on PV hdisk1
lspv hdisk1 (Look for \FREE PPs")

For the LVM_GS_RLEAVE (Errpt Error)
Check the ps -ef |grep gsclvmd and check the Conc VGs state

File Systems

File Systems:

Default rootvg filesystems
hd1 - /home
hd2 - /usr
hd3 - /tmp
hd4 - /
hd5 - Boot logical volume
hd6 - paging space
hd8 - log device
hd9var - /var
hd10opt - /opt

Remove mount point entry and the LV for /mymount
rmfs /mymount (Add -r to remove mount point)

Grow the /var filesystem by 1 Gig
chfs -a size=+1G /var

Find the file usage on a filesystem
du -smx /

List filesystems in a grep-able format
lsfs

Create a log device on datavg VG
mklv -t jfs2log -y datalog1 datavg 1

Format the log device just created
logform /dev/datalog1

Format the log device associated with the fs on LV datalv1
logform /dev/datalv1

AIX Commands

AIX OS Commands:

To find the HMC IP from LPAR
/usr/sbin/rsct/bin/rmcdomainstatus -s ctrmc

To check more than 2MB files under /var
find /var/ -xdev -size +2048 -ls | sort -r

To check the processes which are used by /var filesystem
fuser -cdfxV /var

To check the RAID level of the hdisk
lsattr -El hdisk3 | grep raid

To check 15 most cpu utilized processes
ps -ef |egrep -v "STIME| $LOGNAME" |sort +3 -r| head -n 15

To find the microcode of the system
lsmcode

To check machine S.No
lsconf |grep -i machine

To find the firmware version of AIX
lscfg -vp| grep -p Platform

To check the eth media speed
entstat -d en0 |grep "Media Speed"

To check the status of Link Line
netstat -v en0 |grep -p "Specific Statistics"

To find the MAC address of the eth
netstat -ia

To find the virtual location of an ethernet adapter
lscfg -l ent1

To Check Failed Login
who -a /etc/security/failedlogin

Find the version of AIX that is running
oslevel, osleve -s

List all attributes of system
getconf -a

bootinfo and getconf can return much of the same information, getconf
returns more and has the grepable -a option.

Find the level of firmware on a system
invscout

List all attributes for the kernel \device"
lsattr -El sys0

To check the kernel version on AIX
ls -al /unix,

which_fileset /usr/lib/boot/unix_64,
lslpp -h bos.mp64

Print a \dump" of system information
prtconf

To View Only Configuration File Directives ( uncommented lines of a config file )
grep -v "^#" /path/to/config/file
(or)
sed '/ *#/d; /^ *$/d' /path/to/file

To find UNIX / Linux command for particular task
apropos -r 'remove file'

To Linux Find Out Virtual Memory PAGESIZE
getconf PAGESIZE

To Identify the Firmware level
lsmcode,
lsmcode -A,
lsmcode -d fcs0

Determining the program that caused the core dump
strings corefilename |grep _=
(or)
lquerypv -h corefilename 6b0 64

NIM

NIM Commands:

To create a MKSYSB resource on NIM Master

nim -o define -t mksysb -a server=master -a source=testaix1u1 -a mk_image=yes -a location=/nim/mksysbs/testaix1.mksysb testaix1_mksysb

To create a LPP_SOURCE

nim -o define -t lpp_source -a server=master -a location=/export/lpp_source/lpp5300 -a source=/dev/cd0 lpp5300

To create a SPOT from LPP_Source

nim -o define -t spot -a server=master -a location=/export/spot -a source=lpp5300 -a installp_flags=-aQg spot5300