Sunteți pe pagina 1din 48

AIX FAQ

Page 1 of 48

Boot
AIX Boot process Contents of Boot Logical Volume (/dev/hd5) How to change the current Boot device order Viewing AIX Boot and console Logs

Contents of Boot Logical Volume


Kernal - Copy of /unix LVM Commands ODM Predefined Structure ODM Customized Structure rc.boot shell script

Listing and changing the current boot order


bootlist -m normal -o bootlist -m normal cd0 hdisk0 bootlist -m service cd0 rmt0 # Lists the current bootlist # To set cd0 and hdisk0 as first and second boot devices # To change the bootlist for service mode

Viewing AIX Boot and Console Logs


Boot and console messages can be used to identify and fix problems. These messages are automatically stored on disk by AIX. To view the stored messages, use the alog command. Here are a couple examples of the alog command:
alog -L # alog -L boot bosinst nim console cfg dumpsymp alog -o -t boot alog -o -t console # # View the boot log View the console log # List the defined log types

To find out the properties of boot log file


# alog -L -t boot file:size:verbosity /var/adm/ras/bootlog:131072:1

AIX FAQ

Page 2 of 48

To find out whether a Hard drive is bootable


# ipl_varyon -i
PVNAME hdisk0 hdisk1 hdisk2 BOOT DEVICE YES YES NO PVID VOLUME GROUP ID 00c898eb372ea9410000000000000000 00c898eb00004c00 00c898eb38483a300000000000000000 00c898eb00004c00 00c898bbdd86318c0000000000000000 00c898bb00004c00

Devices
Device configuration Database Listing the installed and supported devices (lsdev) Listing the system configuraion and Vital product data of devices (lscfg) Listing the device attributes (lsattr) Change the attributres of devices (chdev) Configuring new devices (cfgmgr) Make device files (mkdev) Removing devices from system (rmdev) To manually add a device to the system (mkdev) To Find the boot informations, Disk Size, Kernel bits etc.. (getconf) To display sytem configuration information (prtconf)

Device Configuration Database


Device informations are stored in ODM. There are two device configuratoin databases in AIX

Predefined Database contains data for all the supported devices based on the system configuration. Customized Database contains configuration database for all currently defined and configured (available) devices.

The devices in AIX can be in any of the following states


1. 2. 3. 4. Available Defined Unknown Stopped Device is ready and can be used Device is unavailable Undefined Configured but unavailable

To list the devices lsdev


-C to list customized database -P to list predefined database -c (class) -t (type) -s (subtype)

To list all customised devices ie installed


# lsdev -C

AIX FAQ To list all the Hard Drives in a system


# lsdev -Cc disk

Page 3 of 48

To list all the adapters in a sytem


# lsdev -Cc adapter

To find out the type of Fibre adapter


# lsdev -Ct df1000f* -F "type" -l fcs1

To find out the parent of ent0 device


# lsdev -Cl ent0 -F parent

To display configuration and vital product data (VPD) about the system lscfg
-v Displays the VPD found on customized Database -p display paltform specifig device info. -l <device_name>

To list all installed devices in detail


# lscfg -v

To find out the WWN, FRU #, firmware level of fibre adapter fcs0
# lscfg -vpl fcs0

To display attributes and possible values of attributes for devices lsattr


-E -D -R -a -l Displays the effective value Displays the Default Value Displays the range of legal values <Attribute> <Device_name>

Examples: To find out the possible media_speed values for ethernet card ent0
# lsattr -El ent0 -a media_speed -R 10_Half_Duplex 10_Full_Duplex 100_Half_Duplex

AIX FAQ
100_Full_Duplex Auto_Negotiation

Page 4 of 48

To find out the effective attribute of a device "mem0"


# lsattr -El mem0 goodsize 512 Amount of usable physical memory in Mbytes False size 512 Total amount of physical memory in Mbytes False

To list the defaults in the pre-defined db for device ent0


# lsattr -El sys0

To Change the attributes of deviceschdev


-l -a -T -P <device name> <attribute=new_value> to change the value temporarily to make the change permanent after reboot if the device is currently in use and can not be changed

To change the SCSI ID of adapter scsi0 that cannot be changed made unavailable due to available disk drives connected to it
# chdev -l scsi0 -a id=6 -P

To change the maximum number of processes allowed per user


Find out the valid range of values using lsattr command # lsattr -El sys0 -a maxuproc -R 40...131072 (+1) Change the maxuproc value using chdev command # chdev -l sys0 -a maxuproc=10000

To remove the devices rmdev


-d -l -R -S removes the device from Customized DB <device_name> Unconfigure device and its chidren Makes deviec un-availabel by using stop method

To change device state from available to defined


# rmdev -l (device)

AIX FAQ To delete the device


# rmdev -l (device) -d

Page 5 of 48

To delete the scsi adapter scsi0 and all its child devices
# rmdev -Rdl scsi0

Add device to the system mkdev


-d define -c class -l <logical device name> -p parent name -s subclass -t type

Examples: To define a tape device


# mkdev -d -c tape -t 8mm -s scsi -p scsi0 -w 5,0

To make the predefined rmt0 tape to available status


# mkdev -l rmt0

Configuring New Devices using cfgmgr: cfgmgr configures devices and optionally installs device software by running the programs specified in the Configuration Rules object class. cfgmgr
-v To give detailed output -l <Device_name> To configure the device and all it's chidren -i <device> Location of installation medium

To search for new devices and configure them


#cfgmgr

To configure detected devices attached to the fcs0 adapter


# cfgmgr -l fcs0

To install device drivers which is in /tmp/drivers automatically during configuration

AIX FAQ
# cfgmgr -i /tmp/drivers

Page 6 of 48

Getting System configuration variable values


getconf, bootinfo commands can be used to collect the system configuration variable values such as kernel bit, hardware bit, boot device, real mem present, disk size etc... bootinfo command is not supported on Aix V5.2 onwards.

Using bootinfo command


To find out the Kernel whether it is 32-bit or 64bit
# bootinfo -K # bootinfo -y ---- > for Kernel ---- > for Hardware

# bootinfo -s hdiskx ----> to find out the size of the hard drive

Some useful getconf command examples


# getconf KERNEL_BITMODE 64 # getconf HARDWARE_BITMODE 64 # getconf DISK_SIZE /dev/hdisk0 8678 # getconf REAL_MEMORY 524288 # getconf BOOT_DEVICE hdisk0 # getconf DISK_DEVNAME hdisk0 10-60-00-4,0 # getconf MP_CAPABLE 0

Displaying system configuration information


prtconf command displays system Configuration information. If run without any flags, it displays the system model, machine serial, processor type, number of processors, processor clock speed, cpu type, total memory size, network information, filesystem information, paging space information, and devices information Flags:-c Displays cpu type, for example, 32-bit or 64-bit. -k Display the kernel in use, for example, 32-bit or 64-bit. -L Displays LPAR partition number and partition name if this is an LPAR partition, otherwise returns "-1 NULL". -m Displays system memory. -s Displays processor clock speed in MHz. -v Displays the VPD found in the Customized VPD object class for devices.

Examples:# prtconf -c CPU Type: 64-bit # prtconf -m Memory Size: 4096 MB

AIX FAQ
# prtconf -s Processor Clock Speed: 1654 MHz # prtconf System Model: IBM,9119-595 Machine Serial Number: 02898EB Processor Type: PowerPC_POWER5 Number Of Processors: 2 Processor Clock Speed: 1654 MHz CPU Type: 64-bit Kernel Type: 64-bit LPAR Info: 5 sapnims Memory Size: 4096 MB Good Memory Size: 4096 MB Platform Firmware level: Not Available Firmware Version: IBM,SF235_209 Console Login: enable Auto Restart: true Full Core: false Network Information Host Name: sapnims IP Address: 10.253.1.24 Sub Netmask: 255.255.255.0 Gateway: 10.253.1.253 Name Server: 128.137.24.4 Domain Name: gene.com Paging Space Information Total Paging Space: 512MB Percent Used: 1% Volume Groups Information rootvg: PV_NAME hdisk0 hdisk1 PV STATE active active TOTAL PPs 546 546 FREE PPs 1 1

Page 7 of 48

FREE DISTRIBUTION 00..00..00..00..01 00..00..00..00..01

....................... ....................... ......................

Backup and Recovery


Backup rootvg using mksysb Backup and restore volume groups using savevg and restvg restvg backup Restore files backed-up using mksysb/backup commands

Backup rootvg using mksysb


mksysb

AIX FAQ

Page 8 of 48

Creates an installable image of the root volume group either in a file or on to a bootable tape Bootable tape is created in backup format Can be restored individual files/directories using restore command mksysb
-e -i -v -X /excludes files in /etc/exclude.rootvg to create image.data file verbose mode extend /tmp filesystem if necessory for storing boot image

-i option calls mkszfile command which inturn creats /image.data file. The bootable mksysb volume contains four images 1. 2. 3. 4. Boot image bosinstall image (image.data, bosinst.data, tapeblksz, etc..) An empty table of contents System Backup Image in Back up format

