Wednesday, March 12, 2014

Installing Base Operating on AIX LPAR System Using VIO

1)Check if we have a repository already in place by using lsrep.
Padmini$ Isrep. 

2) Verify storage availability in VIO server for creating repository.
Padmin$ lssp 

 3) Create new repository with approximately 8Gb in size to keep binaries.
padmin$ mkrep -sp rootvg -size 8G 

4) Repeat step 1 to verify repository is in place.

5) Create Virtual optical device by using client SCSI adapter.


Padmin$ mkvedev –vadapter vhostX –fbo –dev opt_vhostX

Note :VhostX is VIO client SCSI adapter ID.

6) Map the VOD to the vhost adapter.
Padmin$ lsmap –vadapter vhostX 

7) Create ISO image from AIX DVD as a root User. (It may take 1 to 1.5 hour to copy image from DVD to on your local repository.
 #dd if=/dev/cd0 of=/var/vio/VMLibrary/AIX61DVD1.iso bs=1m 

8) Configure iso files with Read only mode. Padmin
$ chvopt -name AIX61DVD1.iso -access ro 

9) Load the ISO image as padmin user to VIO Client.
Padmin$ loadopt –vtd opt_vhostX –disk AIX61DVD1.iso 

10) Release the VTD device once OS is loaded on to VIO client.
Padmin$ unloadopt -release -vtd opt_vhostX

Saturday, March 9, 2013

Correct BLV by using NIM Maintenance Mode



This Post will provide a detail overview on how to fix corrupted boot logical volume in AIX server by using NIM server with maintenance mode.

My Environment details as below:
NIM Server Name:          NIMMASTER
Client Server Name:       subha

Consider by I have corrupted BLV on my server. Here in this case I have removed my BLV to work on this on my Lab environment.

subha:/ # rmlv hd5   ------------------------------> I have removed my BLV from client.
Warning, all data contained on logical volume hd5 will be destroyed.
rmlv: Do you wish to continue? y(es) n(o)?
y
0516-1246 rmlv: If hd5 is the boot logical volume, please run 'chpv -c '
        as root user to clear the boot record and avoid a potential boot
        off an old boot image that may reside on the disk from which this
        logical volume is moved/removed.
rmlv: Logical volume hd5 is removed.
0516-1734 rmlv: Warning, savebase failed.  Please manually run 'savebase' before rebooting.
subha:/ #

Still you can see your BLV in ODM. In real case you no need to remove hd5 from ODM but here I did on my LAB to watch how my server will react with BLV …

Subha:/ # chpv –c hdisk0 ------------------------------> Remove hd5 from disk and ODM.
Subha:/ # lsvg -l rootvg | grep -i hd5
Subha:/ #
After this step if you try to reboot your server, you will get HMC error code AA060011 (Firmware didn’t find operating system image).

Now consider this is real scenario in production environment and this need to be fix … to do this either you need base OS CD or NIM server  … as I have NIM in my environment I took NIM maintenance mode.

It is better to have NIM instead of depending on CD (It required FE to present on DC it may took couple of hours to reach when you have issue on production server).

To fix this issue Your NIM Server OS level should be higher or equal to your client OS level.
You need to have a SPOT created same level of your client OS and make it maint_boot to identify spot.

NIMMASTER:/ # nim -o maint_boot -a spot=spot_aix530_12SP2
NIMMASTER:/ # lsnim -l spot_aix530_12SP2
spot_aix530_12SP2:
   --------------------
   Rstate        = ready for use   -------------------------> Spot state should be ready for use.
NIMMASTER:/ #
Bring Client in Maintenance Mode:
From HMC console reboot server while booting select opition 1 = SMS Menu

IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM
IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM IBM

          1 = SMS Menu                          5 = Default Boot List
          8 = Open Firmware Prompt             6 = Stored Boot List
1

Once server is in Maintenance mode we will get below display …. Here we Need to work on RIPL.

 PowerPC Firmware
 Version EM350_143
 SMS 1.7 (c) Copyright IBM Corp. 2000,2008 All rights reserved.
-------------------------------------------------------------------------------
 Main Menu
 1.   Select Language
 2.   Setup Remote IPL (Initial Program Load)
 3.   Change SCSI Settings
 4.   Select Console
 5.   Select Boot Options

 Type menu item number and press Enter or select Navigation key:2------------> Select Setup Remote IPL

