Saturday, April 18, 2020

How to change the reserve_policy to no_reserve to the secondary vios?

How to change the reserve_policy to no_reserve to the secondary vios?


On Client:

unmount /fs
varyoff datavg
rmdev -l hdisk2  (We need to set the disk as defined state)


Target VIO server:

lsmap -vadapter vhostX
rmvdev -vtd <vtd_name>
lsdev -dev hdiskX -attr
chdev -dev hdiskX -attr reserve_policy=no_reserve
lsdev -dev hdiskX -attr   (Now the reserve policy set to no_reserve)
mkvdev -vdev hdiskX -vadapter vhostX -dev <vtd_name>

On client:

cfgmgr
lsdev -Cc disk   (hdiskX should back available)
varyonvg datavg
mount /fs

Thursday, April 9, 2020

How to create a lppsource and spot on the nim server in aix?

How to create a lppsource on the nim server in aix?


The below steps clearly explains you to create a lppsource (aix71_TL4SP2_lppsource ) on the nim server using the similiar lppsource (which is already created succesfully) from some other nim servers.
so what we can do is, we can copy the content of the lppsource from other nim server and paste it on our target servers' filesystem and then define it as a lppsource resource.


create a separate filesystem for the lppsource in our target server
=========================================================

# mklv -y lpplv -t jfs2 testvg 120
# crfs -v jfs2 -d lpplv -A yes -m /lpp_source/aix71_TL4SP2_lppsource -a logname=INLINE -a logsize=245
# mount /lppsource/aix71_TL4SP2_lppsource
# df -gt /lppsource/aix71_TL4SP2_lppsource


Mount the similar aix71_TL4SP2_lppsource from another NIM server (named testnim) to our target Nim server
=======================================================================================

# mount testnim:/lpp_source/aix71_TL4SP2_lppsource /mnt


Copy all the files from the mounted lpp_source into the newly created filesystem
==================================================================

# cp -rp /mnt/aix71_TL4SP2_lppsource/* /lpp_source/aix71_TL4SP2_lppsource
# cd /lpp_source/aix71_TL4SP2_lppsource/installp/ppc
# chown root:system *
# chmod 644 *


Define the new lpp_source directory as an LPP_SOURCE resource
=====================================================
# nim -o define -t lpp_source -a server=master -a locatioin=/lpp_source/aix71_TL4SP2_lppsource aix71_TL4SP2_lppsource

# lsnim -l aix71_TL4SP2_lppsource   (** check the "Rstate" equals "ready for use" and "simages" equals yes**)



CREATE SPOT FROM NEW LPP_SOURCE
================================
 Define SPOT
===========

# nim -o define -t spot -a server=master -a location=/export/spot -a source=aix71_TL4SP2_lppsource aix71_TL4SP2_spot

# lsnim -l aix71_TL4SP2_spot    -> make sure the spot resource has been created.

 
Check if bos.alt_disk_install.rte is in spot
=============================================
# nim -o showres aix71_TL04SP2_spot|grep -i bos.alt_disk_install.rte

 "Execute only if bos.alt_disk_install.rte not in spot"  
#nim -o cust -a lpp_source=aix71_TL4SP2_lppsource -a filesets=bos.alt_disk_install.rte aix71_TL4SP2_spot

# nim -o showres aix71_TL4SP2_spot|grep -i bos.alt_disk_install.rte
# lsnim -l aix71_TL4SP2_spot


Migration concepts - How to update the existing lpp source with any additional filesets from the ISO iamges / DVD media in aix?

Migration concepts - How to update the existing lpp source with any additional filesets from the  ISO images in aix?


Implementation steps:

First copy the AIX710402 base iso images files to the target nim server using SCP.

  AIX_7.1_Base_7100-04-02_DVD_1_of_2_17226.iso
  AIX_7.1_Base_7100-04-02_DVD_2_of_2_17226.iso