/bosinst.data file contains answer for questions during installation time such as Console name, Installation methode, locale seetings, etc.. If there is no /bostinst.data file present, then a sample file /usr/lpp/bosinst/bosinst.template is copied as /bosinst.data during backup process. /image.data file contains logical volume and filesystem information of root volume group which is used by BOS install for creating target rootvg. If you want to create a custom image.data file, create the file using mkszfile, modify the file as per your requirement and call the mksysb command without -i option. With these two files, it is possible to carry out an un-attended installation. Examples: To create system backup and create an /image.data file
# mksysb -i /dev/rmt0

To exclude files and directories stored in /etc/exclude.rootvg file


# mksysb -i -e /dev/rmt0

To store the mksysb image to a file called /stage/backp/mksysb.img


# mksysb /stage/backp/mksysb.img

Backup or restore VGs using savevg and restvg


savevg command is used to backup volume groups other than rootvg restvg command is used to restore volume groups other than rootvg savevg
-e excludes files/directories being backed in /etc/exclude.<vgname> file

AIX FAQ
-i -f -v -X creates /tmp/vgdata/<vgname>/<vgname>.data file <device> device or filename on which the image to be stored verbose mode automatically expand /tmp filesystem if required

Page 9 of 48

-i option calls mkvgdata command which inturn creates /tmp/vgdata/<vgname>/<vgname>.data file restvg

Backing up a filesytem or files


Restore files
restore
-q tells restore commnad that volume is ready -t, -T to list the list of files in the backup archive -v verbose -r restores all files in the filesystem archive -x to restore specifig files/directories -d to restore all files in a directory if the File parameter is a directory -s <number> To seek and restore the multiple backup tapes

To list the names of files in either a file-name or file-system archive


# restore -Tq -f /dev/rmt0

To list all the files in a mksysb tape backup


# restore -Tvqs 4 -f /dev/rmt0.1

To restore an entire file-system archive, enter:


# restore -rvqdf /dev/rmt0

To restore a specific file


# restore -xvqf myhome.bkup system.data

To restore a specific file "/etc/passwd" from mksysb image file "mksysb.host1"


# restore -xvqdf mksysb.host1 ./etc/passwd

System Dump
What is dump? Configuring dump devices in AIX How to start the system dump manually? Copying system dump to other directory or media

AIX FAQ Examining system dump using kdb Important LED codes related to dump

Page 10 of 48

If a kernel panic occures, a dump will be invoked automatically. The followings are dumped during the dump process. 1. 2. 3. 4. 5. 6. 7. List of currently running processes and related information about the process Curretnly mounted filesystems, inode table and open file table currently configured ttys and their status Memory buffers for data system buffers system variables and statistics Kernel's own record of process it is currently running.

Configuring dump devices


sysdumpdev command is used to change the primary or secondary dump device designation in a running system.
sysdumpdev -l -L -e -d -p -s -P list the current dump destination view satistical information about previus dump estimate the dump size <directory> directory to copy the dump during boot time <devive name> to set the device as primary dump device <device name> to set the device as secondary dump device to make the changes permanent even after reboot

Exaples: To permanently make /dev/hd7 as the primary dump device


# sysdumpdev -Pp /dev/hd7

To make /dev/sysdumpnull as the secondary dump device


# sysdumpdev -s /dev/sysdumpnull

To estimate the dump size


#susdumpdev -e

To start the dump manually sysdumpstart command is used to start a kernel dump to the primary or secondary dump device. When the dump completes, the system halts. Use the kdb command to examine the dump.
# sysdumpstart {-p | -s}

AIX FAQ Copying system dump

Page 11 of 48

If there is enough space to copy the dump to /var/adm/ras directory, then it will be copied directly during reboot. Dump is copied as /var/adm/ras/vmcore.x file. If there is not enough space, then "copydumpmenu" is run by /sbin/rc.boot to display the copy dump menu. Using this copydumpmenu utility, a dump can be copied to removable such as tape. snap utility can be used to gather system information along with dump and compress the information in a tar file. snap
-a gathers all system configuration information -c creates compressed pax image (snap.pax.Z) -e HACMP specifig information -g gathers general info -f gathers filesystem info -k gathers kernel info -d <directory> optional snap commnad output directory default directory is /tmp/ibmsupt -D gathers dump and /unix -o <output_device> cpoies the compressed image to tape or diskette

Example: To send dump with other gathered information in to tape drive


# snap -gfkD -o /dev/rmt0

Examing system dump kdb command is an interactive utility for examining an OS image or the running kernel.
kdb <systemImageFile [KernelFile]]

LED Codes Related to dump


0c0 0c2 0c4 0c5 0c9 Dump completed successfully Dump started Dump unsuccesful. Not enough space on dump device Dump failed to start System initiated dump started

Paging
Swap space related commands and files in AIX
swapon swapoff

AIX FAQ
lsps chps mkps rmps /etc/swapspaces

Page 12 of 48

swapon: Used to activate a paging space.


swapon -a --> activates all paging devices specified on /etc/swapspaces swapon < Device Name > --> Activates the specified paging space

mkps: This command is used to add an additional paging space. Syntax:


mkps [ -a ] [ -n ] [ -s Number of LPs ] VG_Name -a activates the paging space during next reboot -n activates the paging space immediately

chps: This command is used to change the attributes of a paging space Syntax:
chps [ -a LPs | -d LPs ] [ -a { y | n } ] paging_space_name -s Specifies the number of logical partitions to add -d specifies the number of logical partitions to subtract -a To specify to use the Paging Space at the next reboot

To remove an active paging space "paging00" 1. Deactivate the paging space using swapoff commnad
# swapoff paging00

2. remove the paging space using rmps command


# rmps paging00

LVM
synclvodm -Pv <vgname> imfs -x -l <lvname> imfs -l <lv_name> getlvcb -AT <lvname> To sync the stale partitions on VG
# varyonvg vgname

Cook-book for creating a Volume Group and file systems using LVM
lspv

AIX FAQ
hdisk0 hdisk1 hdisk36 hdisk37 00c33e2e8347acfd 00c33e2e8c8a25e3 none none rootvg rootvg None None

Page 13 of 48
active active

erpsb4ci0:/ # mkvg -s 512 -y saplocvg hdisk36 0516-1254 mkvg: Changing the PVID in the ODM. saplocvg erpsb4ci0:/ # lsvg saplocvg VOLUME GROUP: saplocvg 00c33e2e00004c0000000111a483c8ab VG STATE: active VG PERMISSION: read/write MAX LVs: 256 LVs: 0 OPEN LVs: 0 TOTAL PVs: 1 STALE PVs: 0 ACTIVE PVs: 1 MAX PPs per VG: 32512 MAX PPs per PV: 1016 LTG size (Dynamic): 256 kilobyte(s) HOT SPARE: no VG IDENTIFIER: PP SIZE: 512 megabyte(s) TOTAL PPs: 999 (511488 megabytes) FREE PPs: 999 (511488 megabytes) USED PPs: 0 (0 megabytes) QUORUM: 2 VG DESCRIPTORS: 2 STALE PPs: 0 AUTO ON: yes MAX PVs: AUTO SYNC: BB POLICY: 32 no relocatable

mklv -y saplocvg_log -t jfs2log saplocvg 1 hdisk36 saplocvg_log logform -V jfs2 /dev/saplocvg_log logform: destroy /dev/rsaplocvg_log (y)?y mklv -y sapmntlv -t jfs2 saplocvg 64 hdisk36 lsvg -l saplocvg saplocvg: LV NAME sapmntlv saplocvg_log

TYPE jfs2 jfs2log

LPs 64 1

PPs 64 1

PVs 1 1

LV STATE closed/syncd closed/syncd

MOUNT POINT N/A N/A

crfs -v jfs2 -d /dev/sapmntlv -m /sapmnt -A yes -p rw File system created successfully. 33553204 kilobytes total disk space. New File System size is 67108864

While trying to extend the filesystem, getting the following error. 0516-787 extendlv: Maximum allocation for logical volume backuplv is 6600 This is because, the maximum LP is set to 6600 for that LV. We can can change it using chlv command.
# chlv -x 8000 testlv

If the device configuration database (ODM) is not consistent with Logical Volume Manager information, the synclvodm command can be used to resynchronize the database. It Synchronizes or rebuilds the logical volume control block, the device configuration database, and the volume group descriptor areas on the physical volumes
synclvodm rootvg hd7 synclvodm rootvg

AIX FAQ

Page 14 of 48

NIM
To list all the mksysb resources
# lsnim -t mksysb # lsnim -t spot

To list all the machines


# lsnim -t standalone OR # lsnim -c machines

To reset the NIM status of system host-10


# nim -o reset -a force=yes host-10 or # nim -Fo reset host10

To Force Deallocate all the resources from system host-01


# nim -Fo deallocate -a subclass=all host-01

To rebuild the /etc/niminfo file in the master


# nimconfig -r

To rebuild the /etc/niminof file in the NIM client


# niminit -a master=<master_name> -a name=<client_machine_name>

To remove a machine from the NIM environment


# nim -o remove <machine_name>

To define a mksysb resource


# nim -o define -t mksysb -a server=master -a location=<location_of_mksysb_file> <mksysb_name>

To enable Base OS install in a client using mksysb resource