##########################################################################
 PowerPC Firmware
 Version EM350_143
 SMS 1.7 (c) Copyright IBM Corp. 2000,2008 All rights reserved.
-------------------------------------------------------------------------------
 NIC Adapters
      Device                          Location Code                 Hardware
                                                                    Address
 1.  Interpartition Logical LAN      U8234.EMA.0609CC4-V10-C11-T1  62a63c90140b
 2.  Interpartition Logical LAN      U8234.EMA.0609CC4-V10-C12-T1  62a63c90140c

 Type menu item number and press Enter or select Navigation key:1----------------> Select Adapter

############################################################################

 PowerPC Firmware
 Version EM350_143
 SMS 1.7 (c) Copyright IBM Corp. 2000,2008 All rights reserved.
-------------------------------------------------------------------------------
 Select Internet Protocol Version.

 1.   IPv4 - Address Format 123.231.111.222
 2.   IPv6 - Address Format 1234:5678:90ab:cdef:1234:5678:90ab:cdef
Type menu item number and press Enter or select Navigation key:1----------------> Select IPv4
###########################################################################
 PowerPC Firmware
 Version EM350_143
 SMS 1.7 (c) Copyright IBM Corp. 2000,2008 All rights reserved.
-------------------------------------------------------------------------------
 Select Network Service.
 1.   BOOTP
 2.   ISCSI
Type menu item number and press Enter or select Navigation key:1----------------> Select BOOTP
##########################################################################
PowerPC Firmware
 Version EM350_143
 SMS 1.7 (c) Copyright IBM Corp. 2000,2008 All rights reserved.
-------------------------------------------------------------------------------
 Network Parameters
Interpartition Logical LAN: U8234.EMA.0609CC4-V10-C11-T1
 1.   IP Parameters
 2.   Adapter Configuration
 3.   Ping Test
 4.   Advanced Setup: BOOTP

Type menu item number and press Enter or select Navigation key:1----------------> Select IP Parameters

Enter Cleint IP/ NIM IP /Gateway IP/ Subanet Mask as below for security reason I have placed my IP as xxx.xxx.xxx.xxx

PowerPC Firmware
 Version EM350_143
 SMS 1.7 (c) Copyright IBM Corp. 2000,2008 All rights reserved.
-------------------------------------------------------------------------------
 IP Parameters
Interpartition Logical LAN: U8234.EMA.0609CC4-V10-C11-T1
 1.   Client IP Address                    [xxx.xxx.xxx.xxx]
 2.   Server IP Address                    [xxx.xxx.xxx.xxx]
 3.   Gateway IP Address                   [xxx.xxx.xxx.xxx]
 4.   Subnet Mask                          [xxx.xxx.xxx.xxx]

 Type menu item number and press Enter or select Navigation key:----------------> To go back menu
######################################################################
 PowerPC Firmware
 Version EM350_143
 SMS 1.7 (c) Copyright IBM Corp. 2000,2008 All rights reserved.
-------------------------------------------------------------------------------
 Network Parameters
Interpartition Logical LAN: U8234.EMA.0609CC4-V10-C11-T1
 1.   IP Parameters
 2.   Adapter Configuration
 3.   Ping Test
 4.   Advanced Setup: BOOTP
Type menu item number and press Enter or select Navigation key:2----------------> Set adapter settings
PowerPC Firmware
 Version EM350_143
 SMS 1.7 (c) Copyright IBM Corp. 2000,2008 All rights reserved.
-------------------------------------------------------------------------------
 Speed,Duplex
Interpartition Logical LAN: U8234.EMA.0609CC4-V10-C11-T1
 1.  auto,auto  ( none )
Type menu item number and press Enter or select Navigation key:----------------> To go back menu
#####################################################################
 PowerPC Firmware
 Version EM350_143
 SMS 1.7 (c) Copyright IBM Corp. 2000,2008 All rights reserved.
-------------------------------------------------------------------------------
 Adapter Configuration
