Showing posts with label AIX-CONCEPTS & ISSUES. Show all posts
Showing posts with label AIX-CONCEPTS & ISSUES. Show all posts

Monday, September 25, 2023

How to remove the hard disk (pdisk) in aix?

How to remove the hard disk (pdisk) in aix?


The below steps are clearly explained how to remove the hard disk (pdisk) in aix.

Please follow the below steps to replace the hdisk (pdisk) with the following steps

$ oem_setup_env
smitty sasdam
=> Delete a SAS Disk Array
=> sissasO
=>hdisk4
Confirm that we want to delete the array, you should get a message stating something like
hdisk4 deleted
pdisk4 Defined
ESC÷O or F10 (this may change according to your keyboard) to exit smitty

# diag
=> enter
=> Task Selection (Diagnostics, Advanced Diagnostics, Service Aids, etc.)
= Hot Plug Task
=> SCSI and SCSI RAID Hot Plug Manager
> Replace/Remove a Device Attached to an SCSI Hot Swap Enclosure Device
=> Select the slot of pdisk4
=> enter

You should have a message like “Running rmdev on pdisk4” followed by the following
The LED should be in the Remove state for the selected device.
YOU may now remove or replace the device.
Use ‘Enter’ to indicate you are finished.

Now it’s time to remove the failed disk and to insert the new disk, then return to the previous session and bit enter as per the reported message
You will be back to the previous menu, but this rune instead of pdisk4 you will have [populated]
ESC+3 or F3 (this may change according to your keyboard) to return to the previous menu

=> Configure Adde/Replaced Devices
You’ll get a ‘processing data” and then it will return to menu
ESC+O or 110 to exit diag

Now we have to recreate the array
# smitty sasdam
=> Create a SAS Disk Array
=> sissasO
=> 0
=> 256 Kb (recommended)
> pdisk4
Confirm that we want to create the new array
ESC+O or 110 (this way change according to your keyboard) to exit smitty.

see, the disk is successfully replaced, Now you can go ahead for your further steps based on your setup.



Saturday, March 16, 2019

How to migrate a aix server from AIX 6.1 to 7.1 easily?

How to migrate a aix server from AIX 6.1 to 7.1 easily?




There are different ways to migrate your system from one AIX version to another AIX version:


Migration by using NIM / CD-DVD / mksysb / alternate disk migration.


Sometimes you will be in a position to migrate a NIM master from AIX 6.1 to AIX 7.1.
It is difficult to migrate a nim server using another nim server as you facing some difficulties. 


Sometimes your server sitting in beyond the firewall (DMZ) area, you could not able to enable rsh/ssh/ping to the server from outside, at that time the above method will help you to migrate it easily.


The below steps are really really easy to perform the aix migration from AIX 6.1 to AIX 7.1 which does not required much requirements to meet.


Take a mksysb of the target server
server1# mksysb -ieX /backup/server1_aix61.mksysb



SCP the mksysb over to your NIM master and define it as a NIM mksysb resource
server1# scp /backup/server1_aix61.mksysb root@nimserver:/backupfs/.



Make sure you got the lpp_source and SPOT from the base AIX ISO images at the level you want to upgrade the system to. If not please create it.

nimserver# lsnim -l aix71_TL05_SP02_spot
nimserver# lsnim -l aix71_TL05_SP02_lppsource



Create the mksysb resource using the mksysb taken on the lpar mksysb

nimserver# nim -o define -t 'mksysb' -a server=master -a location=/backupfs/server1_aix61.mksysb server1_AIX61_mksysb



Use the 'nimadm' command to migrate the existing mksysb to a new + upgraded mksysb image with the following command

nimadm -s <spot> -l <lpp_source> -j <volume group for cache> -Y -T <old_mksysb_resource> -O <new mksysb resource file pathname> -N <new_mksysb_resource>

nimserver# nimadm -s aix71_TL05_SP02_spot -l aix71_TL05_SP02_lppsource -j nimadmvg -Y -T server1_AIX61_mksysb -O /backupfs/server1_7.1_mksysb -N server1_AIX71_mksysb