# nim -o bos_inst -a source=mksysb -a spot=spot_53ML4 -a accept_licenses=yes -a mksysb=<location_of_mksysb_file> <system_name>

To add additional software to lppsource1


# nim -o update -a packages=all source=/dev/cd0 lppsource1

To update the spot and lppsource to the latest level


# nim_update_all -l <lpp_sourcename> -s <spot_name> -d <localtion_of_filesets> -u -B

AIX FAQ

Page 15 of 48

Some useful NIM SMIT Fast paths


smit nim_mkmac smit nim_bosinst # Adding new machines # For doing BOS install operation on a machine

Common NIM Error codes


608 - tftp retrieve of client info file failure Action If a 608 hang is encountered, verify that the ClientName.info file exists in the /tftpboot directory. If it does not exist, retry the NIM operation to create it. If it does exist, verify that tftp access to the /tftpboot directory is not restricted in the /etc/tftpaccess.ctl file. is also possible that the network adapter was not configured properly in the boot environment 611 - Remote mount of NFS file system failure Action 611 hangs occur when the client machine is unable to mount a resource from a server. Ensure that NFS is running on the resource server. Verify that the resources specified for the operation are exported properly by checking the /etc/exports and /etc/xtab files on the server. Also, confirm that the resources have permissions set correctly for reading. 613 - Failure setting up route tables Action 613 hangs usually occur because a route is incorrectly defined for a network in the NIM database. Verify that the correct gateways are specified between networks, and all gateways are functional. Use debug-enabled network boot images to determine which routes could not be defined.

Networking
To find out the link speed and mac address of an Ethernet adapter ent0
# entstat -d ent0

Setting multiple IP address for a single network card


# ifconfig lo0 alias 195.60.60.1 # ifconfig en0 alias <IPadress> netmask <net_mask>

To make the alias permaent, either add the above line to /etc/rc.net or /etc/rc.tcpip. You can also make it permanent by running the following command.
# chdev -l en0 -a alias=<IP_address>,<netmask>

To delete a static route manually Syntax:- chdev -l inet0 -a delroute=<net>,<destination_address>,<Gate_way_address>,<Subnet_mask>


# chdev -l inet0 -a delroute='net','0.0.0.0','172.26.160.2'

AIX FAQ To change the IP address of an interface manually

Page 16 of 48

# chdev -l en0 -a netaddr=192.168.123.1 -a netmask=255.255.255.0 -a state=up

To set the IP address initially


# mktcpip -h <hostname> -a <ipaddress> -m <subnet_mask> -i <if_name> -n <NameServer_address> -d <domain_name> -g <gateway_address> -A no

Smit fast paths


# smit chinet or smit inet

To change the Network speed


# ifconfig en0 down detach # chdev -l ent0 -a media_speed=...... # ifconfig en0 up

Network Options: no command is used to change the network tuning parameters. To list the current network parameters / network options
# no -a

To enable IP forwarding
# no -o "ipforwarding=1"

To make ipforwarding=1 permanent now and after reboot


# no -p -o ipforwarding=1

To make the mbuff value to 200000 after the reboot


# no -r -o ipforwarding=1

To set the ipforwarding to the default level


# no -d ipforwarding

Network Packet Tracing and analyzing commands


Iptrace, Ipreport and tcpdump commands are used to trace and analyze network packets in AIX. Using iptrace and ipreport utility: 1. Log in as a root user, then type the following command to start the iptrace utility:

AIX FAQ
# startsrc -s iptrace -a -s it-ibm01 \ -d it-ibm100 -p tcp -i en0 /tmp/iptrace.raw

Page 17 of 48

The utility will capture all packets using TCP protocol through the en0 interface from the source host it-ibm01 to the destination host it-ibm100. Captured packets are logged into the raw file /tmp/iptrace.raw. 2. To stop the iptrace daemon so that it no longer captures packets, type the following command:
# stopsrc -s iptrace

3. To format the report


# ipreport -srn /tmp/iptrace.raw > /tmp/iptrace.rpt

Using tcpdump utility: 1. To start tcpdump utility:


# tcpdump -i en0 -w /tmp/tcpdump.raw host it-ibm01 and it-ibm100 and tcp

2. To read the captured /tmp/tcpdump.raw file


# tcpdump -v -x -r /tmp/tcpdump.raw > /tmp/tcpdump.rpt

Etherchannel
EtherChannel and IEEE 802.3ad Link Aggregation are network port aggregation technologies that allow several Ethernet adapters to be aggregated together to form a single pseudo Ethernet device. For example, ent0 and ent1 can be aggregated into an EtherChannel adapter called ent3; interface en3 would then be configured with an IP address. The system considers these aggregated adapters as one adapter. In addition, all adapters in the EtherChannel or Link Aggregation are given the same hardware (MAC) address, so they are treated by remote systems as if they were one adapter. Both EtherChannel and IEEE 802.3ad Link Aggregation require support in the switch so it is aware which switch ports should be treated as one. The adapters that belong to an EtherChannel must be connected to the same EtherChannel-enabled switch. You must manually configure this switch to treat the ports that belong to the EtherChannel as an aggregated link If an adapter fails, network traffic is automatically sent on the next available adapter without disruption to existing user connections. The adapter is automatically returned to service on the EtherChannel or Link Aggregation when it recovers. Because the EtherChannel cannot be spread across two switches, the entire EtherChannel is lost if the switch is unplugged or fails. To solve this problem, a new backup option available in AIX 5.2 and later keeps the service running when the main EtherChannel fails. The backup and EtherChannel adapters should be attached to different network switches, which must be inter-connected for this setup to work properly. In the event that all of the adapters in the EtherChannel fail, the backup adapter will be used to send and receive all traffic. When any link in the EtherChannel is restored, the service is moved back to the EtherChannel. Network Interface Backup Network Interface Backup protects against a single point of network failure by providing failure detection and failover with no disruption to user connections. When operating in this mode, only one adapter is active at any

AIX FAQ

Page 18 of 48

given time. If the active adapter fails, another adapter in the EtherChannel will be used for all traffic. When operating in Network Interface Backup mode, it is not necessary to connect to EtherChannel-enabled switches. The Network Interface Backup setup is most effective when the adapters are connected to different network switches, as this provides greater redundancy than connecting all adapters to one switch. When connecting to different switches, make sure there is a connection between the switches. This provides failover capabilities from one adapter to another by ensuring that there is always a route to the currently-active adapter. To create a etherchannel with Network Backup
# mkdev -c adapter -s pseudo -t ibm_ech -a adapter_names='ent0' -a backup_adapter='ent2' ent3 Available

ODM Object Data Manager (ODM)


What is ODM? Location of ODM Repositories Some ODM Database files Some Useful ODM commands ODM commands - examples

What is ODM?
ODM

Maintains system config, device and vital product data Provide a more robust, secure and sharable resource Provide a reliable object oriented database facility

Data Managed By ODM


Device Configuration Information Software Vital Product Data SRC information Communications configuration data Menus and commands for SMIT

ODM has three components


Object class - These are datafiles. Objects - Records within Datafiles Descriptors - Field within a record

AIX FAQ

Page 19 of 48

Where ODM Object Class files are stored?


This can be defined in /etc/environment file. The ODM object clases are held in three repositories 1. /etc/objrepos 2. /usr/lib/objrepos 3. /usr/share/lib/objrepos

Some important ODM Database files


Supported devices and attributes and connection information are stored in
PdDv, PdAt, PdCn, etc..

Records or customizrd Devices and attributes, VPD are stored in


CuDv, CuAt, CuDep, Config_Rules, CuVPD, etc ...

Have software information


lpp, history, product, inventory, etc..

SMIT menus, commands, options


sm_cmd_hdr, sm_cmd_opt, sm_menu_opt

NIM Resource and configuraion informations


nim_object, nim_pdattr, nim_altr

Errorlog, alog and dump file info


SWservAt

Useful ODM Commands


odmget odmdelete odmadd odmchange odmshow odmcreate odmdrop - To retrives objects from an Object Class in stanza format - To delete objects what meet a specifig criteria. If no criteria specified, all objects are deleted - To add a new object to an object class - To change all objects with in an Object Class that meet a specifig criteria - To display object class definition - To create Object Class for application that will use ODM DB - To remove an Oobject Class

Some ODM Command examples


To list all records with an Object Class CuDv
# odmget CuDv

To find out an object within CuAt with condition name=sys0 and attibute=maxuproc

AIX FAQ
# odmget -q "name=sys0 and attribute=maxuproc" CuAt CuAt: name = "sys0" attribute = "maxuproc" value = "2000" type = "R" generic = "DU" rep = "nr" nls_index = 20

Page 20 of 48

To delete the above object


# odmget -q "name=sys0 and attribute=maxuproc" CuAt > file.1 # odmdelete -q "name=sys0 and attribute=maxuproc" -o CuAt

To add the deleted object again to the above object class


# odmadd file.1 # add the file content to appropriate Object class

Monitoring Commands
nmon vmstat iostat sar topas nmon svmon filemon mpstat rmss netpmon