Interpartition Logical LAN: U8234.EMA.0609CC4-V10-C11-T1
 1.   Speed,Duplex
 2.   Spanning Tree Enabled
 3.   Protocol
 Type menu item number and press Enter or select Navigation key:2----------------> Disable spanning Tree


 PowerPC Firmware
 Version EM350_143
 SMS 1.7 (c) Copyright IBM Corp. 2000,2008 All rights reserved.
-------------------------------------------------------------------------------
 Spanning Tree Enabled
Interpartition Logical LAN: U8234.EMA.0609CC4-V10-C11-T1
 1.   Yes
 2.   No  <===

 -------------------------------------------------------------------------------
 Navigation keys:
 M = return to Main Menu
 ESC key = return to previous screen         X = eXit System Management Services
 -------------------------------------------------------------------------------
 Type menu item number and press Enter or select Navigation key:----------------> Go to previous menu by esc to verify Ping test.
########################################################################
 PowerPC Firmware
 Version EM350_143
 SMS 1.7 (c) Copyright IBM Corp. 2000,2008 All rights reserved.
-------------------------------------------------------------------------------
 Network Parameters
Interpartition Logical LAN: U8234.EMA.0609CC4-V10-C11-T1
 1.   IP Parameters
 2.   Adapter Configuration
 3.   Ping Test
 4.   Advanced Setup: BOOTP

 -------------------------------------------------------------------------------
 Navigation keys:
 M = return to Main Menu
 ESC key = return to previous screen         X = eXit System Management Services
 -------------------------------------------------------------------------------
 Type menu item number and press Enter or select Navigation key:3---------------->  Verify Ping test from Client to Master.
#########################################################################
 PowerPC Firmware
 Version EM350_143
 SMS 1.7 (c) Copyright IBM Corp. 2000,2008 All rights reserved.
-------------------------------------------------------------------------------
 Ping Test
 Interpartition Logical LAN: U8234.EMA.0609CC4-V10-C11-T1
 Speed, Duplex: auto,auto
 Client IP Address: xxx.xxx.xxx.xxx
 Server IP Address: xxx.xxx.xxx.xxx
 Gateway IP Address: xxx.xxx.xxx.xxx
 Subnet Mask: xxx.xxx.xxx.xxx
 Protocol: Standard
 Spanning Tree Enabled: 0
 Connector Type:


 1. Execute Ping Test
 -------------------------------------------------------------------------------
 Navigation keys:
 M = return to Main Menu
 ESC key = return to previous screen         X = eXit System Management Services
 -------------------------------------------------------------------------------
 Type menu item number and press Enter or select Navigation key:1

                            .---------------------.
                            |  Attempting Ping... |
                            `---------------------'


xxx.xxx.xxx.xxx:    24  bytes from xxx.xxx.xxx.xxx:  icmp_seq=1  ttl=? time=20  ms

                              .-----------------.
                              |  Ping  Success. |
                              `-----------------'
 Press any key to continue..........


 1. Execute Ping Test
 -------------------------------------------------------------------------------
 Navigation keys:
 M = return to Main Menu
 ESC key = return to previous screen         X = eXit System Management Services
 -------------------------------------------------------------------------------
 Type menu item number and press Enter or select Navigation key: + + + +

#####################################################################################
 PowerPC Firmware
 Version EM350_143
 SMS 1.7 (c) Copyright IBM Corp. 2000,2008 All rights reserved.
-------------------------------------------------------------------------------
 Main Menu
 1.   Select Language
 2.   Setup Remote IPL (Initial Program Load)
 3.   Change SCSI Settings
 4.   Select Console
 5.   Select Boot Options

 -------------------------------------------------------------------------------
 Navigation Keys:

                                             X = eXit System Management Services
 -------------------------------------------------------------------------------
 Type menu item number and press Enter or select Navigation key:5 ----------------> To set boot options
#####################################################################################
 PowerPC Firmware
 Version EM350_143
 SMS 1.7 (c) Copyright IBM Corp. 2000,2008 All rights reserved.
-------------------------------------------------------------------------------
 Multiboot
 1.   Select Install/Boot Device
 2.   Configure Boot Device Order
 3.   Multiboot Startup
 4.   SAN Zoning Support

 -------------------------------------------------------------------------------
 Navigation keys:
 M = return to Main Menu
 ESC key = return to previous screen         X = eXit System Management Services
 -------------------------------------------------------------------------------
 Type menu item number and press Enter or select Navigation key:1----------------> To set boot device