once that completes you would take the new mksysb file that was created and upgraded and scp it back to the lpar it was taken from

server1# scp /backupfs/server1_7.1_mksysb root@server1:/backup/



Install the "bos.alt_disk_install.rte" and "bos.alt_disk_install.boot_images" fileset to that system at the same TL/SP level as the level you upgraded that mksysb to

server1# mount nimserver:/aix71_TL05_SP02_lppsource  /mnt    -> where we hold the AIX 7.1 package

server1# smitty installp  -> install the "bos.alt_disk_install.rte" and "bos.alt_disk_install.boot_images"
(or)
          server1# installp -acgXYd .  bos.alt_disk_install.rte bos.alt_disk_install.boot_images

server1# alt_disk_mksysb -m -k  /backup/server1_7.1_mksysb -d hdisk2

Note: -k specifies that mksysb devices be kept (formally the ALT_KEEP_MDEV variables) This option is to having the customized network related settings to be cloned with mksysb from the old image to new image. 

If you are not using the "-k" option, there might be the chance to losing your network connectivity after the reboot.
           


Boot up from the upgraded disk

Server1# bootlist -m normal -o hdisk2


For the first reboot, it will take long time to reboot as the server booted from the pugraded OS. Please patience.  Once the server rebooted, please check the OS version and other post checks.

Server1# oslevel -s; lppchk -vm3; instfix -i|egrep -i 'tl|sp'; oslevel -rl7100-05

Server1# oslevel -s
7100.05.02.1134



see your server successfully migrated to AIX 7.1








Saturday, September 1, 2018

How to find out WWPN number of the HBA (FC) card in aix?

How to find out WWPN number of the HBA (FC) card in aix?


More often, We are in the situation to find out the wwpn number of the hba card in aix.

we are normally using "lscfg -vpl fcs(X)", or somebody using "lscfg -vpl fcs(X)|grep -i network"

But using the below for loop, we can easily identify all the hba card and its wwpn number of the server immediately.

Please keep this in your notepad, so that you can use it whenever it required.


for i in $(lscfg |grep fcs |awk '{print $2}'); do echo $i && lscfg -vl $i|grep Network;done


The output is like below. 

fcs0     Network Address.............10000000ABCD1234
fcs1     Network Address.............10000000EFGH4567
fcs2     Network Address.............10000000IJKL88900
fcs3     Network Address.............10000000ABEF4567




Wednesday, April 25, 2018

How to create a ISO image using mksysb and perform the restoration in aix?

How to perform the AIX restore using the ISO image in aix?



Assume the server name is "testserver"


Taking the mksysb on the /mnt directory. (it can be nim server nfs filesystem)
mksysb -i -e -X /mnt/testserver.mksysb     


To confirm the mksysb backup is good for restore.
listvgbackup –f /mnt/testserver.mksysb


To create a iso directory to hold the iso image and go inside it.
mkdir /mnt/testserver/iso
cd /mnt/testserver/iso


To create iso image using mksysb
mkcd -L -S -I /mnt/testserver/iso -m /mnt/testserver.mksysb


cd_image_12345 file has been created, we can rename it 


Rename the iso image for the better naming convention.
mv cd_image_12345 testserver.iso


Confirm the rename is successful
ls -l testserver.iso 


Now the iso can be stored in the /home/padmin directory of the VIO server.
scp testservcer.iso padmin@vioserver:/home/padmin/.


To Lists and displays information about the Virtual Media Repository.
lsrep


To create the media repository
mkrep -sp rootvg -size 10G


To confirm the media repository created
lsrep


To copy the iso image to the repository image
cp testserver.iso /var/vio/VMLibrary/


To create a optical device and map it on the proper vhostX
lsmap -vadapter vhost0
mkvdev -fbo -vadapter vhost0 -dev testserver_opt0
lsmap -vadapter vhost0


To load the virtual media on the optical device
loadopt -disk testserver.iso -vtd testserver_opt0
lsmap -vadapter vhost0


