Tuesday, 9 August 2022

 

To list contents from mksysb and restore:

restore -T -q -l -f vio1.mksysb | grep nimbck.ksh  --> To list

restore -x -q -f vio1.mksysb ./home/padmin/nimbck.ksh --> To restore

 


--->Enable ftp and telnet in AIX and Solaris::

AIX & SOL 8/9

 Actions to Enable:

   

 sed 's/^#telnet/telnet/;s/^#ftp/ftp/;s/^tftp/#tftp/' /etc/services > /tmp/file && mv /tmp/file /etc/services

 

 sed 's/^#telnet/telnet/;s/^#ftp/ftp/' /etc/inetd.conf > /tmp/file && mv /tmp/file /etc/inetd.conf

 

SOLARIS

 # /usr/sbin/svcadm enable ftp

       

 

 

-->To take VIOs image backup and exclude media files:


ioscli backupios -file /mnt/`uname -n`.mksysb -mksysb -nomedialib"  > /viosbackups/`uname -n` .mksysb.out 2>&1



 


-->Script to get all the FCS cards WWN numbers from a client.

for i in $(lspath|awk '/fscsi/ {print $3}'|uniq|awk -Ffscsi '{print $NF}'); \

do wwn=$(lscfg -vl fcs$i | awk -F. '/Network Address/ {print $NF}'); echo fcs$i $wwn;done


fcs0 C05076038CFC0120

 


--->Script to remove all the files except some using xargs command..

ls | grep -v ^16.1|xargs -i% rm -rf % or

ls | grep -v ^16.1|xargs rm

 


Delete all the hdisk devices EXCEPT the disks from rootvg in AIX:

lets's say  hdisk0 and hdisk1 (rmdev –dl)  


# lspv | grep –v rootvg |grep hdisk |awk {‘print $1’} | xargs –i% rmdev –dl %

 


:::HMC DLPAR ISSUES SORTED OUT:::

1) From *VIO can it ping vhmc or hmc ?

ping -S <VIO IP> <HMC IP>

.

2) From vhmc or hmc can it ping *VIO ?

ping -I <HMC IP>  <VIO IP>

.

Check if telnet works via port 657:

3) From *VIO:

telnet <HMC IP> 657

netstat -Aan | grep 657

.

4) From vhmc or hmc:

telnet <VIO IP> 

netstat -anp | grep 657

.

5) If firewall exists between *VI0 and vhmc or hmc, please check that port 657 TCP/UDP is opened bi-directional on the firewall.

.

Here we need pesh pw's for running commands on hmc. You need to be root. (you have to ask IBM vendor to provide Pesh password)

chhmcusr -u hscpe -t passwd

ssh hscpe@localhost

then

pesh serial-number-of-HMC-machine


As you can see from the below the telnet from HMC to *VIO is showing the port 657 TCP is blocked.

.

[root@vhmc ~] # telnet <VIO IP> 657

Connection closed by foreign host

.

That means port 657 TCP/UDP is blocked on firewall/switch/router between vhm and *VIO.

.

So your next step is to check with your firewall team and get the port 657 TCP/UDP opened bi-directional.



IF we  found that both *VIO1 and *VIO2 have duplicate nodeid's


This can cause unpredictable results and can cause a good RMC connection to bounce between lpars. 


VIO1:

#cat ct_node_id

1709efca1ed5b6c8


VIO2:

#cat ct_node_id

1709efca1ed5b6c8


So to correct this we need to generate a new nodeid on *VIO1.

Please do the following on *VIO1:


1) /usr/sbin/rsct/install/bin/recfgct

2) /usr/sbin/rsct/bin/rmcctrl -p



/usr/sbin/rsct/bin/rmcctrl -z

/usr/sbin/rsct/bin/rmcctrl -A

/usr/sbin/rsct/bin/rmcctrl -p



lssrc -a | grep rsct

lsrsrc IBM.MCP

[]

# netstat -an | grep 657


# lspartition -dlpar | grep -A 1 <lpar_ipaddress>


Then DLPAR should be working fine now..