#####################################################################
 PowerPC Firmware
 Version EM350_143
 SMS 1.7 (c) Copyright IBM Corp. 2000,2008 All rights reserved.
-------------------------------------------------------------------------------
 Select Device Type
 1.   Diskette
 2.   Tape
 3.   CD/DVD
 4.   IDE
 5.   Hard Drive
 6.   Network
 7.   List all Devices
 Type menu item number and press Enter or select Navigation key:6----------------> To set boot from network
######################################################################
 PowerPC Firmware
 Version EM350_143
 SMS 1.7 (c) Copyright IBM Corp. 2000,2008 All rights reserved.
-------------------------------------------------------------------------------
 Select Network Service.
 1.   BOOTP
 2.   ISCSI
 Type menu item number and press Enter or select Navigation key:1----------------> Select BOOTP
#######################################################################
 PowerPC Firmware
 Version EM350_143
 SMS 1.7 (c) Copyright IBM Corp. 2000,2008 All rights reserved.
-------------------------------------------------------------------------------
 Select Device
 Device Current Device
 Number Position Name
 1.        -      Interpartition Logical LAN
        ( loc=U8234.EMA.0609CC4-V10-C11-T1 )
 2.        -      Interpartition Logical LAN
        ( loc=U8234.EMA.0609CC4-V10-C12-T1 )

 Type menu item number and press Enter or select Navigation key:1 -----------------> Select LAN adapter.
############################################################################
 PowerPC Firmware
 Version EM350_143
 SMS 1.7 (c) Copyright IBM Corp. 2000,2008 All rights reserved.
-------------------------------------------------------------------------------
 Select Task

Interpartition Logical LAN
    ( loc=U8234.EMA.0609CC4-V10-C11-T1 )

 1.   Information
 2.   Normal Mode Boot
 3.   Service Mode Boot

 Navigation keys:
 M = return to Main Menu
 ESC key = return to previous screen         X = eXit System Management Services
 -------------------------------------------------------------------------------
 Type menu item number and press Enter or select Navigation key:2 ----------------> Select NORMAL Boot
###########################################################################
 PowerPC Firmware
 Version EM350_143
 SMS 1.7 (c) Copyright IBM Corp. 2000,2008 All rights reserved.
-------------------------------------------------------------------------------
 Are you sure you want to exit System Management Services?
 1.   Yes
 2.   No
 Type menu item number and press Enter or select Navigation key:1 -------------------> Exit SMS menu
TFTP BOOT ---------------------------------------------------
Server IP.....................xxx.xxx.xxx.xxx
Client IP.....................xxx.xxx.xxx.xxx
Gateway IP....................xxx.xxx.xxx.xxx
Subnet Mask...................xxx.xxx.xxx.xxx
( 1  ) Filename................./tftpboot/subha
TFTP Retries..................5
Block Size....................512
FINAL PACKET COUNT = 29578
FINAL FILE SIZE = 15143424  BYTES
Elapsed time since release of system processors: 875750 mins 46 secs

Type a 1 and press Enter to use this terminal as the
  system console.
1

>>>  1 Type 1 and press Enter to have English during maintenance.
>>> Choice [1]: 1

                              Maintenance

Type the number of your choice and press Enter.
>>> 1 Access a Root Volume Group
    2 Copy a System Dump to Removable Media
    3 Access Advanced Maintenance Functions
    4 Erase Disks
    5 Configure Network Disks (iSCSI)
    6 Select Storage Adapters
    99  Previous Menu

>>> Choice [1]: 1
                             Warning:

If you choose to access a root volume group, you will NOT be able to return
to the Base Operating System Installation menus without rebooting.
Type the number of your choice and press Enter.
    0 Continue
>>> Choice [99]: 0
                           Access a Root Volume Group