1. Mount the iso images:
  # loopmount -i AIX_7.1_Base_7100-04-02_DVD_1_of_2_17226.iso -o "-V cdrfs -o ro" -m /mnt

2. Update the existing lpp source with any additonal filesets from the dvd media:
  # nim -o update -a show_progress=yes -a packages=all -a source=/mnt aix71_TL04_lppsource
  # cd /export/lpp_source/aix71_TL04_lppsource/installp/ppc
  # chown root:system *
  # chmod 644 *

(or)

smitty nim - perform nim admin tasks - manage resources - perform operations on resoruce - select aix71_TL04_lppsource - select "update=add or remove software to or from an lpp_source" -  select "Add" and enter the software media  source  
(Target lpp_source=aix71_TL04_lppsource; sources of software to add=/mnt; software packages to add: all)


Note down the list of packages that are being added to the lpp_source. We need this list if we were to backout.

3. Repeat step 1 and 2 for the second DVD image

4. Remove any duplicate software and superseded updates.

   # nim -o lppmgr -a lppmgr_glags="-bu-x-r" aix71_TL04_lppsource

(or)

# smitty nim - perform nim admin tasks - manage resources - perform operations on resoruce - select aix71_TL04_lppsource - select "lppmgr=eliminate unnecessasry software in an lpp_source"
(target lpp_source=aix71_TL04_lppsource; preview only:no; Remove duplicate software:yes; Remove superseded software:yes; Remove language software:no; Preserve lang: [C];  Remove non-simage software: no; Save removed files: no; directory for storing save files[]; Extend filesystem if space needed: yes)

5. Check the source "Rstate" equals "Ready for use" and "simages" equals "yes"

   # lsnim -l aix71_TL04_lppsource.

6. Update the SPOT resource (To make sure SPOT is in right state, check the SPOT resource and if required update or recreate it)

   # nim -o check -a show_progress=yes aix71_TL04_spot  
   # nim -o lppchk -a show_progress=yes aix71_TL04_spot
   # nim -o cust -a lpp_source=aix71_TL04_lppsource aix71_TL04_spot

if any of the above operation fails or give errors, remove the SPOT resource and recreate it from the updated lpp_source.

   # nim -o remove aix71_TL04_spot
   # nim -o define -t spot -a show_progress=yes -a server=master -a location=/export/spot/aix71_TL04_spot -a installp_flags=aQg -a source=aix71_TL04_lppsource aix71_TL04_spot


7. Check the source "Rstate" equals "Ready for use" and correct OS levels are reported.

    #lsnim -l aix71_TL04_spot


Wednesday, April 8, 2020

Migration issues - After the OS migration done, we could not able to ssh to the server?

Migration issues - After the OS migration done, we could not able to ssh to the server?


We could not able to ssh to the server once we migrated the server to AIX 7.1. Looks like there is a bug in AIX 7.1 ssh.

Please follow the below to fix the issue.


Problem:
=======

testlpar: # ssh root@testlpar2
Connection closed by testlpar2
testlpar: #


Solution:
=======

Take the backup of /etc/ssh/sshd_config file and please add "hostKeyAlgorithms +ssh-dss" to the /etc/ssh/sshd_config file, then you can able to ssh to the server witout any issues.

or

Take the backup of /etc/ssh/sshd_config file and please add "HostKey /etc/ssh/ssh_host_rsa_key" to the /etc/ssh/sshd_config file, then you can able to ssh to the server witout any issues.


Now try to ssh now!

testlpar: # ssh root@testlpar2
root@testlpar2's  password:



Migration issues - Server degraded but lppchk didn't show anything in aix?

Migration issues - Server degraded but lppchk didn't show anything in aix?


After the server migration done, the OS level is degraded to 7.1.3.4. when i checked the "lppchk -vm3" it did not show any output.

so I tried to check with oslevel -rl command and identified the issue. Here is the history and solution