nmon
http://www-128.ibm.com/developerworks/eserver/articles/analyze_aix/index.html vmstat The vmstat command is useful for obtaining an overall picture of CPU, paging, and memory usage. The following is a sample report produced by the vmstat command: 1. vmstat 5 2
kthr memory ----- ----------r b avm fre 1 1 197167 477552 0 0 197178 477541 page faults cpu ------------------------ ------------ ----------re pi po fr sr cy in sy cs us sy id wa 0 0 0 7 21 0 106 1114 451 0 0 99 0 0 0 0 0 0 0 443 1123 442 0 0 99 0

Remember that the first report from the vmstat command displays cumulative activity since the last system boot. The second report shows activity for the first 5-second interval. iostat

AIX FAQ

Page 21 of 48

The iostat command is the fastest way to get a first impression, whether or not the system has a disk I/O-bound performance problem. This tool also reports CPU statistics.
Flags -a -d -m -t -z Specifies adapter throughput report. Specifies drive report only. Specifies statistics for paths. Specifies tty/cpu report only. Resets the disk input/output statistics 2 2 tin 0.0 0.0 % tm_act 0.0 0.1 tout 0.8 80.2 Kbps 0.3 1.1 avg-cpu: % user 8.4 4.5 Kb_read 258032 258088 % sys 2.6 3.0 % idle 88.5 92.1 Kb_wrtn 224266 1658678 % iowait 0.5 0.5

# iostat tty:

Disks: hdisk3 hdisk2

tps 0.0 0.0

svmon

The svmon command provides a more in-depth analysis of memory usage. It is more informative, but also more intrusive, than the vmstat and ps commands. The svmon command captures a snapshot of the current state of memory. The memory consumption is reported using the inuse, free, pin, virtual and paging space counters.

The inuse counter represents the number of used frames. The free counter represents the number of free frames from all memory pools. The pin counter represents the number of pinned frames, that is, frames that cannot be swapped. The virtual counter represents the number of pages allocated in the system virtual space. The paging space counter represents the number of pages reserved or used on paging spaces.

Flags
-G -U -P -i Global report User report Process report To define intervel and number of intervels. eg. -i 1 5

To find out the total memory/swap and free memory/swap available in an AIX system
# svmon -G
memory pg space pin in use PageSize s 4 KB m 64 KB size 3932160 1048576 work 444363 1609451 PoolSize inuse 3914793 6622 pers 0 0 inuse 3787625 7948 free 17367 clnt 0 2305342 pgsp 6622 0 pin 370027 4646 virtual 1482283 7948 pin 444363 virtual 1609451

AIX FAQ
# pagesize 4096

Page 22 of 48

So, the above system have almost 16GB physical Memory and 4 GB swap A memory leak can be detected with the svmon command, by looking for processes whose working segment continually grows. A leak in a kernel segment can be caused by an mbuf leak or by a device driver, kernel extension, or even the kernel. To determine if a segment is growing, use the svmon command with the -i option to look at a process or a group of processes and see if any segment continues to grow.
# svmon -P 13548 -i 1 2
Pid 13548 Vsid Esid 0 0 48412 2 6c01b d 4c413 f 3040c 1 ginger :svmon Pid 13548 Vsid 0 48412 6c01b 4c413 3040c Esid 0 2 d f 1 Type work work work work pers Command pacman Inuse 8535 Inuse 4375 2357 1790 11 2 Pin 2178 Pin 2176 2 0 0 0 Pin 2178 Pin 2176 2 0 0 0 Pgsp 847 Pgsp 847 0 0 0 Virtual 64-bit Mthrd LPage 8533 N N N

Type Description LPage work kernel seg work process private work shared library text work shared library data pers code,/dev/prodlv:4097 -P 13548 -i 1 3 Command pacman

Virtual 4375 2357 1790 11 -

Inuse 8589 Inuse 4375 2411 1790 11 2

Pgsp Virtual 64-bit Mthrd LPage 847 8587 N N N Pgsp 847 0 0 0 Virtual 4375 2411 1790 11 -

Description LPage kernel seg process private shared library text shared library data code,/dev/prodlv:4097 -

filemon
The filemon command monitor a trace for file system and IO system events and reports performance statistics for files, virtual memory segments, logical volumes and physical volumes. filemon is useful to those whose applications are believed to be disk-bound and want to know where and why. filemon command shows the load on different disks, logical volumes and files in a great detail. trcstop command is used to stop the filemon monitoring. The syntax of filemon command is
filemon [-o output_file] [-O levels] [-u] [-v] -O [lv | pv | vm | If | all ] (If - Logical file level, vm - Virtual memory level, lv - lv level) -u Reports on files that were opened prior to the start of the trace daemon

If the output file is not specified, the output is sent to standard output. To start the filemon monitoring for 1 min.
# filemon -uo filemon.out -O all ; sleep 60; trcstop

To find out the most active Logical Volumes

AIX FAQ

Page 23 of 48

# awk '/Most Active Logical Volumes/,/^$/' filemon.out Most Active Logical Volumes -----------------------------------------------------------------------util #rblk #wblk KB/s volume description -----------------------------------------------------------------------0.04 4208 0 34.9 /dev/paging00 paging 0.04 4000 0 33.2 /dev/hd6 paging 0.01 1680 11408 108.6 /dev/oralvr32 /oracle/R32 0.00 0 264 2.2 /dev/hd8 jfs2log

To find out most active Files


# awk '/Most Active Files/,/^$/' filemon.out

To find out most active physical Volumes


# awk '/Most Active Physical Volumes/,/^$/' filemon.out

rmss

The rmss command provides you with a means to simulate different sizes of real memory that are smaller than your actual machine, without having to extract and replace memory boards or reconfigure memory using logical partitions. To change the memory size to 500 MB,
# rmss -c 500 Simulated memory size changed to 500 Mb.

To reset the memory size to the real memory size of the machine, enter:
# rmss -r

Tuning Commands
vmo ioo no nice and renice vmtune defragfs

The /etc/tunables commands To manage its files in the /etc/tunables directory, new commands have been added to AIX. They are as follows: tuncheck: This command validates a file either to be applied immediately or at reboot time (-r flag). It checks the ranges, dependencies, and prompts to run bosboot if required. Run this command if you copy a file to a new system, or edit it with an editor such as vi. tunsave: This command saves all current values to a file, including optionally the nextboot file.

AIX FAQ

Page 24 of 48

tunrestore: This command applies values from a file, either immediately, or at the next reboot (-r flag). With the -r flag, it validates and copies the file over the current nextboot file. tundefault: This command resets all parameters to their default value. It can be applied at the next reboot with the -r flag.

ioo, vmo and no commands:


These commands are used to set or display current or next boot values of different tuning parameters.

ioo for IO tuning parameters vmo for Virtual Memory Manager parameters no for network tuning parameters

These commands can also make permanent changes or defer changes until the next reboot. When a permanent change or nextboot value is changed using these commands, the /etc/tunables/nextboot file is updated automatically with the new values (if the new value is different from the default value). The following flags are common for ioo, vmo and no commands.
-L [tunable] List the characteristics of one or all tunables -d tunable - Resets 'tunable' to default value -o [tunable] - Display the current value of 'tunable' -o tunable=<value> - Set the 'tuneble' to new value -D - Resets all tunables to their default value -p - Changes apply to both current and reboot values (/etc/tunables/nextboot file updated) -r - Changes apply to only reboot values (/etc/tunables/nextboot file updated)

Examples:
# vmo -p -o minfree=1200 -o maxfree=1280 # ioo -r -o maxpgahead=64 -o j2_minPageReadAhead=8 # no -r -o rfc1323=1 -o tcp_recvspace=262144 -o tcp_sendspace=262144

A sample /etc/tunables/nextboot file.


cat /etc/tunables/nextboot vmo: minfree = "1200" maxfree = "1280" minperm% = "10" maxperm% = "40" maxclient% = "40" ioo: no: tcp_recvspace = "65536" tcp_sendspace = "65536" tcp_pmtu_discover = "0" j2_nBufferPerPagerDevice = "1024"

AIX FAQ
udp_pmtu_discover = "0

Page 25 of 48

minfree Minimum acceptable number of real-memory page frames in the free list. When the size of the free list falls below this number, the VMM begins stealing pages. It continues stealing pages until the size of the free list reaches maxfree. maxfree Maximum size to which the free list will grow by VMM page-stealing. The size of the free list may exceed this number as a result of processes terminating and freeing their working-segment pages or the deletion of files that have pages in memory. minperm If the percentage of real memory occupied by file pages falls below this level, the page-replacement algorithm steals both file and computational pages, regardless of repage rates. maxperm' If the percentage of real memory occupied by file pages rises above this level, the page-replacement algorithm steals only file pages. maxclient If the percentage of real memory occupied by file pages is above this level, the page-replacement algorithm steals only client pages.

Tuning Asynchronous IO parameters


# smit aio or # chdev -l aio0 -P -a minservers=100 -a maxservers=100 -a maxreqs=9152 -a autoconfig=available

minserver: Minimum number of kernel processes dedicated to asynchronous I/O processing masservers: Maxiimum number of kernel processes dedicated to AIO processing maxreqs: maximum number of asynchronous I/O requests that can be outstanding at one time autoconfig: The state to which AIO is to be configured during system initialization. The possible values are "defined", which means that AIO cannot be used, and "available"

Disk IO pacing (High water-mark and Low Water-mark)