Now the output should be like


VTD testserver_opt0
Status Available
LUN 0x8200000000000000
Backing device /var/vio/VMLibrary/testserver.iso
Physloc
Mirrored N/A


Now we can able to restore the iso image to the corresponding lpar.

Login to the hmc and Activate the AIX server “testserver” to the SMS Menu
And choose the below options.

(5) Select boot option
(1) Select install/ Boot device
(7)  List all devices
(2) SCSI-CD ROM  (location code lun id match with the lun id of the mapped vhost - 0x8200000000000000)
(2)  Select normal boot
(1) Yes  (to exit system management service)

Once exiting from the sms menu, the server “testserver” will boot up from the virtual optical device to the AIX Installation Menus

Now the install /restoration aix operating system.starts



Note:

Sometimes, 2 ISO images created due to the large size of mksysb. In that case, while perform the restoration first we have to add the first iso image and after sometime we need to load the second .iso image. (The system will let you know to add the second iso image - "Please remove volume 1, insert volume 2, and press the ENTER key.")


Follow the below procedure if you are in the situation to add the second iso image.


lsmap –vadapter vhost0
unloadopt -vtd testserver_opt0
loadopt -disk testserver2.iso -vtd testserver_opt0
lsmap –vadapter vhost0



Saturday, May 20, 2017

NIM server and client configuration in AIX?

NIM server and client configuration in AIX?



NIM SERVER PRE-REQUISITE
========================

The below filesets required to setup NIM server and Client. We could check using      

#lslpp –l |grep nim.

bos.sysmgt.nim.master
bos.sysmgt.nim.spot


NIM SERVER INSTALLATION
========================

We could install using below commands

installp -agXd /mnt/nimpkg/bos.sysmgt.nim.master
installp -agXd /mnt/nimpkg/bos.sysmgt.nim.spot


lslpp -l |grep nim - To display the nim.spot and nim.master file sets
ls -l /etc/niminfo  -> The /etc/niminfo file created as part of the installation

The above installation creates the /etc/niminfo  file and the below deamons.

nimd and nimesis – daemon will get started, if it is not started, restart the inetd
startsrc –g inetd
startsrc –s nimd
startsrc -s nimesis


LPP_SOURCE

Lpp_source: This is having the content of aix in the CD for the aix installation

cd /export/install/nim/lpp_source
mkdir 6101LPP

smitty nim -> Perform NIM Adinistration Task -> Manage Resources -> Define a Resource
select lpp_source as resource type and enter

Fill it up the below mandatory field.
resource name                [61TL07]
resource type                 lpp_source
server of resource [master]
location of resource       [/export/install/nim/lpp_source/6101LPP]
source of install images [/cdrom]
Press enter, lpp_source will be created.

Commands to check
lsnim –l  <LPP_SOURCE NAME> detailed view
lsnim –c <lpp_name>

SPOT


Spot: This is used for aix installation which is created for each lpp_source

smitty nim ->  Perform NIM Adinistration Task ->  Manage Resources ->  Define a Resource
select spot as a resource type and enter

resource name                [spot_61TL07]
resource type                 spot
server of resource [master]
source of install images [61TL07_lpp]
location of resource       [/export/install/nim/spot]

Commands to check:
lsnim –l  <SPOTR NAME> detailed view
lsnim –c <sopt_name>


NIM CLIENT CONFIGURATION
==========================
 Nim master's /etc/hosts client IP and HOSTNAME and obviously client server supppose to be in DNS.

For NIM Client:
Required fileset: bos.sysmgt.nim.client   (This fileset present on aix server defaultly)

smitty nim_mkmac
Enter the machine name and press enter to continue
Select the type of network as "ent = ethernet network" and enter

* NIM Machine Name [abc_testlpar]
* Machine Type [standalone]
* Hardware Platform Type [chrp] Make sure this is set to ‘chrp’
Kernel to use for Network Boot [mp]
* Cable Type bnc/tp
* NIM Network master_net/enX
* Host Name abc_testlpar
 Press enter to continue