testlpar: # oslevel -s
7100-03-04-1441
testlpar: #

testlpar: # lppchk -vm3      -> lppchk didn't show any error. looks like clean
testlpar: #

testlpar: # oslevel -rl 7100-05     -> This will clearly tell you where the issue is.
 Fileset                        Actual level  Recommended level
Java5.sdk                   5.0.0.570            5.0.0.620
testlpar: #

testlpar: # instfix -i|grep -i ml
.
.
Not all filesets for 7100-04_AIX_ML were found
Not all filesets for 7100-05_AIX_ML were found
testlpar: #


Solution:

It clearly says that the problem is with the java5.sdk filesets. Speak to IBM and get the Java5.sdk packages as it is not comes in default when you download the packages from fixcentral for the migration.

Keep the packages under /tmp/java_package directory

cd /tmp/java_packages
inutoc .
installp -acgXYd . java5.sdk
lppchk -vm3
oslevel -rl 7100-05    -> Now the oslevel will be in the expected desired level
instfix -i|egrep -i 'ml|sp'     -> All the ML and SP filesets were found.


Migration issues - lppchk issues after migration done in aix?

Migration issues - lppchk issues after migration done in aix?


testlpar: # lppchk -vm3

lppchk: The following filesets need to be installed or corrected to bring the system to a consistent state.

bos.ecc_client.rte 7.1.5.0     (usr: APPLIED, root: BROKEN)
rpm.rte            4.13.0.2    (usr: COMMITED, root: not installed)

testlpar: #


Solution:
=======

testlpar: # cd <directory of AIX 7.1.5.2 lppsource directory which you used for migratioin>

you may see the below files under it.

testlpar: # ls -al bos.ecc*
-rwxr-xr-x   1   root   system 2356343 APR 11 2020  bos.ecc_client.7.1.5.0.I
-rwxr-xr-x   1   root   system 2356343 APR 11 2020  bos.ecc_client.7.1.5.0.U
testlpar: # ls -al rpm*
-rwxr-xr-x   1   root   system 4832243 APR 11 2020  rpm.rte.4.13.0.2.I
testlpar: #


Then force re-isntall them as below.


testlpar: # installp -acFXYd ./ bos.ecc_client.rte
testlpar: # installp -acgNXYd ./ bos.ecc_client.rte 7.1.5.0
testlpar: # installp -acFXYd ./ rpm.rte

Then run "lppchk -vm3", it should be clean.


Pre-Post migration check-out -preparation in aix?

Pre-Post migration check-out -preparation in aix?


   Pre Migration check out


# lscfg |grep Architecture
System platform check - Only CHRP systems are supported in AIX 5.2 and above
# prtconf |grep 'Processor Type'
only 64-bit common hardware reference platform (CHRP) machines supported
# ls -al /dev/rootvg; ls -al /dev/hd5
verity the major number for /dev/rootvg and /dev/hd5 is 10.
# lslv -m hd5
Find out which disk contains your hd5 logical volume.
# bosboot -ad /dev/hdisk0; bosboot —ad /dev/ipldevice
verify boot image can be successfully recreated using the hdisk and by using /dev/ipldevice.
# lsvg -i rootvg|grep -i hd5; lsvg rootvg|grep SIZE
Currently the recommended allocated space to have for hd5 is 32mb
# lspv -M hdisk0|grep -i hd5
the hd5 lv covers the first or first 3 partitions on the disk based on the size. (Min is 32MB)
# bootinfo -r
To check the system has minimum memory (AIX 5.3 - 256MB, AIX 6.1/7.1 - 512MB)
# lppchk -vm3
lppchk command should be run to check system consistency
# instfix -i|egrep -i 'ml|sp'
To check currently Installed TL / SP filesets are consistent.
# lscfg -vl hdisk*|grep -i hdisk*
To get the disk location.
# emgr -l; emgr -r -L <efix>
Need to remove any efix applied on the systems.
# lspv|egrep -i 'alt|old|reserve|none'
To check any spare disks/reserved disk present on the system. you can see alt/old rootvg
# /usr/lpp/bos/pre_migration
Execute pre_migration script. output saved in /home/pre_migration.<date> directory.