Disk-I/O pacing is intended to prevent programs that generate very large amounts of output from saturating the systems I/O facilities and causing the response times of less-demanding programs to deteriorate. When a process tries to write to a file that already has high-water mark pending writes, the process is put to sleep until enough I/Os have completed to make the number of pending writes less than or equal to the lowwater mark. The logic of I/O-request handling does not change. The output from high-volume processes is slowed down somewhat. The maxpout parameter specifies the number of pages that can be scheduled in the I/O state to a file before the threads are suspended. The minpout parameter specifies the minimum number of scheduled pages at which the threads are woken up from the suspended state. The default value for both the maxpout and minpout parameters is 0, which means that the I/O pacing feature is disabled. Changes to the system-wide values of the maxpout and minpout parameters take effect immediately without rebooting the system.

AIX FAQ

Page 26 of 48

Changing the values for the maxpout and minpout parameters overwrites the system-wide settings. You can exclude a file system from system-wide I/O pacing by mounting the file system and setting the values for the maxpout and minpout parameters explicitly to 0. The following command is an example: mount -o minpout=0,maxpout=0 /<file system> To change the high water-mark level
# chdev -a maxpout=20 -l sys0

netpmon Monitors activity and reports statistics on network I/O and network-related CPU usage

Software
Software Stats Listing Installed Software Installing Filesets/Software Installing PTFS/Patches Updating the software to the latest level Installing emergency fixes in AIX Software States: When a software or an update is first installed, it is in the APPLIED state. It can be later commited or rejectd. APPLIED state

Provide opportunity to test the software Enable to go back to the previous version in case of any problem Enable to commit software at a later stage Requires more disk Prevents future re-installation of product

COMMITED stage

Requires less disk space Permits future upgrade Prevents from easily going back to previous version

Reject action removes the APPLIED software and go back to the previous commited version

List the installed filesets/fileset updates To list all the installed software

AIX FAQ
# lslpp -l

Page 27 of 48

To display the maintenance level and state of a fileset


# lslpp -l bos.net.nfs.client

Lists installed software using ':' as the delimeter


# lslpp -Lc

To display the names of all the files of fileset bos.perf


# lslpp -f bos.perf

To find out which fileset a file belongs to


# lslpp -w /usr/sbin/nfsd

To list installation history of filesets


# lslpp -ha

To the filesets that do not have the required prerequisites or are not completely installed
# lslpp -v

Install filesets / software installp command is used to install the software. The options are
-a Install filesets in APPLIIED state -c Commit filesets -r Reject filesets which are in APPLIED state -u Uninstall filesets -C Cleanup failed installtion -g To Install or Uninstall dependencies -x To expand file systems if there is not enough space -d <device> Device or directory which contains the software -f <filename> User created file which has a list of software to be installed or deleted

Emaples: To list all installable software in media /dev/cd0


installp [-L|-l] -d /dev/cd0

To cleanup all failed installtion


installp -C

AIX FAQ

Page 28 of 48

To install bos.net software (apply and commit) package with all pre-requisites from directory /tmp/net
installp -acgx -d /tmp/net bos.net

To commit teh applied updates


installp -cgx all

To remove bos.net package


installp -ug bos.net

instfix coomand is used to install a fix or set of fixes. It is also used to find out if a fix is installed on a
system. To find out whether a Fix is installed or not
# instfix -i -k <APAR Number>

To list all the fixes that are installed on your system


# instfix -i -v

To list filesets which are lesser than the specified maintenance level
# instfix -ciqk 5100-04_AIX_ML | grep ":-:"

To install all filesets associated with fix Ix38794 from the tape
# instfix -k Ix38794 -d /dev/rmt0

To Display the entire list of fixes present on the media


# instfix -T -d /dev/cd0

To verify that all filesets have all required requisites and are completely installed
#lppchk -v

oslevel command is used to find out the version and maintenance level of AIX
To see the current OS and Maintenance level # oslevel
# oslevel -r # oslevel -s - To see the current maintenance level - To see the current service pack level

To list all known recommended maintenance levels on the system # oslevel -rq

AIX FAQ Updating the software to the latest level 01. Using smit
# smit update_all

Page 29 of 48

02. To update all filesets in a system using command line


a. Create the list of filesets installed # lslpp -Lc | awk -F: '{print $2}'| tail -n +2 > /tmp/lslpp b. Update the softwares using installp command # installp -agxYd /dev/cd0 -e /tmp/<exclude_list> -f /tmp/lslpp

Another way of updating all the filesets


# /usr/lib/instl/sm_inst installp_cmd -acgNXY -d <localtion_of_updates> -f '_update_all'

For not committing and saving all replaced files


# /usr/lib/instl/sm_inst installp_cmd -agX -d <localtion_of_updates> -f '_update_all'

To list all the installed efixes on a system


# emgr -l

To install a efix IY93496.070302.epkg.Z in /mnt directory


# emgr -e /mnt/IY93496.070302.epkg.Z

Security
"chsec" command
The chsec command changes the attributes stored in the security configuration stanza files. These security configuration stanza files have attributes that you can specify with the Attribute = Value parameter:

/etc/security/environ /etc/security/group /etc/security/lastlog /etc/security/limits /etc/security/login.cfg /usr/lib/security/mkuser.default /etc/security/passwd /etc/security/portlog /etc/security/user

AIX FAQ Syntax:


chsec [ -fFile] [ -s Stanza] [ -a Attribute = Value ... ]

Page 30 of 48

To change the CPU time limit of user joe to 1 hour (3600 seconds):
# chsec -f /etc/security/limits -s joe -a cpu=3600

"chuser" command
The chuser command changes attributes for the user identified by the Name parameter. The user name must already exist. To change an attribute, specify the attribute name and the new value with the Attribute=Value parameter To enable user smith to access this system remotely, type:
# chuser rlogin=true smith

The password on aix can be changed nom interactively using the setpwd command (Not an AIX command) The source code can be downloaded from here The Binary for 5.2 can be downloaded form here the Binary for 5.3 can be downloaded form here http://www.tivoli-ug.org/downloads/setpwd.aix.c

LPAR
LPAR facts

For initially configuring a P-Series system for installtion in LPAR mode, the system should be placed on Partion Stand-By mode

To list all the PCI slots allocated to an LPAR


# lsslot -c pci # lsslot -c pci -a

To dynamically reallocate an adapter 1. 2. 3. 4. Determine the PCI slot for the adapter using lsslot -c slot and get the "pciX' device name Remove the device from AIX using rmdev -l pciX -R (-R to remove all the child to parent) On HMC dynamically allocate the device to another On the destination box, run 'cfgmgr' to configure the allocated device

The HMC itself can be rebooted by loging to HMC with SSH, as user hscroot, and issueing the command

AIX FAQ
$ hmcshutdown -r -t0

Page 31 of 48

To shutdown a LPAR
chsysstate -r lpar -m MACHINE_NAME -o shutdown --immed --restart --id LPARID (or -n LPARNAME)

To findout which HMC an LPAR is connected


# lsrsrc IBM.ManagementServer (Name and Hostname are HMC's Name and hostname of HMC) Resource Persistent Attributes for IBM.ManagementServer resource 1: Name = "10.253.1.22" Hostname = "10.253.1.22" ManagerType = "HMC" LocalHostname = "10.253.1.54" ClusterTM = "9078-160" ClusterSNum = "" ActivePeerDomain = "" NodeNameList = {"err3qdb0"} resource 2: Name = "128.137.44.205" Hostname = "128.137.44.205" ManagerType = "HMC" LocalHostname = "10.253.1.54" ClusterTM = "9078-160" ClusterSNum = "" ActivePeerDomain = "" NodeNameList = {"err3qdb0"}

To disable/enable processor simultaneous multi-threading mode


smtctl -m off

If dynamic LPAR is not working

Start rsct daemons if not already started o lssrc -a | grep rsct o startsrc -g rsct Try re-booting HMC

Console Using HMC Command Line

vtmenu
vtmenu is a Perl script which displays a list of partitions, opening a virtual terminal on the one selected. If more than one managed systems exists, a list of them is displayed first. After a managed system is selected, a list of all logical partitions on that managed system is displayed. The vtmenu command does not accept any flags or parameters and ignores all that are specified. Escape sequence to leave vtmenu terminal session is:
~.

AIX FAQ

Page 32 of 48

mkvterm: mkvterm opens a virtual terminal session for an AIX, Linux, or virtual I/O server partition
To open a console terminal:
$ mkvterm -m <machine> -p <partition>

This can be exited with ~~. To remove a terminal someone else is using:
$ rmvterm -m <machine> -p <partition> # lsslot -c phb PHB Name Description Device(s) PHB 1 Logical PCI Host Bridge pci0 U7879.001.DQDGTGK-P1-T14 pci3 sisscsia0 U7879.001.DQDGTGK-P1-T4 pci4 usbhc0 usbhc1 U7879.001.DQDGTGK-P1-T6 pci5 ent0 ent1 PHB 2 Logical PCI Host Bridge pci1 U7879.001.DQDGTGK-P1-C3 pci6 ent2 ent3 U7879.001.DQDGTGK-P1-C4 pci7 ent4 ent5 U7879.001.DQDGTGK-P1-C5 pci8 fcs0 PHB 3 Logical PCI Host Bridge pci2 U7879.001.DQDGTGK-P1-T12 pci10 sisscsia1 U7879.001.DQDGTGK-P1-T15 pci11 ide0 U7879.001.DQDGTGK-P1-C1 pci12 fcs1