Commands to check
lsnim|grep -i abc_testlpar
lsnim -l abc_testlpar

Friday, February 3, 2017

How to check the apar installed in aix?

How to check the particular apar is installed in aix?


Many times we are in the position to check or install the specific apar in aix.

Below is the way to check whether the particular apar is already installed or not.

Example: APAR IZ97457


syntax: #instfix -ik <apar_name>

#instfix -ik IZ97457

All filesets for IZ97457 were found.

The above output shows that the APAR IZ97457 is already installed on the server.



Suppose if the apar is not installed on the server then we have to get the apar first and then installed it.

To list of fixes/apar that are on a directory or CD, then we can use the following:
# instfix -Td <directory>     (or)   # instfix -Td /dev/cd0

once you find out then installed the fix with the below command
# instfix -k <fix> -d <directory>
# instfix -k IZ97457 -d /export/filesets      (or) use # smitty update_by_fix





Thursday, December 22, 2016

How to solve current boot logical volume /dev/hd5, does not exist on /dev/hdisk# in aix?

How to solve current boot logical volume /dev/hd5, does not exist on /dev/hdisk# in aix?



Many cases we could receive this issue when we run mksysb command or run alt_disk copy or create/recreate the bosboot image on the disk.

Please follow the below procedure to fix the issue.


#cd /usr/bin
#cp mkszfile mkszfile.old
#vi mkszfile

search for the argument "-qv" and find the following line


BOOT_BLKS=`LC_MESSAGES=C ${bosboot} -qv | ${tail} -1l | ${awk} '{print $2 * 2}'` 


Add the  -d /dev/ipldevice. The line should look like this when finished


BOOT_BLKS=`LC_MESSAGES=C ${bosboot} -qvd /dev/ipldevice| ${tail} -1l | ${awk} '{print $2 * 2}'` 


then save it and run mksysb or alt_disk again.

or


change mkszfile to use  #bosboot -qvd /dev/ipldevice

****************************************************************************************************************************************



Another blv error

==============


If /dev/ipldevice vary with the boot disk, need to follow the below steps to correct it. We will do the first step for sure and it will end up with error as below, proceed with the next steps.

bosboot -ad /dev/ipldevice
0516-602 lslv: Logical volume name not entered.
0301-168 bosboot: The current boot logical volume, /dev/hd5,   does not exist on /dev/hdisk0.

Solution:
lsvg -p rootvg - hdisk0
lslv -m hd5 -->
hdisk0 on PV1 1st partition
savebase -v - successful

will remove/recreate hd5 – no need to worry it worked good

# rmlv hd5
# mklv -y hd5 -t boot -a e rootvg 1 hdisk0
# cd /dev
# rm ipldevice
# ln /dev/rhdisk0 /dev/ipldevice
# bosboot -ad /dev/ipldevice - same error

# bootinfo -B hdisk0 - 1
# ln /dev/rhd5 /dev/ipl_blv
# cd /dev -
same maj/min numbers
# bosboot -ad /dev/ipldevice

Now we got the same minor and major number for hdisk0

# ls -ld /dev/ipldevice
crw-------    2 root     system       20,  0 Oct 31 2019  ipldevice
# ls -ld /dev | grep -i "20,  0"
# ls -l /dev | grep "20,  0"
brw-------    1 root     system       20,  0 Mar 31 08:54 hdisk0
crw-------    2 root     system       20,  0 Oct 31 2019  ipldevice
crw-------    2 root     system       20,  0 Oct 31 2019  rhdisk0
#
alt_disk_install was able to proceed now

****************************************************************************************************************************

Another blv error

=============


0301-162 bosboot: savebase failed with /dev/hdisk0.

0301-165 bosboot: WARNING! bosboot failed - do not attempt to boot device.


Solution
=======

Boot the sever into maintenance mode
Remove the corrupted blv - #rmlv –f hd5
recreate the new hd5 blv logical volume - # mklv -y hd5 -t boot -a e rootvg
create a bootimage - # bosboot -ad /dev/hdisk0
Shutdwon -Fr