"Note"
Take all the necessary checks/output like df -gt; netstat -nr; ifconfig -a;



    Post Migration checks out


# /usrlpp/bos/post_migration
To check that your migration was succsiful (all output will be saved in /home/post_migration.<date> directory.)
# lppchk -vm3
lppchk command should be run to check system consistency (no output is best)
# oslevel -s
To check the expected target level achieved.
# instfix -i|egrep -i 'ml|sp'
To check currently Installed TL / SP filesets are consistent.


Note
Filesets that did not migrate can now be migrated using a software source containing the software
 and running a smitty update_all





Miration issues: After migration done, we could not able to ssh to the server due to the changes on the /.ssh/known_hosts in aix?

Miration issues: After migration is done, we could not able to ssh to the server due to the changes in the /.ssh/known_hosts in aix?


 
After the server migrated, we could not ablet o ssh the server due to the changes on the /.ssh/known_hosts during the migration, this situation would happen especially on the cluster environment. In order to fix this, you have to follow the error message as the solution is mentioned in the error messages clearly.

testlpar1: # ssh root@testlpar2
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the RSA Key sent by the remote host is
SHA256:Qx5ofuasgihsknglisidghi4gosidgnog/LQg.
Please correct your system administrator.
Add correct host key in /.ssh/known_hosts to get rid of this message.
Offending DSA key in /.ssh/known_hosts:3
RSA host key for tesetlpar2 has changed and you have requested strict checking.
Host key verification failed.
testlpar1: #


Solution
=======

In the above errors, it clearly says that we need to correct the host key in /.ssh/known_hosts and it also provide the solution like "offending DSA key in /.ssh/known_hosts:3" which means
that you need to comment out the third (3) lines on the /.ssh/known_hosts using vi editor.

cp -p /.ssh/known_hosts /.ssh/known_hosts_backup
vi /.ssh/known_hosts   (comment out the 3rd line)

The first time it asks the yes/no confirmation, next time onwards it won't ask. (directly logon to the servers)




Tuesday, April 7, 2020

Migration issues - "Not all the filesets for 71-02-031334_SP were found" in aix?

Migration issues - "Not all the filesets for 71-02-031334_SP were found" in aix?


After the migration done, we got the below error when we execute the "instfix -i|grep -i sp" command.

"Not all the filesets for 71-02-031334_SP were found"


Solution: 


In order to fix this, first we need to identify what filesets are not found in the particular SP level. We can use the below command to identify the filesets details of the particular sp level.


instfix -icqk <not found filesets level> |grep ":-:"


testlpar: # instfix -icqk 71-02-031334SP|grep ":-:"

71-02-031334_SP: DirectorCommonAgent:6.3.0.3:6.2.1.3:-:AIX 7100-02-03 service pack

testlpar: #


so the above output clearly says that the service pack issue with the "DirectorCommonAgent" which is not required, so we can removed it to fix it.



Migration issues - After reboot, The server went to open firmware state in aix?

Migration issues - After reboot, The server went to open firmware state in aix?


After the server reboot, the server went to open firmware state.


When I checked one the console, it look like below.


"testlpar, open firmware, 2"


Solution
========

Power off the server and then power on the server with teh normal mode.  (The issue occured as the server is set with "Open the server in SMS mode")

lssyscfg -r lpar -F name,state,lpar_id
chsysstate -r lapr -o shutdown --id 2
chsysstate -r lpar -o on --id 2 -b norm
mkvt -id 2

(or)

chsysstate -m <frame_name> -r lpar -o shutdown --immed -n <lpar_name>
chsysstate -r lpar -m <frame_name> -o on -f Normal -b norm -n <lpar_name>