To list All the managed systems attached to the HMC


$ lssyscfg -r sys name=Server-9119-595-SN02898EB,type_model=9119-595,serial_num=02898EB,ipaddr=10.128.253 ndary=10.128.255.252,state=Operating,sys_time=10/13/2006 20:15:55,power_off_policy=1,co cod_proc_capable=1,hca_capable=1,huge_page_mem_capable=unavailable,micro_lpar_capable=1 ,5250_application_capable=0,redundant_err_path_reporting_capable=1,shared_eth_failover g_passing_capable=1,sp_failover_capable=1,vet_activation_capable=1,virtual_io_server_c 250_cpw_percent=0,max_lpars=254,max_power_ctrl_lpars=1,service_lpar_id=3,service_lpar_n ............................... ............................... ,pend_mfg_default_boot_mode=norm,sp_failover_enabled=1,sp_failover_state=Ready

To list only name, Serial number, IP address and state alone,


$ lssyscfg -r sys -F name,type_model,serial_num, ipaddr,state --header name,type_model,serial_num,ipaddr,state Server-9119-595-SN02898EB,9119-595,02898EB,10.128.253.255,Operating Server-9119-595-SN02898BB,9119-595,02898BB,10.128.255.250,Operating To list all the Lpar in the managed system $ lssyscfg -r lpar -m Server-9119-595-SN02898EB lssyscfg -r lpar -m Server-9119-595-SN02898EB name=eraprci0,lpar_id=8,lpar_env=aixlinux,state=Running,resource_config=1,os_version=0. 0.0.0.0.0,logical_serial_num=02898EB8,default_profile=eraprci0,curr_profile=eraprci0, work_group_id=none,shared_proc_pool_util_auth=0,power_ctrl_lpar_ids=none,boot_mode=norm, lpar_keylock=norm,auto_start=0,redundant_err_path_reporting=0 name=eraptci0,lpar_id=7,lpar_env=aixlinux,state=Running,resource_config=1,os_version=0. 0.0.0.0.0,logical_serial_num=02898EB7,default_profile=eraptci0,curr_profile=eraptci0, work_group_id=none,shared_proc_pool_util_auth=0,power_ctrl_lpar_ids=none,boot_mode=norm, lpar_keylock=norm,auto_start=0,redundant_err_path_reporting=0 name=erep2ci0,lpar_id=6,lpar_env=aixlinux,state=Running,resource_config=1,os_version=0. 0.0.0.0.0,logical_serial_num=02898EB6,default_profile=erep2ci0,curr_profile=erep2ci0,

AIX FAQ

Page 33 of 48

work_group_id=none,shared_proc_pool_util_auth=0,power_ctrl_lpar_ids=none,boot_mode=norm, lpar_keylock=norm,auto_start=0,redundant_err_path_reporting=0 $ lssyscfg -r lpar -m Server-9119-595-SN02898EB eraprci0,eraprci0,Running eraptci0,eraptci0,Running erep2ci0,erep2ci0,Running -Fname,curr_profile,state

Upgrading the machine code on HMC


1. Backup the managed system's profile data Server and Partition --> Server Management --> Profile data --> Backup Type the filename and save the information. Do this for each Managed system. 2. Backup critical console information so that previous levels can be restored in the event of a problem while upgrading the software. Do not use this critical console data after a successful upgrade to a new version of the HMC software. We can backup the console data in DVD-RAM media 3. Record the current HMC configuration 4. Save upgrade data. You can save the current HMC configuration in a designated disk partition on the HMC. Only save upgrade data immediately prior to upgrading your HMC software to a new release. This action allows you to restore HMC configuration settings after upgrading HMC Code update --> Save Upgrade Data --> Save on Hard Drive --> Finish 5. Upgrade HMC Software HMC Management --> Shutdown or Restart HMC --> Restart HMC After HMC restarts, in the login screen, select
upgrade --> upgrade from Media -- Finish

P5
Virtual IO Server Virtual Ethernet and SEA Virtual SCSI HMC Version 6.1.1 VIO Server Version 1.3 FP 8.1 Capped mode: The processing units given to the partition at a time never exceed the guaranteed processing capacity (the entitlement capacity is guaranteed by the system and it is not exceeded when resources are available in the shared processing pool).

AIX FAQ

Page 34 of 48

Uncapped mode: The processing capacity given to the partition at a time may exceed the guaranteed processing capacity when resources are available in the shared processing pool. You must specify the uncapped weight of that partition. If multiple uncapped logical partitions require idle processing units, the managed system distributes idle processing units to the logical partitions in proportion to each logical partition's uncapped weight. The higher the uncapped weight of a logical partition, the more processing units the logical partition gets
# lparstat -i Node Name : applsrv Partition Name : Apps_Server Partition Number : 4 Type : Shared-SMT Mode : Uncapped Entitled Capacity : 0.30 Partition Group-ID : 32772 Shared Pool ID : 0 Online Virtual CPUs : 2 Maximum Virtual CPUs : 10 Minimum Virtual CPUs : 1 Online Memory : 512 MB Maximum Memory : 1024 MB Minimum Memory : 128 MB Variable Capacity Weight : 128 Minimum Capacity : 0.20 Maximum Capacity : 1.00 Capacity Increment : 0.01 Maximum Dispatch Latency : 16999999 Maximum Physical CPUs in system : 2 Active Physical CPUs in system : 2 Active CPUs in Pool : Unallocated Capacity : 0.00 Physical CPU Percentage : 15.00% Unallocated Weight : 0

The following command disables all remote WebSM connections to the HMC:
$ chhmc -c websm -s disable

The following command disables the HTTP service on HMC:


$ chhmc -c http -s disable

VIO Server
The Virtual I/O Server is part of the IBM eServer p5 Advanced Power Virtualization hardware feature. Virtual I/O Server allows sharing of physical resources between LPARs including virtual SCSI and virtual networking. This allows more efficient utilization of physical resources through sharing between LPARs and facilitates server consolidation. Installation You have two options to install the AIX-based VIO Server: 1. Install from CD 2. Install from network via an AIX NIM-Server

AIX FAQ

Page 35 of 48

After the installation, the system is rebooted. After the reboot you are presented with the VIO-Server login prompt. You can't login as user root as you have to use the special user id padmin. No initial default password is set. Immediately after login you are forced to set a new password Before you can do anything you have to accept the I/O Server license. This is done with the license command.
$ license -accept

You can see all available commands with the command help. All these commands are shell aliases to a single SUID-binary called ioscli which is located in the directory /usr/ios/cli/bin. If you are familiar with AIX you will recognize most commands but most command line parameters differ from the AIX versions. As there are no man pages available you can see all options for each command separately by issueing the command help <command> To become root user in VIO server, use
$ oem_setup_env

Virtual Ethernet
Any LPAR with the same port and Same virtual LAN ID will be able to communicate with each other. For making a virtual Ethernet as SEA (Shared Ethernet adapter), select "Access External network" and leave IEEE802.1Q for the virtual adapter in the VIO server profile. To Create the SEA between the real and Virtual Ethernets 1. List all the virtual devices
$ lsdev virtual name status ent2 Available vhost0 Available vhost1 Available vhost2 Available vhost3 Defined vsa0 Available clientY Available clientZ Available description Virtual I/O Ethernet Adapter (l-lan) Virtual SCSI Server Adapter Virtual SCSI Server Adapter Virtual SCSI Server Adapter Virtual SCSI Server Adapter LPAR Virtual Serial Adapter Virtual Target Device - Logical Volume Virtual Target Device - Logical Volume

2. Create the shared ethernet adapter using real and virtual adapters

$ mkvdev -sea ent0 <- this is the real Ethernet -vadapter ent2 <- this is the Virtual Ethernet -default ent2 <- this simple setup it's to only one so it's the default -defaultid 1 <- this is the Port Virtual ID from the HMC ent3 Available en3 et3

AIX FAQ 3. Verify the newly created SEA


$ lsdev -dev en3 name status description ent3 Available Shared Ethernet Adapter

Page 36 of 48

4. Assign IP to the SEA

$ mktcpip -hostname op34 <- use you own hostname -inetaddr 9.137.62.34 <- use your IP address -interface en3 <- from the mkvdev command -netmask 255.255.255.0 <- normal TCPIP meaning -gateway 9.137.62.1 <- normal TCPIP meanin Now, the VIO server is ready with SEA configured.

5. Verify the creation of SEA

$ lsdev -dev ent3 attr attribute value description pvid 3 PVID to use for the SEA device pvid_adapter ent2 Default virtual adapter to use for non-VLAN-tagged real_adapter ent0 Physical adapter associated with the SEA thread 0 Thread mode enabled (1) or disabled (0) virt_adapters ent2 List of virtual adapters associated with the SEA