Type the number for a volume group to display the logical volume information
and press Enter.
   1)   Volume Group 00c09cc400004c0000000133d92890b6 contains these disks:
          hdisk0  32768        vscsi  -----------> My rootvg disk
   2)   Volume Group 00c09cc400004c000000013d4da24a79 contains these disks:
          hdisk1  32768        vscsi
   3)   Volume Group 00c09cc400004c0000000133d9902be2 contains these disks:
          hdisk2  32768        vscsi
   Choice: 1
                           Volume Group Information
 ------------------------------------------------------------------------------
    Volume Group ID 00c09cc400004c0000000133d92890b6 includes the following
    logical volumes:
         hd6         hd8         hd4         hd2      hd9var         hd3
         hd1     hd10opt         hd7    sysdump1   hd11admin
 ------------------------------------------------------------------------------
Type the number of your choice and press Enter.

   1) Access this Volume Group and start a shell
   2) Access this Volume Group and start a shell before mounting filesystems

  99) Previous Menu
    Choice [99]: 1
# bosboot -ad hdisk0
0301-168 bosboot: The current boot logical volume, /dev/hd5,
        does not exist on /dev/hdisk0.
# lsvg -l rootvg | grep -i hd5

Now create hd5 on boot disk with 1PP on first edge.
# mklv -y hd5 -t boot -ae rootvg 1
hd5
# bosboot -ad hdisk0

bosboot: Boot image is 43303 512 byte blocks.
# lsvg -l rootvg | grep –I hd5
hd5                 boot       1       1       1    closed/syncd  N/A
# bootlist -m normal -o
hdisk0 blv=hd5
hdisk0 blv=hd5
#reboot
# bootlist -m normal -o
hdisk0 blv=hd5
hdisk0 blv=hd5

Saturday, February 23, 2013

How to get BASH shell behaviour on AIX server?

As you know BASH shell is having more advantages over any other Unix shells ... some of these features like command history,command editing by using up/down arrow keys, deleting/modifying typos ...

By default AIX uses ksh shell and we will not be able to get all of the above features what bash is having. This post will provide how to achive bash features on AIX machines.

Log in with your User name and you can see .profile under your home directory.

Take backup of your profile.
#cp -p /home//.profile /home//.profile.Date

Add the below lines to your .profile
#vi /home//.profile
set -o emacs
alias __A=`echo "\020"` # up arrow = ^p = back a command
alias __B=`echo "\016"` # down arrow = ^n = down a command
alias __C=`echo "\006"` # right arrow = ^f = forward a character
alias __D=`echo "\002"` # left arrow = ^b = back a character
alias __H=`echo "\001"` # home = ^a = start of line
export EXTENDED_HISTORY=ON


save the file.

Now restart your ssh session, you will be able to do bash operations in AIX machine.

Monday, February 4, 2013

Portmir in AIX and Unix

What is portmir?
Portmir is a very useful command to share your unix session with another remote user.
The portmir utility allows on TTY stream (monitor) to attach another TTY stream (Target).

Requirements:
1. Two Users should login on server.
Limitations:
1. At any point of time Only one mirror session will be active.

How To do/setup Portmir in AIX:
1. Log in to your Unix server from putty. Here my login ID is subha and host is aixtest.
# who
aixtest:/ # who
subha     pts/0       Feb  4 09:07     (X.X.X.X)


2. Issue command tty it will show your terminal details ..
#tty
aixtest:/ # tty
/dev/pts/0


3. Ask your remote user to login on server ... Here my remote user is reddy
#who
aixtest:/home/reddy $ who
reddy         pts/1       Feb  4 09:10     (X.X.X.X)   -------->Here remote terminal marked in RED
subha         pts/0       Feb  4 09:07     (X.X.X.Y)
aixtest:/home/reddy $


Here you can find your remote colleague terminal (my case remote user terminal /dev/pts1)

4. Run portmir command as Below to start sharing ..
#/usr/sbin/portmir -t pts/1
aixtest:/ # /usr/sbin/portmir -t pts/1
portmir: Remote user connected, mirroring active.
aixtest:/home/reddy $
portmir: Remote user connected, mirroring active.
hostname
aixtest
aixtest:/home/reddy $


5. Once your session is over terminate your portmirror with -o option ..

#/usr/sbin/portmir -o
aixtest:/home/reddy $ /usr/sbin/portmir -o
portmir: Mirroring is stopped.


If you're admin user and the other person temporarily requires root access to do
something (and you can't provide sudo's on emergency basis), then you can su -
in the portmir session, allowing the other person to have root access, while you
can see what he/she is doing.