Sunday, November 6, 2022

EMC HBA installation and configuration

This document describes how to install a particular HBA on diffferent O/S. AIX
To display what HBA's are installed

• •

To set

• • • •

lscfg lscfg-v-lfcs*

the configuration you must carry out the following:

List HBA WWN and entry on system DeterminecodelevelofOSandHBA
Download and install EMC ODM support fileset
run /usr/lpp/Symmetrix/bin/emc_cfgmgr (symmetrix) or /usr/lpp/emc/CLARiiON/bin/emc_cfgmgr (clariion)

To discover the SAN devices

/usr/lpp/EMC/Symmetrix/bin/emc_cfgmgr-viftheabovedoesnotworkreboot server

HP

To display what HBA's are installed.
/opt/fcms/bin/fcmsutil /dev/td# (A5158A HBA)

/opt/fc/bin/fcutil /dev/fcs# (A6685A HBA)
On a HP system there is no additional software to install.

The HP systems Volume address setting must be enabledon the SAN, you can check this will the following command.

symcfg-sid<SYMMID>-FAalllist(confirmthatthevolumesetaddressingissetto yes)

To discover the SAN devices
ioscan -fnC disk (scans hardware busses for devices according to class)

insf -e (install special device files) SUN

To display what HBA's are installed.

prtdiag -v dmesg

cat /var/adm/messages | grep -i wwn | more
To set the configuration you must carry out the following:

changes to the /etc/system file
HBAdrivermodifications
Persistentbinding(HBAandSDdriverconfigfile) EMCrecommendedchanges
Install the Sun StorEdge SAN Foundation package

Changes to /etc/system

SCSI throttle set sd:sd_max_throttle=20

Enable wide SCSI set scsi_options=0x7F8

SCSI I/O timeout value