Virtual SCSI
Preparing Virtual SCSI adapter and storage for the Clients 1. List all the virtual devices
$ lsdev virtual name status description nt2 Available Virtual I/O Ethernet Adapter (l-lan) vhost0 Available Virtual SCSI Server Adapter vhost1 Available Virtual SCSI Server Adapter vhost2 Available Virtual SCSI Server Adapter vhost3 Defined Virtual SCSI Server Adapter vsa0 Available LPAR Virtual Serial Adapter clientY Available Virtual Target Device - Logical Volume clientZ Available Virtual Target Device - Logical Volume

2. Connect Logical Volume lv00 to VIO Client "clientX" $ mkvdev -vdev lv00 -vadapter vhost0 -dev clientX clientX Available 3. To assign the whole disk "hdisk1" to cleintY. (Make sure the hdisk1 is not part of any volume group) $ mkvdev -vdev hdisk1 -vadapter vhost1 -dev clientY clientY Available 4. Check the configuration
$ lsdev virtual

AIX FAQ
name status description ent2 Available Virtual I/O Ethernet Adapter (l-lan) vhost0 Available Virtual SCSI Server Adapter vhost1 Available Virtual SCSI Server Adapter ... vsa0 Available LPAR Virtual Serial Adapter clientx Available Virtual Target Device - Logical Volume clienty Available Virtual Target Device - Logical Volume ent3 Available Shared Ethernet Adapter

Page 37 of 48

$ $ lsdev -dev clientx attr attribute value description user_settable LogicalUnitAddr 0x8100000000000000 Logical Unit Address False aix_tdev lv00 Target Device Name False

HACMP
List of HACMP related documents can be found here http://www-03.ibm.com/servers/eserver/pseries/library/hacmp_docs.html HACMP Daemons HACMP Log files HACMP Startup and Shutdown HACMP Version 5.x What is new in HACMP 5.x Cluster Communication Daemon Heart Beating Forced Varyon of Volume Groups Custom Resource Group Application Monitoring Resource Group Tasks

HACMP Daemon
01. clstrmgr 02. clinfo 03. clmuxpd 04. cllockd

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.

AIX FAQ

Page 38 of 48

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 HACMPrelated 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. /tmp/emuhacmp.out: It records the output generated by the event emulator scripts as they execute. The /tmp/emuhacmp.out file resides on the node from which the event emulator is invoked.

HACMP Startup and shutdown


HACMP startup option: Cluster to re-aquire resources: If cluster services were stopped with the forced option, hacmp expects all cluster resources on this node to be in the same state when cluster services are restarted. If you have changed the state of any resources while cluster services were forced down, you can use this option to have hacmp reacquire resources during startup. HACMP Shutdown Modes: Graceful: Local machine shuts itself gracefully. Remote machine interpret this as a graceful down and do not takeover resources Takeover: Local machine shuts itself down gracefully. Remote machine interpret this as a non-graceful down and takeover resources Forced: Local machine shuts down cluster services without releasing any resources. Remote machine do not take over any resources. This mode is use ful for system maintenence.

HACMP 5.x New in AIX 5.1


SMIT Standard and Extended configuration paths (procedures) Automated configuration discovery Custom resource groups Non IP networks based on heartbeating over disks Fast disk takeover Forced varyon of volume groups

AIX FAQ

Page 39 of 48

Heartbeating over IP aliases Heartbeating over disks Heartbeat monitoring of service IP addresses/labels on takeover node( Now there is only HACMP/ES,based on IBM Reliable Scalable Cluster Technology Improved security, by using cluster communication daemon Improved performance for cluster customization and synchronization Fast disk takeover GPFS integration Cluster verification enhancements

New In AIX 5.2


Custom only resource groups Cluster configuration auto correction Cluster file collections Automatic cluster verification Application startup monitoring and multiple application monitors Cluster lock manager dropped Resource Monitoring and Control (RMC) subsystem replaces Event Management

HACMP 5.3 Limits


32 nodes in a cluster 64 resource group in a cluster 256 IP addresses known to HACMP (Service and boot IP lables) RSCT limit: 48 heartbeat rings

Cluster Communication Daemon


The Cluster Communication Daemon, clcomdES, provides secure remote command execution and HACMP ODM configuration file updates by using the principle of the "least privilege". The cluster communication daemon (clcomdES) has the following characteristics:

Since cluster communication does not require the standard AIX \"r\" commands, the dependency on the /.rhosts file has been removed. Thus, even in \"standard\" security mode, the cluster security has been enhanced. Provides reliable caching mechanism for other node's ODM copies on the local node (the node from which the configuration changes and synchronization are performed). Limits the commands which can be executed as root on remote nodes (only the commands in /usr/es/sbin/cluster run as root). clcomdES is started from /etc/inittab and is managed by the system resource controller (SRC) subsystem. Provides its own heartbeat mechanism, and discovers active cluster nodes (even if cluster manager or RSCT is not running). Uses HACMP ODM classes and the /usr/es/sbin/cluster/rhosts file to determine legitimate partners.

Heartbeating

AIX FAQ

Page 40 of 48

Starting with HACMP V5.1, heartbeating is exclusively based on RSCT topology services The heartbeat via disk (diskhb) is a new feature introduced in HACMP V5.1, with a proposal to provide additional protection against cluster partitioning and simplified non-IP network configuration. This type of network can use any type of shared disk storage (Fibre Channel, SCSI, or SSA), as long as the disk used for exchanging KA messages is part of an AIX enhanced concurrent volume group. The disks used for heartbeat networks are not exclusively dedicated for this purpose; they can be used to store application shared data

Forced varyon of volume groups


HACMP V5.1 provides a new facility, the forced varyon of a volume group option on a node. You should use a forced varyon option only for volume groups that have mirrored logical volumes, and use caution when using this facility to avoid creating a partitioned cluster. When using a forced varyon of volume groups option in a takeover situation, HACMP first tries a normal varyonvg. If this attempt fails due to lack of quorum, HACMP checks the integrity of the data to ensure that there is at least one available copy of all data in the volume group before trying to force the volume online. If there is, it runs varyonvg -f; if not, the volume group remains offline and the resource group results in an error state.

Custom Resource groups


Startup preferences

Online On Home Node Only: At node startup, the RG will only be brought online on the highest priority node. This behavior is equivalent to cascading RG behavior. Online On First Available Node: At node startup, the RG will be brought online on the first node activated. This behavior is equivalent to that of a rotating RG or a cascading RG with inactive takeover. If a settling time is configured, it will affect RGs with this behavior. Online On All Available Nodes: The RG should be online on all nodes in the RG. This behavior is equivalent to concurrent RG behavior. This startup preference will override certain fall-over and fallback preferences.

Fallover preferences

Fallover To Next Priority Node In The List: The RG will fall over to the nextavailable node in the node list. This behavior is equivalent to that of cascading and rotating RGs. Fallover Using Dynamic Node Priority: The RG will fall over based on DNP calculations. The resource group must specify a DNP policy. Bring Offline (On Error Node Only): The RG will not fall over on error; it will simply be brought offline. This behavior is most appropriate for concurrent-like RGs.

The settling time specifies how long HACMP waits for a higher priority node (to join the cluster) to activate a custom resource group that is currently offline on that node. If you set the settling time, HACMP waits for the duration of the settling time interval to see if a higher priority node may join the cluster, rather than simply activating the resource group on the first possible node that reintegrates into the cluster. Fallback preferences

AIX FAQ

Page 41 of 48

Fallback To Higher Priority Node: The RG will fall back to a higher priority node if one becomes available. This behavior is equivalent to cascading RG behavior. A fall-back timer will influence this behavior. Never Fallback: The resource group will stay where it is, even if a higher priority node comes online. This behavior is equivalent to rotating RG behavior.

A delayed fall-back timer lets a custom resource group fall back to its higher priority node at a specified time. This lets you plan for outages for maintenance associated with this resource group. You can specify the following types of delayed fall-back timers for a custom resource group:

Daily Weekly Monthly Yearly On a specific date

Application Monitoring
HACMP can also monitor applications in one of the following two ways:

Application process monitoring: Detects the death of a process, using RSCT event management capability. Application custom monitoring: Monitors the health of an application based on a monitoring method (program or script) that you define.

When application monitoring is active, HACMP behaves

For application process monitoring, a kernel hook informs manager that the monitored process has died, and HACMP application recovery process.

For the recovery action to take place, you must provide and restart the application (the application start/stop application server definition may be used). HACMP tries to restart the application and waits for the a specified number of times, before sending an notification actually moving the entire RG to a different node (next priority list).

For custom application monitoring (custom method), cleanup and restart methods, you must also provide

used for performing periodic application tests.

Resource Group Tasks


To list the resource groups configured for a cluster
# cllsgrp

To list the details of of a resource group


# clshowres

To bring RG1 offline on Node3


# clRGmove -g RG1 -n node3 -d <--- -d for down)

To bring CrucialRG online on Node3

AIX FAQ
# clRGmove -g CrucialRG -n node3 -u

Page 42 of 48

To check the current resource status


# clfindres or # clRGinfo

To find out the current cluster stat and obtain informatin about cluster
# cldump Obtaining information via SNMP from Node: err3qci0... _____________________________________________________________________________ Cluster Name: erpqa1 Cluster State: UP Cluster Substate: STABLE _____________________________________________________________________________ Node Name: err3qci0 Network Name: corp_ether_01 Address: 10.0.5.2 Address: 10.0.6.2 Address: 10.253.1.75 Network Name: prvt_ether_01 Address: 10.0.7.2 Address: 10.0.8.2 Address: 192.168.200.79 Network Name: ser_rs232_01 Node Name: err3qdb0 Network Name: corp_ether_01 Address: 10.0.5.1 Address: 10.0.6.1 Address: 10.253.1.55 Network Name: prvt_ether_01 Address: 10.0.7.1 Address: 10.0.8.1 Address: 192.168.200.8 Network Name: ser_rs232_01 Address: State: UP State: UP Label: r3qcibt1cp Label: r3qcibt2cp Label: sapr3qci State: UP Label: r3qcibt1pt Label: r3qcibt2pt Label: psapr3qci State: State: UP State: UP Label: r3qdbbt1cp Label: r3qdbbt2cp Label: sapr3qdb State: UP Label: r3qdbbt1pt Label: r3qdbbt2pt Label: psapr3qdb State: UP Label: r3qdb_ser State: UP State: UP State: UP State: UP State: UP State: UP State: UP State: UP State: UP State: UP State: UP State: UP State: UP

Cluster Name: erpqa1 Resource Group Name: SapCI_RG Startup Policy: Online On Home Node Only

AIX FAQ
Fallover Policy: Fallover To Next Priority Node In The List Fallback Policy: Never Fallback Site Policy: ignore Priority Override Information: Primary Instance POL: Node Group State ---------------------------- --------------err3qci0 ONLINE err3qdb0 OFFLINE Resource Group Name: OraDB_RG Startup Policy: Online On Home Node Only Fallover Policy: Fallover To Next Priority Node In The List Fallback Policy: Never Fallback Site Policy: ignore Priority Override Information: Primary Instance POL: Node Group State ---------------------------- --------------err3qdb0 ONLINE err3qci0 OFFLINE

Page 43 of 48

Syncronizing the VG info in HACMP if cluster is already running:


1. In the system where the VG changes are made, break the reserve on disks using varyonvg command # varyonvg -b -u <vgname> 2. Import the VG in the system where the VG info need to be updated. Use the -n and -F flag to not to vary on the VG # importvg -V <major #> -y <VG Name> -n -F <hdisk_name> 3. Varyon the VG without the SCSI reserves # varyonvg -b -u <vgname>

4. Change the VG not to caryon automatically # chvg -an -Qy <vgname> 5. Varyoff the VG # varyoffvg <vgname> 6. Put the SCSI reserves back in the primary server # varyonvg <vgname>

Some useful HACMP Commands


To list all the app servers configured including start and stop script
# cllsserv OraDB_APP /usr/local/bin/dbstart SapCI_APP /usr/local/bin/sapstart /usr/local/bin/dbstop /usr/local/bin/sapstop

To list the application monitoring configured on a cluster

AIX FAQ
# cllsappmon OraDB_Mon SapCI_Mon user user

Page 44 of 48

To get the detailed information about application monitoring


#name type MONITOR_METHOD MONITOR_INTERVAL INVOCATION HUNG_MONITOR_SIGNA STABILIZATION_INTERVAL FAILURE_ACTION RESTART_COUNT RESTART_INTERVAL RESTART_METHOD NOTIFY_METHOD CLEANUP_METHOD PROCESSES PROCESS_OWNER INSTANCE_COUNT RESOURCE_TO_MONITOR OraDB_Mon user /usr/local/bin/dbmonitor 30 longrunning 9 180 fallover 1 600 /usr/local/bin/dbstart /usr/local/bin/dbstop

# cllsappmon <app_mon_name> # cllsappmon -h OraDB_Mon

To clear a hacmp logs


# clclear

HACMP Upgrading options


1. Rolling Migration 2. Snapshot Migration To apply the online worksheet
/usr/es/sbin/cluster/utilities/cl_opsconfig <online worksheet file name>

Storage
IBM Sub System Device Driver (SDD)
List all Vpath devices and their states
# lsvpcfg vpath0 (Avail pv lotus02) 50014562 = hdisk2 (Avail ) hdisk19 (Avail ) vpath1 (Avail pv lotus02) 50114562 = hdisk3 (Avail ) hdisk20 (Avail )

#datapath query device


Total Devices : 17 DEV#: 0 DEVICE NAME: vpath0 Path# 0 1 TYPE: 2105F20 State OPEN OPEN SERIAL: 50014562 Mode NORMAL NORMAL Select 2634286 2639371 Errors 0 0

Adapter/Hard Disk fscsi1/hdisk2 fscsi0/hdisk19

1. datapath query adapter


Active Adpt# 0 1 2 Adapters :8 Name State fscsi2 NORMAL fscsi0 NORMAL fscsi1 NORMAL Mode ACTIVE ACTIVE ACTIVE Select 799440626 797798530 785716308 Errors 0 0 0 Paths 44 44 44 Active 44 44 44

To fixe a DPO Vpath Volume group that has mixed vpath and hdisk volumes.

AIX FAQ
# dpovgfix vg00

Page 45 of 48

EMC Powerpath
To configure all the emc hdisks, run emc_cfgmgr script. This script invokes the AIX cfgmgr tool to probe each adapter bus separately To remove the Symettrix hdisks
# lsdev -CtSYMM* -Fname | xargs -n1 rmdev -dl

To remove hdisks corresponding to CLARiiON devices To probe all emc disks


# inq

# lsdev -CtCLAR* -Fname | xargs -n1 rmdev -dl

To set up multipathing to the root device


# pprootdev on

To Remove all hdiskpower devices


# lsdev -Ct power -c disk -F name | xargs -n1 rmdev -l

To find out which hdiskpower device contains hdsik132

# powermt display dev=hdisk132 Pseudo name=hdiskpower38 Symmetrix ID=000100006216 Logical device ID=006C state=alive; policy=SymmOpt; priority=0; queued-IOs=0 ------------ Host ---------- - Stor - -- I/O Path - -- Stats --### HW Path I/O Paths Interf. Mode State Q-IOs Errors 0 1 1 fscsi0 fscsi1 fscsi1 hdisk132 hdisk223 hdisk314 FA 14bA active alive FA 14bB active alive FA 14bA active alive 0 0 0 0 0 0

HP Autopath
# dlnkmgr view -drv PathID HDevName Device 000000 dlmfdrv0 hdisk2 000001 dlmfdrv0 hdisk30 000002 dlmfdrv1 hdisk3 000003 dlmfdrv1 hdisk31 LDEV XP1024.40318.04DB XP1024.40318.04DB XP1024.40318.0522 XP1024.40318.0522

To remove all the DLM drives


# dlmrmdev dlmfdrv0 deleted dlmfdrv1 deleted dlmfdrv10 deleted

To clear the SCSI reserves on the disks


#dlmpr -a -c

/usr/DynamicLinkManager/drv/dlmfdrv.conf

MPIO
To list all the paths which are in Enabled status
# lspath -s ena -Fname -p fscsi0 # chpath -s ena -l hdisk0 paths Enabled

AIX FAQ

Page 46 of 48

Tips
ssh client and sftp not working for users other than root Solu: Check the permission for /opt/freeware. If others does not have read and execute permissoins, sftp may fail. Change the permissions. chmod 755 /opt/freeware After AIX fresh installation, not able to login into the system or no login prompt This problem may come if terminal / cable is not the right one. We need to change the attributes of tty0 device to get over this issue. Reboot the system in Single user mode using the installation CD
smit tty --> Change / Show Characteristics of a TTY select tty0 At the end of 'STTY attributes for RUN time' field, add ",clocal" In 'STTY attributes for LOGIN' filed, add ",clocal" Select 'Apply change to DATABASE only' to "yes" OR Run the following command # chdev -l 'tty0' -a runmodes='hupcl,cread,brkint,icrnl,opost,tab3,onlcr,isig,icanon,\n echo,echoe,echok,echoctl,echoke,imaxbel,iexten,clocal' \n -a logmodes='hupcl,cread,echoe,cs8,clocal' '-P'

Reboot the system. After AIX 5.2 fresh installation, system was not finding any SAN storages Fileset devices.fcp.disk was not installed on the system. Fileset installed and system rebooted. To kill all the process using filesystem /oracle
fuser -cuxk /oracle

New
Do you have some thing to share on AIX??
Please add your notes to this page by clicking on the Edit Page Link The password is 'guest'

AIX console cable detail

AIX FAQ For a 25 pin to 25 pin cable


2 3 4 5 7 6 & 20 to to to to to 8 to 3 2 5 4 7 to 20 ( important ) 6 & 8 ( important )

Page 47 of 48

'For a 25 pin to 9 pin cable


2 3 4 5 7 6 & 20 to to to to to 8 to to 2 3 8 7 5 4 6 & 1

For 9 pin to 9pin


TxD RxD RTS CTS DTR DSR,CD GND RI 3 2 7 8 4 6&1 5 9 to to to to to to to to 2 3 8 7 6&1 4 5 9 RxD TxD CTS RTS DSR, CD DTR GND RI

AIX FAQ

Page 48 of 48

S-ar putea să vă placă și