sd:sd_io_time=0x3c (with powerpath) sd:sd_io_time=0x78 (without powerpath

Changes to HBA driver (/kernel/drv/lpfc.conf)

fcp-bind-WWNN=16

automap=2

fcp-on=1

lun-queue-depth=20

tgt-queue-depth=512

no-device-delay=1 (without PP/DMP) 0 (with PP/DMP)

xmt-que-size=256

scan-down=0

linkdown-tmo=0 (without PP/DMP) 60 (with PP/DMP)

Persistent Binding
Both the lpfc.conf and sd.conf files need to be updated. General format is name="sd" parent="lpfc" target="X" lun="Y" hba="lpfcZ"

X is the target number that corresponds to the fcp_bindWWNID lpfcZtX
Y is the LUN number that corresponds to symmetrix volume mapping on the symmetrix port WWN or HLU on the clariion
Z is the lpfc drive instance number that corresponds to the fcp_bind_WWID lpfcZtX

To discover the SAN devices

disk;devlinks;devalias (solaris 2.6) devfsadm (solaris 2.8)

/usr/sbin/update_drv -f sd (solaris 2.9 >) Windows

To display what HBA's are installed.
useadmintool"devicemanager"

To set the configuration you must carry out the following:

Registry edits
EMCrecommendedchanges Install emulex exlcfg utility

Registry changes

See the Host connectivity guide for windows or use the Emulex configuration tool to set the below registry settings.

Arbitrated loop without powerpath/ATF

InitLinkFlags=0x00000000 (arbitrated loop, auto-link speed)
WaitReady=45
LinkDown=45

TranslateQueueFull=1

Arbitrated loop with powerpath/ATF

InitLinkFlags=0x00000000 (arbitrated loop, auto-link speed)
WaitReady=10
LinkDown=10

Fabric without powerpath/ATF

InitLinkFlags=0x00000002 (fabric, auto-link speed) WaitReady=45
LinkDown=45
TranslateQueueFull=1

Fabric with powerpath/ATF

InitLinkFlags=0x00000002 (fabric, auto-link speed) WaitReady=10
LinkDown=10

Modifying the EMC environment
In the shortcut for the elxcfg add the "--emc" option to the target option. To discover the SAN devices

controlpanel->admintools->computermanagement->selectdiskmanagement- > (top menu)action -> rescan tools

Red Hat

1. Install the EMC rpms
2.
echo "scsi-qlascan" > /proc/scsi/qla2300/[0,1] 3. cd /apps/packages/EMC
4. ./rescan-scsi-bus.sh --luns=[list,range-range]

5. powermt config (to see the new lun[s] in Power Path) 6. powermt -display dev=all

How to setup anonymous FTP setup


1. Create the FTP home directory structure: mkdir /export/ftp/pub
mkdir /export/ftp/bin
mkdir /export/ftp/dev

mkdir /export/ftp/etc mkdir /export/ftp/usr mkdir /export/ftp/usr/lib

2. Add the ls command to the FTP bin directory: cp /usr/bin/ls /export/ftp/bin
chmod 111 /export/ftp/bin/ls

3. Copy the necessary libraries into the FTP directory structure: cp /usr/lib/ld.so* /export/ftp/usr/lib
cp /usr/lib/libc.so.1 /usr/lib/libdl.so.1 /export/ftp/usr/lib
cp /usr/lib/libintl.so.1 usr/lib/libw.so.1 /export/ftp/usr/lib

cp /etc/passwd /etc/group /etc/netconfig /export/ftp/etc

4. Copy the necessary files into the FTP directory structure to resolve NIS names: cp /usr/lib/nss*.so.1 /export/ftp/usr/lib
cp /usr/lib/libnsl.so.1 /export/ftp/usr/lib
cp /usr/lib/straddr.so /export/ftp/usr/lib

cp /etc/nsswitch.conf /export/ftp/etc

5. Set the permissions for the /export/ftp/usr/lib and /export/ftp/etc directories: chmod 555 /export/ftp/usr/lib/*
chmod 444 /export/ftp/etc/*

6. Set the permissions of all the created directories: chmod 555 /export/ftp/usr/lib
chmod 555 /export/ftp/usr
chmod 555 /export/ftp/bin

chmod 555 /export/ftp/dev chmod 555 /export/ftp/etc chmod 755 /export/ftp/pub chmod 555 /export/ftp

7. Add the following line to the /etc/passwd file: ftp:x:30000:30000:Anonymous FTP:/export/ftp:/bin/false

8. Add the following line to the /etc/shadow file: ftp:NP:6445::::

9. Make sure that everything is owned by root and not by FTP: chown -R root /export/ftp

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

1.. copy the required patch into /export/ftp/pub directory 2. unzip and untar the patch
3. review readme and install patch as recommended >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

The user name and password for this is as follows:

username: anonymous
password: you do not need a password, but if asked any text string or email address will do

Upgrading the file system from UFS to ZFS.

bash-3.2# uname -a
SunOS sukhoi 5.10 Generic_147440-01 sun4u sparc SUNW,Sun-Fire-480R


bash-3.2# zpool create rpool c1t1d0s0
invalid vdev specification
use '-f' to override the following errors:
/dev/dsk/c1t1d0s0 is part of exported or potentially active ZFS pool rpool. Please see zpool(1M).

bash-3.2# zpool create -f rpool c1t1d0s0
bash-3.2# zfs list
NAME    USED  AVAIL  REFER  MOUNTPOINT
rpool  77.5K  32.7G    31K  /rpool

bash-3.2# lustatus
ERROR: No boot environments are configured on this system
ERROR: cannot determine list of all boot environment names
bash-3.2# lucreate -c sol_stage1 -n sol_stage2 -p rpool
Determining types of file systems supported
Validating file system requests
Preparing logical storage devices
Preparing physical storage devices
Configuring physical storage devices
Configuring logical storage devices
Analyzing system configuration.
No name for current boot environment.
Current boot environment is named <sol_stage1>.
Creating initial configuration for primary boot environment <sol_stage1>.
INFORMATION: No BEs are configured on this system.
The device </dev/dsk/c1t0d0s0> is not a root device for any boot environment; cannot get BE ID.
PBE configuration successful: PBE name <sol_stage1> PBE Boot Device </dev/dsk/c1t0d0s0>.
Updating boot environment description database on all BEs.
Updating system configuration files.
The device </dev/dsk/c1t1d0s0> is not a root device for any boot environment; cannot get BE ID.
Creating configuration for boot environment <sol_stage2>.
Source boot environment is <sol_stage1>.
Creating file systems on boot environment <sol_stage2>.
Creating <zfs> file system for </> in zone <global> on <rpool/ROOT/sol_stage2>.
Populating file systems on boot environment <sol_stage2>.
Analyzing zones.
Mounting ABE <sol_stage2>.
Generating file list.
Copying data from PBE <sol_stage1> to ABE <sol_stage2>.
 22% of filenames transferred

100% of filenames transferred
Finalizing ABE.
Fixing zonepaths in ABE.
Unmounting ABE <sol_stage2>.
Fixing properties on ZFS datasets in ABE.
Reverting state of zones in PBE <sol_stage1>.
Making boot environment <sol_stage2> bootable.
Creating boot_archive for /.alt.tmp.b-Vqf.mnt
updating /.alt.tmp.b-Vqf.mnt/platform/sun4u/boot_archive
Population of boot environment <sol_stage2> successful.
Creation of boot environment <sol_stage2> successful.


bash-3.2# lustatus

Boot Environment           Is       Active Active    Can    Copy
Name                       Complete Now    On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
sol_stage1                 yes      yes    yes       no     -
sol_stage2                 yes      no     no        yes    -

bash-3.2# luactivate sol_stage2


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

The target boot environment has been activated. It will be used when you
reboot. NOTE: You MUST NOT USE the reboot, halt, or uadmin commands. You
MUST USE either the init or the shutdown command when you reboot. If you
do not use either init or shutdown, the system will not boot using the
target BE.

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

In case of a failure while booting to the target BE, the following process
needs to be followed to fallback to the currently working boot environment:

1. Enter the PROM monitor (ok prompt).

2. Change the boot device back to the original boot environment by typing:

     setenv boot-device
/pci@9,600000/SUNW,qlc@2/fp@0,0/disk@w21000004cffb7f68,0:a

3. Boot to the original boot environment by typing:

     boot

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

Modifying boot archive service
Activation of boot environment <sol_stage2> successful.

Reboot the server with  init 6 to boot from new boot environment.

bash-3.2# lustatus
Boot Environment           Is       Active Active    Can    Copy
Name                       Complete Now    On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
sol_stage1                 yes      no     no        yes    -
sol_stage2                 yes      yes    yes       no     -


bash-3.2# zfs list
NAME                    USED  AVAIL  REFER  MOUNTPOINT
rpool                  6.90G  25.8G  33.5K  /rpool
rpool/ROOT             4.38G  25.8G    31K  legacy
rpool/ROOT/sol_stage2  4.38G  25.8G  4.38G  /
rpool/dump             2.00G  25.8G  2.00G  -
rpool/swap              529M  26.4G    16K  -


bash-3.2# ludelete -f sol_stage1
Updating boot environment configuration database.
Updating boot environment description database on all BEs.
Updating all boot environment configuration databases.

deleted old boot environment disk for rpool mirroring


bash-3.2# lustatus
Boot Environment           Is       Active Active    Can    Copy
Name                       Complete Now    On Reboot Delete Status
-------------------------- -------- ------ --------- ------ ----------
sol_stage2                 yes      yes    yes       no     -


bash-3.2# zpool status
  pool: rpool
 state: ONLINE
 scan: none requested
config:

        NAME        STATE     READ WRITE CKSUM
        rpool       ONLINE       0     0     0
          c1t1d0s0  ONLINE       0     0     0

errors: No known data errors


bash-3.2# ! format
Searching for disks...done


AVAILABLE DISK SELECTIONS:
       0. c1t0d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
          /pci@9,600000/SUNW,qlc@2/fp@0,0/ssd@w21000004cffb7f68,0
       1. c1t1d0 <SUN36G cyl 24620 alt 2 hd 27 sec 107>
          /pci@9,600000/SUNW,qlc@2/fp@0,0/ssd@w21000004cffb7da9,0
Specify disk (enter its number):


bash-3.2# prtvtoc /dev/rdsk/c1t1d0s2 |fmthard -s - /dev/rdsk/c1t0d0s2
fmthard:  New volume table of contents now in place.

bash-3.2# zpool attach rpool c1t1d0s0 c1t0d0s0
invalid vdev specification
use '-f' to override the following errors:
/dev/dsk/c1t0d0s0 contains a ufs filesystem.
bash-3.2# zpool attach -f rpool c1t1d0s0 c1t0d0s0

Make sure to wait until resilver is done before rebooting.


bash-3.2# zpool status
  pool: rpool
 state: ONLINE
status: One or more devices is currently being resilvered.  The pool will
        continue to function, possibly in a degraded state.
action: Wait for the resilver to complete.
 scan: resilver in progress since Thu Jan 12 05:20:44 2017
    1.31G scanned out of 6.38G at 36.4M/s, 0h2m to go
    1.31G scanned out of 6.38G at 36.4M/s, 0h2m to go
    1.31G resilvered, 20.59% done
config:

        NAME          STATE     READ WRITE CKSUM
        rpool         ONLINE       0     0     0
          mirror-0    ONLINE       0     0     0
            c1t1d0s0  ONLINE       0     0     0
            c1t0d0s0  ONLINE       0     0     0  (resilvering)

errors: No known data errors




Sunday, October 16, 2022

How to install the Kernel Patching on Linux Hosts.

---
#### Ansible Playbook to perform Kernel Patching on RHEL/CentOS and Ubuntu/Debian Servers ####

- hosts:  Nodes
  become: yes
  serial: 4

  tasks:

    - name:  Task 1 - verify web/database processes are not running
      shell: if ps -eaf | egrep 'apache|http|nginx|mysql|postgresql|mariadb'|grep -v grep > /dev/null ;then echo 'process_running';else echo 'process_not_running';fi
      ignore_errors: true
      register: app_process_check


    - name:  Task 2 - decision point to start patching
      fail: msg="{{ inventory_hostname }} have running Application. Please stop the application processes first, then attempt patching."
      when: app_process_check.stdout == "process_running"


    - name:  Task 3 - upgrade kernel package on RHEL/CentOS server
      yum:
       name="kernel"
       state=latest
      when: app_process_check.stdout == "process_not_running" and ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'
      register: yum_update

    - name:  Task 4 - upgrade kernel package on Ubuntu server
      apt:
        update_cache: yes
        force_apt_get: yes
        cache_valid_time: 3600
        name: linux-image-generic
        state: latest
      when: app_process_check.stdout == "process_not_running" and ansible_distribution == 'Ubuntu' or ansible_distribution == 'Debian'
      register: apt_update

    - name: Task 5 - check if reboot required after kernel update on CentOS/RedHat servers
      shell: KERNEL_NEW=$(rpm -q --last kernel |head -1 | awk '{print $1}' | sed 's/kernel-//'); KERNEL_NOW=$(uname -r); if [[ $KERNEL_NEW != $KERNEL_NOW ]]; then echo "reboot_needed"; else echo "reboot_not_needed"; fi
      when: ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux'
      ignore_errors: true
      register: reboot_required

    - name: Task 6 - Check if a reboot is required after kernel update on Ubuntu/Debian servers
      register: reboot_required_file
      stat: path=/var/run/reboot-required get_md5=no
      when: ansible_distribution == 'Ubuntu' or ansible_distribution == 'Debian'

    - name: Task 7 - Reboot CentOS/RedHat systems if kernel updated
      command: shutdown -r +1  "Rebooting CentOS/RedHat Servers After Kernel Patching"
      async: 0
      poll: 0
      when: reboot_required.stdout == "reboot_needed" and (ansible_distribution == 'CentOS' or ansible_distribution == 'Red Hat Enterprise Linux')
      register: reboot_started
      ignore_errors: true

    - name: Task 8 - Reboot Ubuntu/Debian Servers if kernel updated
      reboot:
        msg: "Rebooting Ubuntu/Debian Servers After Kernel Patching"
        connect_timeout: 5
        reboot_timeout: 300
        pre_reboot_delay: 0
        post_reboot_delay: 30
        test_command: uptime
      when: reboot_required_file.stat.exists and (ansible_distribution == 'Ubuntu' or ansible_distribution == 'Debian')
      register: reboot_started_ubuntu
      ignore_errors: true

    - name: Task 9 - pause for 180 secs
      pause:
        minutes: 3

    - name: Task 10 - check if all the systems responding to ssh
      local_action:
        module: wait_for
          host={{ (ansible_ssh_host|default(ansible_host))|default(inventory_hostname) }}
          port=22
          search_regex=OpenSSH
          delay=15
          timeout=300
          state=started

Wednesday, September 28, 2022

How to check the the fc port status



root@sn-01:/var/log# more /sys/class/fc_host/host?/port_state
::::::::::::::
/sys/class/fc_host/host1/port_state
::::::::::::::
Offline
::::::::::::::
/sys/class/fc_host/host8/port_state
::::::::::::::
Online


command to find the portname

root@sn-01:/var/log# more /sys/class/fc_host/host?/port_name
::::::::::::::
/sys/class/fc_host/host1/port_name
::::::::::::::
0x2100f4e9d45897XX
::::::::::::::
/sys/class/fc_host/host8/port_name
::::::::::::::
0x2100f4e9d45897XX

Wednesday, September 14, 2022

How to check the date and time in system and ipmi from the host os.



ipmitool sel time get; date

How to Change the MTU in Mellnox.

enable sh int status sh int mlag sum config t int eth 1/13/1-1/13/4 shut int mlag-port-channel 11-14 shut int mlag-port-channel 11-14 mtu 9216 force int eth 1/13/1-1/13/4 mtu 9216 force int eth 1/13/1-1/13/4 no shut int mlag-port-channel 11-14 no shut write memory exit sh running

Thursday, August 25, 2022

Ansible ad hoc commands to find the high consuming processes

Find the high CPU consuming processes using ansible

 ansible compute/storage  -m shell -a "top -c -b | head -15"

 ansible compute/storage -m shell -a "ps -eo pid,ppid,%mem,%cpu,cmd --sort=-%mem | head"

 

Thursday, June 30, 2022

How to take a backup of a network device configuration

The simplest way to backup a switch is to simply display the config, and copy’n’paste the output from your terminal into a notepad.  It is good practice to also save the config to the network device’s memory once agian, just in case.

 

The command to display the config (and save) is:

Huwaei:

display current-configuration

run save

 

Cisco:

show running-configuration

copy running-config startup-config

 

Mellanox:

show running-configuration

write memory

Friday, June 24, 2022

How to check the status of the Mellanox port and check the mac address.


Login to the mellnox switch 

 And issue the following command to check the port status and Mac Address

show interface ethernet 1/13

 

 

 

Source: Friend. 

Tuesday, June 7, 2022

How to check the date and time are in sync from the Linux Host OS.

Example: Sukhoi:/tmp# ipmitool sel time get Sukhoi:/tmp# date Sukhoi:/tmp# hwclock

Sunday, March 20, 2022

How to collect the tcp dump in linux compute nodes.

tcpdump -nvvv -i <interface> -C 10 -s 0 -W 100 -S -w /tmp/ClientVM.pcap

Ideally on the compute node as well for the test.

tcpdump -nvvv -i <interface> -C 10 -s 0 -W 100 -S -w /tmp/CN07.pcap

How to get in to preboot cli in LSI.

Preboot CLI

 

If the customer cannot install the MegaCLI utility or it is not available for some other reason, you can get to the Preboot CLI and run the same commands as shown above.

The only difference is that the commands begin in the Preboot CLI after the 'MegaCli64' above.

For example:

$


$LDGetProp -Cache -LALL -a0 (Cache policy on the VDs)


$FwTermLog –Dsply –a0 (redirect the output to file)


$AdpAllInfo –a0 (Gives LSI FW and RAID type info)


$AdpBbuCmd -GetBbuStatus –a0 (BBU Status info)



$-AdpAllInfo -a0
$-PdList -a0
$-AdpEventLog -GetEvents -a0
$-fwtermlog -dsply -aALL -nolog -page20
$-cfgdsply -a0
$-adpbbucmd -a0
$-LdPdInfo -a0
$-LDInfo -LALL -a0