Search This Blog

Friday, 29 June 2018

Solaris Kernel Zone under VCS A/P cluster

Zone Configuration: 

Zone root volume is on zfs block device.Zpool is on shared disk.

-bash-4.4# zonecfg -z mprs023 export
create -b
set brand=solaris-kz
set autoboot=true
set autoshutdown=shutdown
set hostid=0x2279686c
add anet
set lower-link=net0
set configure-allowed-address=true
set link-protection=mac-nospoof
set mac-address=auto
set vlan-id=208
set id=0
end
add anet
set lower-link=net1
set configure-allowed-address=true
set link-protection=mac-nospoof
set mac-address=auto
set vlan-id=208
set id=1
end
add device
set storage=dev:/dev/zvol/dsk/mprs023-pool/rvol
set bootpri=0
set id=1
end
add capped-memory
set physical=16G
end
add virtual-cpu
set ncpus=8
end
add keysource
set raw="{base64}uGaTTZLhlWTekkc3QpKlhA=="
end



VCS Configuration (main.cf)


group mprs023-SG (
        SystemList = { mprs067 = 0, mprs069 = 1 }
        ContainerInfo = { Name = mprs023, Type = Zone, Enabled = 1 }
        AutoStartList = { mprs067, mprs069 }
        )

        Zone mprs023-zone (
                Pool = mprs023-zpool-res
                BootState = multi-user-server
                ShutdownGracePeriod = 5
                ForceAttach = 0
                AttachOptions = "-x force-takeover"
                )

        Zpool mprs023-zpool-res (
                PoolName = mprs023-pool
                AltRootPath = "/"
                ChkZFSMounts = 0
                ZoneResName = mprs023-zone
                ForceRecoverOpt = 1
                )

        mprs023-zone requires mprs023-zpool-res

Thursday, 30 November 2017

In solaris 11, its not recomented to edit resolv.conf file directory. Below is the proceedure to configure it.

Ensure, DNS client service is online.
[code]
root@eecsaruh2hoc007 # svcs -a | grep dns
disabled       Jun_25   svc:/network/dns/multicast:default
disabled       Jun_25   svc:/network/dns/server:default
online         Jun_25   svc:/network/dns/client:default
[/code]
Configure DNS client configuration with required values
[code]
root@eecsaruh2hoc007 # svccfg -s dns/client
svc:/network/dns/client> setprop config/nameserver = (10.14.10.13 10.14.10.14 10.64.10.13)
svc:/network/dns/client> setprop config/domain = prod.mobily.lan
svc:/network/dns/client> setprop config/search = prod.mobily.lan
svc:/network/dns/client> exit
[/code]
Restart the service
[code]
root@eecsaruh2hoc007 # svcadm refresh dns/client # svcadm restart dns/client
[/code]
Verify the change:
[code]
root@eecsaruh2hoc007 # cat /etc/resolv.conf

#
# _AUTOGENERATED_FROM_SMF_V1_
#
# WARNING: THIS FILE GENERATED FROM SMF DATA.
#   DO NOT EDIT THIS FILE.  EDITS WILL BE LOST.
# See resolv.conf(4) for details.

domain  prod.mobily.lan
search  prod.mobily.lan
nameserver      10.14.10.13
nameserver      10.14.10.14
nameserver      10.64.10.13

[/code]


[b]Setting up nsswitch conf.[/b]
Ensure, name-service service is online
Change the properties based on your requirements
[code]
root@eecsaruh2hoc007 #  svccfg -s name-service/switch
svc:/system/name-service/switch> setprop config/host = "files dns"
svc:/system/name-service/switch> setprop config/ipnode = astring: "files dns"
svc:/system/name-service/switch> refresh
svc:/system/name-service/switch> exit
[/code]
Restart name-service service
[code]
root@eecsaruh2hoc007 # svcadm refresh name-service/switch
root@eecsaruh2hoc007 # svcadm restart  name-service/switch
[/code]

Verify the change:
[code]
root@eecsaruh2hoc007 # grep dns /etc/nsswitch.conf
hosts:  files dns
ipnodes:        files dns
[/code]

Wednesday, 1 November 2017

Creating SSL self signed key and certificate for apache webserver.

Use below single command to create SSL self signed certificate and key.


openssl req  -nodes -new -x509  -keyout yum.prod.example.lan.key -out yum.prod.example.lan.cert


Once created, this certificates can be used in ssl.conf like below.


NameVirtualHost *:443


ServerAdmin unixadmin@example.com.sa
ServerName yum.prod.example.lan
SSLEngine on
SSLCertificateFile /etc/httpd/certificate/yum.prod.example.lan.cert
SSLCertificateKeyFile /etc/httpd/certificate/yum.prod.example.lan.key
CustomLog  /var/log/httpd/yum_access_ssl.log combined
ServerAlias yum
DocumentRoot /apps/yum
"
        Options Indexes FollowSymLinks MultiViews




Restart httpd
Now you can access the link using https://yum.prod.example.lan

LDOM Virtual Function to HBA controller path mapping

Script.


domain=`virtinfo -c current get -H -o value domain-name`
for device in `ldm list-io|grep IOVFC.PF|egrep $domain|awk {'print $1'}`;
 do
        #echo "ldm list-io -l -p $device|grep type=PF|awk -F\| {'print $2'}|sed 's/dev=//g'"
        dev=`ldm list-io -l -p $device|grep type=PF|awk -F\| {'print $2'}|sed 's/dev=//g'`
        CFG=`ls -ltr /dev/cfg/*|grep $dev|awk {'print $9'}|head -1`
        echo  "$dev \t $device \t $CFG"
done




pci@300/pci@1/pci@0/pci@4/SUNW,qlc@0     /SYS/IOU0/PCIE4/IOVFC.PF0       /dev/cfg/c1
pci@300/pci@1/pci@0/pci@4/SUNW,qlc@0,1   /SYS/IOU0/PCIE4/IOVFC.PF1       /dev/cfg/c2
pci@340/pci@1/pci@0/pci@2/SUNW,qlc@0     /SYS/IOU0/PCIE2/IOVFC.PF0       /dev/cfg/c8
pci@340/pci@1/pci@0/pci@2/SUNW,qlc@0,1   /SYS/IOU0/PCIE2/IOVFC.PF1       /dev/cfg/c9
pci@380/pci@1/pci@0/pci@8/SUNW,qlc@0     /SYS/IOU0/PCIE5/IOVFC.PF0       /dev/cfg/c20
pci@380/pci@1/pci@0/pci@8/SUNW,qlc@0,1   /SYS/IOU0/PCIE5/IOVFC.PF1       /dev/cfg/c21
pci@3c0/pci@1/pci@0/pci@4/SUNW,qlc@0     /SYS/IOU0/PCIE8/IOVFC.PF0       /dev/cfg/c22
pci@3c0/pci@1/pci@0/pci@4/SUNW,qlc@0,1   /SYS/IOU0/PCIE8/IOVFC.PF1       /dev/cfg/c23
pci@600/pci@1/pci@0/pci@8/SUNW,qlc@0     /SYS/IOU0/PCIE13/IOVFC.PF0      /dev/cfg/c29
pci@600/pci@1/pci@0/pci@8/SUNW,qlc@0,1   /SYS/IOU0/PCIE13/IOVFC.PF1      /dev/cfg/c30
pci@640/pci@1/pci@0/pci@4/SUNW,qlc@0     /SYS/IOU0/PCIE16/IOVFC.PF0      /dev/cfg/c31
pci@640/pci@1/pci@0/pci@4/SUNW,qlc@0,1   /SYS/IOU0/PCIE16/IOVFC.PF1      /dev/cfg/c32
pci@680/pci@1/pci@0/pci@4/SUNW,qlc@0     /SYS/IOU0/PCIE12/IOVFC.PF0      /dev/cfg/c33
pci@680/pci@1/pci@0/pci@4/SUNW,qlc@0,1   /SYS/IOU0/PCIE12/IOVFC.PF1      /dev/cfg/c34
pci@6c0/pci@1/pci@0/pci@8/SUNW,qlc@0     /SYS/IOU0/PCIE9/IOVFC.PF0       /dev/cfg/c40
pci@6c0/pci@1/pci@0/pci@8/SUNW,qlc@0,1   /SYS/IOU0/PCIE9/IOVFC.PF1       /dev/cfg/c41

Oracle Oracle_QLE8362 Firmware upgrade (SRIOV)

How to find the model.

Get the PCIO slot of HBA adaptor

root@eecsaruh6hoc007 # ldm list-io|grep IOVFC|more
/SYS/IOU0/PCIE4/IOVFC.PF0                  PF     pci_0    primary
/SYS/IOU0/PCIE4/IOVFC.PF1                  PF     pci_0    primary
/SYS/IOU0/PCIE2/IOVFC.PF0                  PF     pci_1    primary
/SYS/IOU0/PCIE2/IOVFC.PF1                  PF     pci_1    primary
/SYS/IOU0/PCIE5/IOVFC.PF0                  PF     pci_2    primary
/SYS/IOU0/PCIE5/IOVFC.PF1                  PF     pci_2    primary
/SYS/IOU0/PCIE8/IOVFC.PF0                  PF     pci_3    primary
/SYS/IOU0/PCIE8/IOVFC.PF1                  PF     pci_3    primary
/SYS/IOU0/PCIE13/IOVFC.PF0                 PF     pci_12   primary
/SYS/IOU0/PCIE13/IOVFC.PF1                 PF     pci_12   primary
/SYS/IOU0/PCIE16/IOVFC.PF0                 PF     pci_13   primary
/SYS/IOU0/PCIE16/IOVFC.PF1                 PF     pci_13   primary
/SYS/IOU0/PCIE12/IOVFC.PF0                 PF     pci_14   primary
/SYS/IOU0/PCIE12/IOVFC.PF1                 PF     pci_14   primary
/SYS/IOU0/PCIE9/IOVFC.PF0                  PF     pci_15   primary
/SYS/IOU0/PCIE9/IOVFC.PF1                  PF     pci_15   primary
/SYS/IOU1/PCIE4/IOVFC.PF0                  PF     pci_16   secondary
/SYS/IOU1/PCIE4/IOVFC.PF1                  PF     pci_16   secondary
/SYS/IOU1/PCIE5/IOVFC.PF0                  PF     pci_18   secondary
/SYS/IOU1/PCIE5/IOVFC.PF1                  PF     pci_18   secondary
/SYS/IOU1/PCIE8/IOVFC.PF0                  PF     pci_19   secondary
/SYS/IOU1/PCIE8/IOVFC.PF1                  PF     pci_19   secondary
/SYS/IOU1/PCIE13/IOVFC.PF0                 PF     pci_28   secondary
/SYS/IOU1/PCIE13/IOVFC.PF1                 PF     pci_28   secondary
/SYS/IOU1/PCIE16/IOVFC.PF0                 PF     pci_29   secondary
/SYS/IOU1/PCIE16/IOVFC.PF1                 PF     pci_29   secondary
/SYS/IOU1/PCIE12/IOVFC.PF0                 PF     pci_30   secondary
/SYS/IOU1/PCIE12/IOVFC.PF1                 PF     pci_30   secondary
/SYS/IOU1/PCIE9/IOVFC.PF0                  PF     pci_31   secondary
/SYS/IOU1/PCIE9/IOVFC.PF1                  PF     pci_31   secondary



Get the Model from prtdiag output by grepping the location of the card(eg. IOU0/PCIE4 from above o/p). here the model is QLE8362.



root@eecsaruh6hoc007 # partdiag -vvv|grep IOU0/PCIE4
/SYS/IOU0/PCIE4   PCIE  SUNW,qlc-pciex1077,2031           QLE8362    8.0GT/x8   8.0GT/x4
/SYS/IOU0/PCIE4   PCIE  SUNW,qlc-pciex1077,2031           QLE8362    8.0GT/x8   8.0GT/x4
/SYS/IOU0/PCIE4   PCIE  fibre-channel-pciex1077,2431                 8.0GT/x8   8.0GT/x4
/SYS/IOU0/PCIE4   PCIE  fibre-channel-pciex1077,2431                 8.0GT/x8   8.0GT/x4
/SYS/IOU0/PCIE4   PCIE  fibre-channel-pciex1077,2431                 8.0GT/x8   8.0GT/x4
/SYS/IOU0/PCIE4   PCIE  fibre-channel-pciex1077,2431                 8.0GT/x8   8.0GT/x4
/SYS/IOU0/PCIE4   PCIE  fibre-channel-pciex1077,2431                 8.0GT/x8   8.0GT/x4
/SYS/IOU0/PCIE4   PCIE  fibre-channel-pciex1077,2431                 8.0GT/x8   8.0GT/x4
/SYS/IOU0/PCIE4   PCIE  fibre-channel-pciex1077,2431                 8.0GT/x8   8.0GT/x4
/SYS/IOU0/PCIE4   PCIE  fibre-channel-pciex1077,2431                 8.0GT/x8   8.0GT/x4
/SYS/IOU0/PCIE4   PCIE  fibre-channel-pciex1077,2431                 8.0GT/x8   8.0GT/x4
/SYS/IOU0/PCIE4   PCIE  fibre-channel-pciex1077,2431                 8.0GT/x8   8.0GT/x4
/SYS/IOU0/PCIE4   PCIE  fibre-channel-pciex1077,2431                 8.0GT/x8   8.0GT/x4
/SYS/IOU0/PCIE4   PCIE  fibre-channel-pciex1077,2431                 8.0GT/x8   8.0GT/x4
/SYS/IOU0/PCIE4   PCIE  fibre-channel-pciex1077,2431                 8.0GT/x8   8.0GT/x4
/SYS/IOU0/PCIE4   PCIE  fibre-channel-pciex1077,2431                 8.0GT/x8   8.0GT/x4
/SYS/IOU0/PCIE4   PCIE  fibre-channel-pciex1077,2431                 8.0GT/x8   8.0GT/x4
/SYS/IOU0/PCIE4   PCIE  fibre-channel-pciex1077,2431                 8.0GT/x8   8.0GT/x4
SYS/IOU0/PCIE4                     CAR       enabled
SYS/IOU0/PCIE4/CAR                 CARD      enabled




Download the required firemware from Vendor website. http://driverdownloads.qlogic.com/QLogicDriverDownloads_UI/Oracle_Search.aspx

Here we download Oracle_QLE8362_SRIOV_Flash_Kit_07.zip

Version before upgrade


root@eecsaruh6hoc007 # fcinfo hba-port|grep FCode
FCode/BIOS Version:  BIOS: 3.24; fcode: 4.06; EFI: 5.50;
FCode/BIOS Version:  BIOS: 3.24; fcode: 4.06; EFI: 5.50;
FCode/BIOS Version:  BIOS: 3.24; fcode: 4.06; EFI: 5.50;
FCode/BIOS Version:  BIOS: 3.24; fcode: 4.06; EFI: 5.50;
FCode/BIOS Version:  BIOS: 3.24; fcode: 4.06; EFI: 5.50;
FCode/BIOS Version:  BIOS: 3.24; fcode: 4.06; EFI: 5.50;
FCode/BIOS Version:  BIOS: 3.24; fcode: 4.06; EFI: 5.50;
FCode/BIOS Version:  BIOS: 3.24; fcode: 4.06; EFI: 5.50;
FCode/BIOS Version:  BIOS: 3.24; fcode: 4.06; EFI: 5.50;
FCode/BIOS Version:  BIOS: 3.24; fcode: 4.06; EFI: 5.50;
FCode/BIOS Version:  BIOS: 3.24; fcode: 4.06; EFI: 5.50;
FCode/BIOS Version:  BIOS: 3.24; fcode: 4.06; EFI: 5.50;
FCode/BIOS Version:  BIOS: 3.24; fcode: 4.06; EFI: 5.50;
FCode/BIOS Version:  BIOS: 3.24; fcode: 4.06; EFI: 5.50;
FCode/BIOS Version:  BIOS: 3.24; fcode: 4.06; EFI: 5.50;
FCode/BIOS Version:  BIOS: 3.24; fcode: 4.06; EFI: 5.50;






Download required patch from

Create new directory and move the file and unzip it.

root@eecsaruh6hoc007 # unzip Oracle_QLE8362_SRIOV_Flash_Kit_07.zip
Archive:  Oracle_QLE8362_SRIOV_Flash_Kit_07.zip
  inflating: agent.properties
  inflating: ChangeHistory.txt
  inflating: DOS4GW.EXE
  inflating: EPC83xx.DAT
  inflating: FBC83xx.DAT
  inflating: FCAFC02.dat
  inflating: FD83xx.dat
  inflating: FJT83xx.DAT
  inflating: FLT83xx.DAT
  inflating: FWA83xxB.DAT
  inflating: hld36025.bin
  inflating: IP83xx.DAT
  inflating: minidump.bin
  inflating: OL862AC.DAT
  inflating: OL862BCb.dat
  inflating: OL862CNA.VPD
  inflating: OL862DC.DAT
  inflating: OL862FC.VPD
  inflating: OL862FCN.DAT
  inflating: OL862FEN.DAT
  inflating: qmfgoem.exe
  inflating: QMFGoem.txt
  inflating: Read1st.txt
  inflating: resetseq.bin
  inflating: UI83xx.DAT
  inflating: UPDATE.BAT
  inflating: update_lnx.sh
  inflating: update_sol.sh
  inflating: update_win.bat
  inflating: UPGRADE.BAT
 

Change permission of installer and run by mentioning the current directory as Flashkit path.
 
root@eecsaruh6hoc007 # chmod a+x update_sol.sh
root@eecsaruh6hoc007 # ./update_sol.sh  .
Flashing Board Config Data...
Installation directory: /usr/lib/ssm/fwupdate/qlogic
Working dir: /tmp/hba
Updating Board Config parameters of HBA instance 10 - QLE8362...
Success
Updating Board Config parameters of HBA instance 14 - QLE8362...
Success
Updating Board Config parameters of HBA instance 8 - QLE8362...
Success
Updating Board Config parameters of HBA instance 2 - QLE8362...
Success
Updating Board Config parameters of HBA instance 4 - QLE8362...
Success
Updating Board Config parameters of HBA instance 12 - QLE8362...
Success
Updating Board Config parameters of HBA instance 0 - QLE8362...
Success
Updating Board Config parameters of HBA instance 6 - QLE8362...
Success
Flashing FC NVRAM Data....
Installation directory: /usr/lib/ssm/fwupdate/qlogic
Working dir: /tmp/hba
Updating FC NVRAM Data on HBA instance 10 (QLE8362)...
Success
Updating FC NVRAM Data on HBA instance 11 (QLE8362)...
Success
Updating FC NVRAM Data on HBA instance 14 (QLE8362)...
Success
Updating FC NVRAM Data on HBA instance 15 (QLE8362)...
Success
Updating FC NVRAM Data on HBA instance 8 (QLE8362)...
Success
Updating FC NVRAM Data on HBA instance 9 (QLE8362)...
Success
Updating FC NVRAM Data on HBA instance 2 (QLE8362)...
Success
Updating FC NVRAM Data on HBA instance 3 (QLE8362)...
Success
Updating FC NVRAM Data on HBA instance 4 (QLE8362)...
Success
Updating FC NVRAM Data on HBA instance 5 (QLE8362)...
Success
Updating FC NVRAM Data on HBA instance 12 (QLE8362)...
Success
Updating FC NVRAM Data on HBA instance 13 (QLE8362)...
Success
Updating FC NVRAM Data on HBA instance 0 (QLE8362)...
Success
Updating FC NVRAM Data on HBA instance 1 (QLE8362)...
Success
Updating FC NVRAM Data on HBA instance 6 (QLE8362)...
Success
Updating FC NVRAM Data on HBA instance 7 (QLE8362)...
Success
Flashing FCOE NVRAM Data...
Installation directory: /usr/lib/ssm/fwupdate/qlogic
Working dir: /tmp/hba
Updating FCoE NVRAM Data on HBA instance 10 (QLE8362)...
Success
Updating FCoE NVRAM Data on HBA instance 11 (QLE8362)...
Success
Updating FCoE NVRAM Data on HBA instance 14 (QLE8362)...
Success
Updating FCoE NVRAM Data on HBA instance 15 (QLE8362)...
Success
Updating FCoE NVRAM Data on HBA instance 8 (QLE8362)...
Success
Updating FCoE NVRAM Data on HBA instance 9 (QLE8362)...
Success
Updating FCoE NVRAM Data on HBA instance 2 (QLE8362)...
Success
Updating FCoE NVRAM Data on HBA instance 3 (QLE8362)...
Success
Updating FCoE NVRAM Data on HBA instance 4 (QLE8362)...
Success
Updating FCoE NVRAM Data on HBA instance 5 (QLE8362)...
Success
Updating FCoE NVRAM Data on HBA instance 12 (QLE8362)...
Success
Updating FCoE NVRAM Data on HBA instance 13 (QLE8362)...
Success
Updating FCoE NVRAM Data on HBA instance 0 (QLE8362)...
Success
Updating FCoE NVRAM Data on HBA instance 1 (QLE8362)...
Success
Updating FCoE NVRAM Data on HBA instance 6 (QLE8362)...
Success
Updating FCoE NVRAM Data on HBA instance 7 (QLE8362)...
Success
Flashing FW Preload Table...
Installation directory: /usr/lib/ssm/fwupdate/qlogic
Working dir: /tmp/hba
Updating firmware preload table of HBA instance 10 - QLE8362...
Successful, please reboot for the change to take effect.
Updating firmware preload table of HBA instance 14 - QLE8362...
Successful, please reboot for the change to take effect.
Updating firmware preload table of HBA instance 8 - QLE8362...
Successful, please reboot for the change to take effect.
Updating firmware preload table of HBA instance 2 - QLE8362...
Successful, please reboot for the change to take effect.
Updating firmware preload table of HBA instance 4 - QLE8362...
Successful, please reboot for the change to take effect.
Updating firmware preload table of HBA instance 12 - QLE8362...
Successful, please reboot for the change to take effect.
Updating firmware preload table of HBA instance 0 - QLE8362...
Successful, please reboot for the change to take effect.
Updating firmware preload table of HBA instance 6 - QLE8362...
Successful, please reboot for the change to take effect.
Flashing FW Jump Table...
Installation directory: /usr/lib/ssm/fwupdate/qlogic
Working dir: /tmp/hba
Updating FC Preload Table Jump Area of HBA instance 10 - QLE8362...
Success
Updating FC Preload Table Jump Area of HBA instance 14 - QLE8362...
Success
Updating FC Preload Table Jump Area of HBA instance 8 - QLE8362...
Success
Updating FC Preload Table Jump Area of HBA instance 2 - QLE8362...
Success
Updating FC Preload Table Jump Area of HBA instance 4 - QLE8362...
Success
Updating FC Preload Table Jump Area of HBA instance 12 - QLE8362...
Success
Updating FC Preload Table Jump Area of HBA instance 0 - QLE8362...
Success
Updating FC Preload Table Jump Area of HBA instance 6 - QLE8362...
Success
Flashing Feature Config Data...
Installation directory: /usr/lib/ssm/fwupdate/qlogic
Working dir: /tmp/hba
Updating feature config area of HBA instance 10 - QLE8362...
Success
Updating feature config area of HBA instance 14 - QLE8362...
Success
Updating feature config area of HBA instance 8 - QLE8362...
Success
Updating feature config area of HBA instance 2 - QLE8362...
Success
Updating feature config area of HBA instance 4 - QLE8362...
Success
Updating feature config area of HBA instance 12 - QLE8362...
Success
Updating feature config area of HBA instance 0 - QLE8362...
Success
Updating feature config area of HBA instance 6 - QLE8362...
Success
Flashing FC Board Config Data...
Installation directory: /usr/lib/ssm/fwupdate/qlogic
Working dir: /tmp/hba
Updating FC board config of HBA instance 10 (QLE8362 )...
Success
Updating FC board config of HBA instance 14 (QLE8362 )...
Success
Updating FC board config of HBA instance 8 (QLE8362 )...
Success
Updating FC board config of HBA instance 2 (QLE8362 )...
Success
Updating FC board config of HBA instance 4 (QLE8362 )...
Success
Updating FC board config of HBA instance 12 (QLE8362 )...
Success
Updating FC board config of HBA instance 0 (QLE8362 )...
Success
Updating FC board config of HBA instance 6 (QLE8362 )...
Success
Flashing Flash Layout Table...
Installation directory: /usr/lib/ssm/fwupdate/qlogic
Working dir: /tmp/hba
Updating flash layout table of HBA instance 10 (QLE8362)...
Success
Updating flash layout table of HBA instance 14 (QLE8362)...
Success
Updating flash layout table of HBA instance 8 (QLE8362)...
Success
Updating flash layout table of HBA instance 2 (QLE8362)...
Success
Updating flash layout table of HBA instance 4 (QLE8362)...
Success
Updating flash layout table of HBA instance 12 (QLE8362)...
Success
Updating flash layout table of HBA instance 0 (QLE8362)...
Success
Updating flash layout table of HBA instance 6 (QLE8362)...
Success
Flashing Eport Parameters...
Installation directory: /usr/lib/ssm/fwupdate/qlogic
Working dir: /tmp/hba
Updating Eport Parameters of HBA instance 10 - QLE8362 ...
Success
Updating Eport Parameters of HBA instance 14 - QLE8362 ...
Success
Updating Eport Parameters of HBA instance 8 - QLE8362 ...
Success
Updating Eport Parameters of HBA instance 2 - QLE8362 ...
Success
Updating Eport Parameters of HBA instance 4 - QLE8362 ...
Success
Updating Eport Parameters of HBA instance 12 - QLE8362 ...
Success
Updating Eport Parameters of HBA instance 0 - QLE8362 ...
Success
Updating Eport Parameters of HBA instance 6 - QLE8362 ...
Success
Flashing Default Configuration ...
Installation directory: /usr/lib/ssm/fwupdate/qlogic
Working dir: /tmp/hba
Updating default config of HBA instance 10 - QLE8362...
Success
Updating default config of HBA instance 14 - QLE8362...
Success
Updating default config of HBA instance 8 - QLE8362...
Success
Updating default config of HBA instance 2 - QLE8362...
Success
Updating default config of HBA instance 4 - QLE8362...
Success
Updating default config of HBA instance 12 - QLE8362...
Success
Updating default config of HBA instance 0 - QLE8362...
Success
Updating default config of HBA instance 6 - QLE8362...
Success
Flashing Active Configuration ...
Installation directory: /usr/lib/ssm/fwupdate/qlogic
Working dir: /tmp/hba
Updating active config of HBA instance 10 - QLE8362...
Success
Updating active config of HBA instance 14 - QLE8362...
Success
Updating active config of HBA instance 8 - QLE8362...
Success
Updating active config of HBA instance 2 - QLE8362...
Success
Updating active config of HBA instance 4 - QLE8362...
Success
Updating active config of HBA instance 12 - QLE8362...
Success
Updating active config of HBA instance 0 - QLE8362...
Success
Updating active config of HBA instance 6 - QLE8362...
Success
Flashing Reset Sequence...
Installation directory: /usr/lib/ssm/fwupdate/qlogic
Working dir: /tmp/hba
Updating reset sequence of HBA instance 10 (QLE8362 )...
Success
Updating reset sequence of HBA instance 14 (QLE8362 )...
Success
Updating reset sequence of HBA instance 8 (QLE8362 )...
Success
Updating reset sequence of HBA instance 2 (QLE8362 )...
Success
Updating reset sequence of HBA instance 4 (QLE8362 )...
Success
Updating reset sequence of HBA instance 12 (QLE8362 )...
Success
Updating reset sequence of HBA instance 0 (QLE8362 )...
Success
Updating reset sequence of HBA instance 6 (QLE8362 )...
Success
Flashing User Info...
Installation directory: /usr/lib/ssm/fwupdate/qlogic
Working dir: /tmp/hba
Updating User Info region of HBA instance 10 - QLE8362...
Success
Updating User Info region of HBA instance 14 - QLE8362...
Success
Updating User Info region of HBA instance 8 - QLE8362...
Success
Updating User Info region of HBA instance 2 - QLE8362...
Success
Updating User Info region of HBA instance 4 - QLE8362...
Success
Updating User Info region of HBA instance 12 - QLE8362...
Success
Updating User Info region of HBA instance 0 - QLE8362...
Success
Updating User Info region of HBA instance 6 - QLE8362...
Success
Flashing Mini Dump Template...
Installation directory: /usr/lib/ssm/fwupdate/qlogic
Working dir: /tmp/hba
Updating mini-dump templates of HBA instance 10 (QLE8362 )...
Success
Updating mini-dump templates of HBA instance 14 (QLE8362 )...
Success
Updating mini-dump templates of HBA instance 8 (QLE8362 )...
Success
Updating mini-dump templates of HBA instance 2 (QLE8362 )...
Success
Updating mini-dump templates of HBA instance 4 (QLE8362 )...
Success
Updating mini-dump templates of HBA instance 12 (QLE8362 )...
Success
Updating mini-dump templates of HBA instance 0 (QLE8362 )...
Success
Updating mini-dump templates of HBA instance 6 (QLE8362 )...
Success
Flashing Flash image ./hld36025.bin...
Installation directory: /usr/lib/ssm/fwupdate/qlogic
Working dir: /tmp/hba
Validating Flash Image File... Success
Updating Flash on HBA port(s) - QLE8362. Please wait...
Updating Adapter FC Boot Code... Success
Updating Adapter NIC Boot Code... Success
Updating Adapter FCoE Boot Code... Success
Updating Adapter CRBInit... Success
Updating Adapter BootLoader... Success
Updating Adapter PEGTune ... Success
Updating Adapter FCoE FW... Success
Updating Adapter FC FW... Success
Updating Adapter NIC/CNA FW... Success
Updating Adapter NIC/CNA VPD... Success
Updating Adapter FC VPD... Success
Updating Adapter FC VPD... Success
Flash update complete. Changes have been saved to all ports of this HBA.
You must reboot in order for the changes to become effective.
Validating Flash Image File... Success
Updating Flash on HBA port(s) - QLE8362. Please wait...
Updating Adapter FC Boot Code... Success
Updating Adapter NIC Boot Code... Success
Updating Adapter FCoE Boot Code... Success
Updating Adapter CRBInit... Success
Updating Adapter BootLoader... Success
Updating Adapter PEGTune ... Success
Updating Adapter FCoE FW... Success
Updating Adapter FC FW... Success
Updating Adapter NIC/CNA FW... Success
Updating Adapter NIC/CNA VPD... Success
Updating Adapter FC VPD... Success
Updating Adapter FC VPD... Success
Flash update complete. Changes have been saved to all ports of this HBA.
You must reboot in order for the changes to become effective.
Validating Flash Image File... Success
Updating Flash on HBA port(s) - QLE8362. Please wait...
Updating Adapter FC Boot Code... Success
Updating Adapter NIC Boot Code... Success
Updating Adapter FCoE Boot Code... Success
Updating Adapter CRBInit... Success
Updating Adapter BootLoader... Success
Updating Adapter PEGTune ... Success
Updating Adapter FCoE FW... Success
Updating Adapter FC FW... Success
Updating Adapter NIC/CNA FW... Success
Updating Adapter NIC/CNA VPD... Success
Updating Adapter FC VPD... Success
Updating Adapter FC VPD... Success
Flash update complete. Changes have been saved to all ports of this HBA.
You must reboot in order for the changes to become effective.
Validating Flash Image File... Success
Updating Flash on HBA port(s) - QLE8362. Please wait...
Updating Adapter FC Boot Code... Success
Updating Adapter NIC Boot Code... Success
Updating Adapter FCoE Boot Code... Success
Updating Adapter CRBInit... Success
Updating Adapter BootLoader... Success
Updating Adapter PEGTune ... Success
Updating Adapter FCoE FW... Success
Updating Adapter FC FW... Success
Updating Adapter NIC/CNA FW... Success
Updating Adapter NIC/CNA VPD... Success
Updating Adapter FC VPD... Success
Updating Adapter FC VPD... Success
Flash update complete. Changes have been saved to all ports of this HBA.
You must reboot in order for the changes to become effective.
Validating Flash Image File... Success
Updating Flash on HBA port(s) - QLE8362. Please wait...
Updating Adapter FC Boot Code... Success
Updating Adapter NIC Boot Code... Success
Updating Adapter FCoE Boot Code... Success
Updating Adapter CRBInit... Success
Updating Adapter BootLoader... Success
Updating Adapter PEGTune ... Success
Updating Adapter FCoE FW... Success
Updating Adapter FC FW... Success
Updating Adapter NIC/CNA FW... Success
Updating Adapter NIC/CNA VPD... Success
Updating Adapter FC VPD... Success
Updating Adapter FC VPD... Success
Flash update complete. Changes have been saved to all ports of this HBA.
You must reboot in order for the changes to become effective.
Validating Flash Image File... Success
Updating Flash on HBA port(s) - QLE8362. Please wait...
Updating Adapter FC Boot Code... Success
Updating Adapter NIC Boot Code... Success
Updating Adapter FCoE Boot Code... Success
Updating Adapter CRBInit... Success
Updating Adapter BootLoader... Success
Updating Adapter PEGTune ... Success
Updating Adapter FCoE FW... Success
Updating Adapter FC FW... Success
Updating Adapter NIC/CNA FW... Success
Updating Adapter NIC/CNA VPD... Success
Updating Adapter FC VPD... Success
Updating Adapter FC VPD... Success
Flash update complete. Changes have been saved to all ports of this HBA.
You must reboot in order for the changes to become effective.
Validating Flash Image File... Success
Updating Flash on HBA port(s) - QLE8362. Please wait...
Updating Adapter FC Boot Code... Success
Updating Adapter NIC Boot Code... Success
Updating Adapter FCoE Boot Code... Success
Updating Adapter CRBInit... Success
Updating Adapter BootLoader... Success
Updating Adapter PEGTune ... Success
Updating Adapter FCoE FW... Success
Updating Adapter FC FW... Success
Updating Adapter NIC/CNA FW... Success
Updating Adapter NIC/CNA VPD... Success
Updating Adapter FC VPD... Success
Updating Adapter FC VPD... Success
Flash update complete. Changes have been saved to all ports of this HBA.
You must reboot in order for the changes to become effective.
Validating Flash Image File... Success
Updating Flash on HBA port(s) - QLE8362. Please wait...
Updating Adapter FC Boot Code... Success
Updating Adapter NIC Boot Code... Success
Updating Adapter FCoE Boot Code... Success
Updating Adapter CRBInit... Success
Updating Adapter BootLoader... Success
Updating Adapter PEGTune ... Success
Updating Adapter FCoE FW... Success
Updating Adapter FC FW... Success
Updating Adapter NIC/CNA FW... Success
Updating Adapter NIC/CNA VPD... Success
Updating Adapter FC VPD... Success
Updating Adapter FC VPD... Success
Flash update complete. Changes have been saved to all ports of this HBA.
You must reboot in order for the changes to become effective.


Reboot the host and check the version after reboot.


root@eecsaruh6hoc007 # fcinfo hba-port|grep FCode
FCode/BIOS Version:  BIOS: 3.40; fcode: 4.10; EFI: 6.19;
FCode/BIOS Version:  BIOS: 3.40; fcode: 4.10; EFI: 6.19;
FCode/BIOS Version:  BIOS: 3.40; fcode: 4.10; EFI: 6.19;
FCode/BIOS Version:  BIOS: 3.40; fcode: 4.10; EFI: 6.19;
FCode/BIOS Version:  BIOS: 3.40; fcode: 4.10; EFI: 6.19;
FCode/BIOS Version:  BIOS: 3.40; fcode: 4.10; EFI: 6.19;
FCode/BIOS Version:  BIOS: 3.40; fcode: 4.10; EFI: 6.19;
FCode/BIOS Version:  BIOS: 3.40; fcode: 4.10; EFI: 6.19;
FCode/BIOS Version:  BIOS: 3.40; fcode: 4.10; EFI: 6.19;
FCode/BIOS Version:  BIOS: 3.40; fcode: 4.10; EFI: 6.19;
FCode/BIOS Version:  BIOS: 3.40; fcode: 4.10; EFI: 6.19;
FCode/BIOS Version:  BIOS: 3.40; fcode: 4.10; EFI: 6.19;
FCode/BIOS Version:  BIOS: 3.40; fcode: 4.10; EFI: 6.19;
FCode/BIOS Version:  BIOS: 3.40; fcode: 4.10; EFI: 6.19;
FCode/BIOS Version:  BIOS: 3.40; fcode: 4.10; EFI: 6.19;
FCode/BIOS Version:  BIOS: 3.40; fcode: 4.10; EFI: 6.19;

Accessing Oracle M6 Console

First list out the number of Hosts.


-> show HOST

 /HOST0
    Targets:
        VPS
        VPS_CPUS
        VPS_FANS
        VPS_MEMORY
        bootmode
        console
        diag
        domain
        status_history
        tpm
        verified_boot

    Properties:
        autorestart = reset
        autorunonerror = powercycle
        bootfailrecovery = poweroff
        bootrestart = none
        boottimeout = 0
        dcus_assignable =  /SYS/DCU0 /SYS/DCU1 /SYS/DCU2 /SYS/DCU3
        dcus_assigned =  /SYS/DCU0 /SYS/DCU1 /SYS/DCU2 /SYS/DCU3
        dcus_available = (none)
        expandable = true
        gm_version = GM 1.6.6 2016/08/17 13:44
        hostconfig_version = Hostconfig 1.6.6 2016/08/17 13:23
        hypervisor_version = Hypervisor 1.15.6 2016/08/17 13:02
        ioreconfigure = false
        keyswitch_state = Normal
        macaddress = 00:10:e0:25:76:e0
        maxbootfail = 3
        obp_version = OpenBoot 4.38.6 2016/08/17 12:41
        operation_in_progress = none
        post_version = POST 5.3.6 2016/08/17 13:04
        power_state = On
        send_break_action = (Cannot show property)
        sp_name = /SYS/SPP1
        state_capture_mode = default
        state_capture_on_error = enabled
        state_capture_status = enabled
        status = Solaris running
        status_detail = 20170321 07:37:34: Start Host completed successfully
        sysfw_version = Sun System Firmware 9.6.6.a 2016/09/09 19:36

    Commands:
        cd
        reset
        set
        show
        start
        stop



To connect a spesific host, say, HOST0, use below command.

-> start /HOST0/console
Are you sure you want to start /HOST0/console (y/n)? y

Serial console started.  To stop, type #.
Password:
Jun  6 15:50:19 eecsaruh2hoc007 login: Login failure on /dev/console
Login incorrect
eecsaruh2hoc007 console login:
eecsaruh2hoc007 console login:

Solaris 11 rpool/dump resize (filesystem full)

zfs set refreservation=40G rpool/dump
zfs set quota=40G rpool/dump
zfs set volsize=40G rpool/dump

Solaris 11 DNS Cient and nsswitch.conf configuration.

In solaris 11, its not recomented to edit resolv.conf file directory. Below is the proceedure to configure it.

Ensure, DNS client service is online.

root@eecsaruh2hoc007 # svcs -a | grep dns
disabled       Jun_25   svc:/network/dns/multicast:default
disabled       Jun_25   svc:/network/dns/server:default
online         Jun_25   svc:/network/dns/client:default

Configure DNS client configuration with required values

root@eecsaruh2hoc007 # svccfg -s dns/client
svc:/network/dns/client> setprop config/nameserver = (10.14.10.13 10.14.10.14 10.64.10.13)
svc:/network/dns/client> setprop config/domain = prod.example.lan
svc:/network/dns/client> setprop config/search = prod.example.lan
svc:/network/dns/client> exit

Restart the service

root@eecsaruh2hoc007 # svcadm refresh dns/client # svcadm restart dns/client

Verify the change:

root@eecsaruh2hoc007 # cat /etc/resolv.conf

#
# _AUTOGENERATED_FROM_SMF_V1_
#
# WARNING: THIS FILE GENERATED FROM SMF DATA.
#   DO NOT EDIT THIS FILE.  EDITS WILL BE LOST.
# See resolv.conf(4) for details.

domain  prod.example.lan
search  prod.example.lan
nameserver      10.14.10.13
nameserver      10.14.10.14
nameserver      10.64.10.13




Setting up nsswitch conf
Ensure, name-service service is online
Change the properties based on your requirements



root@eecsaruh2hoc007 #  svccfg -s name-service/switch
svc:/system/name-service/switch> setprop config/host = "files dns"
svc:/system/name-service/switch> setprop config/ipnode = astring: "files dns"
svc:/system/name-service/switch> refresh
svc:/system/name-service/switch> exit

Restart name-service service

root@eecsaruh2hoc007 # svcadm refresh name-service/switch
root@eecsaruh2hoc007 # svcadm restart  name-service/switch


Verify the change:

root@eecsaruh2hoc007 # grep dns /etc/nsswitch.conf
hosts:  files dns
ipnodes:        files dns

Friday, 22 January 2016

Godaddy Dynamic DNS configuration.

I found some of very good article in internet for configuring dynamic IP configuration with Godaddy.

Below is the steps I used to achieve the same.

1- Install required python modules.

  #yum install install python python-pip
  #pip install pif
  #pip install pygodaddy
  #pip install pyopenssl ndg-httpsclient pyasn1


2. replace client.py and __init__.py  with below files as the authentication changes in godaddy has been fixed in new files.

 Replace /usr/lib/python2.7/site-packages/pygodaddy/  with https://github.com/BryceGough/pygodaddy/blob/master/pygodaddy/client.py
Replace /usr/lib/python2.7/site-packages/pygodaddy/__init__.py with https://raw.githubusercontent.com/BryceGough/pygodaddy/master/pygodaddy/__init__.py


3. Download below Symple python script to update a host A record in a GoDaddy hosted DNS zone

#wget https://github.com/johanreinalda/godaddy_dynamic_dns/archive/master.zip
#unzip master.zip
#cd godaddy_dynamic_dns-master
Create below files to store current IP and logs.

#touch  current_ip 
#touch  godaddy.log

4. Edit configuration files update.py

GODADDY_USERNAME="username"
GODADDY_PASSWORD="Password"
LOGFILE='godaddy.log'
IPFILE='current_ip'

Replace below line with your hostname in godaddy. (here i put blog). on line number 53.

 if dns_record.hostname == 'blog': 

5. now you can run the update.py like below.

# python update.py
ip is the same.. not doing anything






Ref:https://github.com/BryceGough/pygodaddy
Ref: https://github.com/johanreinalda/godaddy_dynamic_dns

Tuesday, 17 February 2015

Solaris User password reset non-interactive script.

This script can be used for changing the password of Solaris system trough non-interactive script.

This can be run like


#/var/tmp/changepass.sh username password

Same script can be downloaded here


#!/usr/bin/bash
#owner:platheef@gmail.com
#Purpose:changing Oracle Solaris password using script. 
TS=`date +"%h-%d-%H-%M-%S-%Y"`
SHADOW=/etc/shadow
x=""
passtxt=$2;
user=$1;
if [ "$x$passtxt" == "$x" ]; then
        echo "Empty password provided, Existing"
        exit 8
fi
if [ "$x$user" == "$x" ]; then
        echo "Empty user provided, Existing"
        exit 7
fi
id $user >/dev/null
if [ $? -gt 0 ]; then
        echo "Wrong user name, User does not exists"
        exit 6
fi
export user=$user
echo $passtxt |perl -nle 'print crypt($_, "\$1\$".join "", (".", "/", 0..9, "A".."Z", "a".."z")[rand 64, rand 64, rand 64, rand 64, rand 64, rand 64, rand 64, rand 64]);' >/tmp/pass-$user
pass=`cat /tmp/pass-$user`
#echo $pass
if [ "$x$pass" == "$x" ]; then
        echo "Empty password hash, Existing"
        exit 5
fi
export pass=$pass
export today=`perl -e '$days=int((time()/86400)); print "$days"'`
perl -p -e 's#^$ENV{user}:.*?.:.*?:#$ENV{user}:$ENV{pass}:$ENV{today}:#' $SHADOW >/tmp/shadow.$TS
Diff=`diff $SHADOW /tmp/shadow.$TS |grep -v ^[0-9]|wc -l`
if [ $Diff -gt 3 ]; then
        echo "Something wrong, trying to change more than 1 line of shadow  Exiting"
        exit 9
fi
#grep $user $SHADOW
perl -p -i.$TS -e 's#^$ENV{user}:.*?.:.*?:#$ENV{user}:$ENV{pass}:$ENV{today}:#' $SHADOW
passwd -u $user >/dev/null
Diff=`diff $SHADOW $SHADOW.$TS |grep -v ^[0-9]|wc -l`
if [ $Diff -eq 3 ]; then
        echo "Success....."
        exit 0
else
        echo "Error: Something wrong. Rolling back"
        cp $SHADOW.$TS $SHADOW
        exit 4
fi

Friday, 5 December 2014

Custom Logrotate in Solaris 10

Here I explain how to configure logadm to rotage any system wide files according to given criteria.
1. Add the corresponding entries in /etc/logadm.conf in below format.
root@server1 # tail -3 /etc/logadm.conf
/var/adm/wtmpx -A 1m -o adm -g adm -m 664 -p 1d -t '$file.old.%Y%m%d_%H%M' -z 1
/var/adm/wtmpx -A 1m -g adm -m 664 -o adm -p 1w -t '$file.old.%Y%m%d_%H%M' -z 5
/var/adm/utmpx -A 1m -g adm -m 664 -o adm -p 1w -t '$file.old.%Y%m%d_%H%M' -z 5
/var/adm/loginlog -A 1m -g sys -m 700 -o root -p 1w -t '$file.old.%Y%m%d_%H%M' -z 5
Explanation for each switch:
-A ->Delete any versions that have not been modified for the amount of time specified by age. Specify age as a number followed by an h (hours), d (days), w(weeks), m (months), or y (years).
-o -> the owner of the newly creating empty file
-g-> the group of newly creating file
-m ->mode of the new empty file (chmod xxx)
-p -> Rotate a log file after the specified time period (period as d, w,  m, y)
-t -> Specify the template to use when renaming log files (Here, wtmpx.old.20101225_0757) (see man logadm for more info)
-z  ->How many copy of rotaged files needs to retain on the system.
-P ->Used by logadm to record the last time the log was rotated in /etc/logadm.conf (no need to set this manually)
2. Once above entries are done, execute logadm -v command to run a logrotation now. Now logadm reads the /etc/logadm.conf file, and for every entry found in that file checks the corresponding log file to see if it should be rotated.
root@server1 # logadm  -v
# loading /etc/logadm.conf
# processing logname: /var/log/syslog
#     using default rotate rules: -s1b -p1w
#     using default template: $file.$n
# processing logname: /var/adm/messages
#     using default rotate rules: -s1b -p1w
#     using default template: $file.$n
# processing logname: /var/cron/log
#     using default expire rule: -C10
# processing logname: /var/lp/logs/lpsched
#     using default rotate rules: -s1b -p1w
# processing logname: /var/fm/fmd/errlog
#     using default expire rule: -C10
#     using default template: $file.$n
# processing logname: /var/fm/fmd/fltlog
#     using default template: $file.$n
# processing logname: smf_logs
#     using default template: $file.$n
# processing logname: /var/adm/pacct
#     using default template: $file.$n
# processing logname: /var/log/pool/poold
#     using default expire rule: -C10
#     using default template: $file.$n
# processing logname: /var/svc/log/system-webconsole:console.log
#     using default rotate rules: -s1b -p1w
#     using default expire rule: -C10
#     using default template: $file.$n
# processing logname: /var/opt/SUNWsasm/log/sasm.log
#     using default template: $file.$n
# processing logname: /var/adm/wtmpx
mkdir -p /var/adm # verify directory exists
mv -f /var/adm/wtmpx /var/adm/wtmpx.old.20101225_1250 # rotate log file
touch /var/adm/wtmpx
chown adm:adm /var/adm/wtmpx
chmod 664 /var/adm/wtmpx
#     recording rotation date Sat Dec 25 12:50:51 2010 for /var/adm/wtmpx
# processing logname: /var/adm/utmpx
mkdir -p /var/adm # verify directory exists
mv -f /var/adm/utmpx /var/adm/utmpx.old.20101225_1250 # rotate log file
touch /var/adm/utmpx
chown adm:adm /var/adm/utmpx
chmod 664 /var/adm/utmpx
#     recording rotation date Sat Dec 25 12:50:51 2010 for /var/adm/utmpx
# processing logname: /var/adm/loginlog
mkdir -p /var/adm # verify directory exists
mv -f /var/adm/loginlog /var/adm/loginlog.old.20101225_1250 # rotate log file
touch /var/adm/loginlog
chown root:sys /var/adm/loginlog
chmod 700 /var/adm/loginlog
#     recording rotation date Sat Dec 25 12:50:51 2010 for /var/adm/loginlog
# writing changes to /etc/logadm.conf
As you can see the last line of above command, once the logadm command successfully run, it do some changes to with -P switch in /etc/logadm.conf file regarding the last update of logrotation.
root@server1 # tail -3 /etc/logadm.conf
/var/adm/wtmpx -A 1m -P 'Sat Dec 25 12:50:51 2010' -g adm -m 664 -o adm -p 1w -t '$file.old.%Y%m%d_%H%M' -z 5
/var/adm/utmpx -A 1m -P 'Sat Dec 25 12:50:51 2010' -g adm -m 664 -o adm -p 1w -t '$file.old.%Y%m%d_%H%M' -z 5
/var/adm/loginlog -A 1m -P 'Sat Dec 25 12:50:51 2010' -g sys -m 700 -o root -p 1w -t '$file.old.%Y%m%d_%H%M' -z 5
List of new files created in /var/adm
root@server1 # ls -ltr /var/adm/*.old*
-rwx------   1 root     sys            0 Dec 25 11:00 /var/adm/loginlog.old.20101225_1250
-rw-r--r--   1 root     bin         3720 Dec 25 15:49 /var/adm/utmpx.old.20101225_1250
-rw-rw-r--   1 adm      adm      8595060 Dec 25 15:51 /var/adm/wtmpx.old.20101225_1250

Monday, 23 June 2014

Cakephp: Verifying the post data Failure.


When you save your data to DB using Model, some time if fails without any message, you can use codes to check what is happening. If the save fails, you will get print of data, validation error if any, and SQL statement executed.

$data=$this->data;
 if ($this->Client->save($data)) {
     $this->Session->setFlash("Client Added");
     $this->redirect('/clients/listclient/0');
     }else{
          //to print the data itselft
          debug($data);
          //to print the Validation Errors
          debug($this->validationErrors);
          //to print the SQL statements
          debug($this->Client->getDataSource()->getLog(false, false));
          //to print the invlide fields
          debug($this->Client->invalidFields());
     }

Friday, 17 May 2013

VCS - Link Based IPMP Configuration


Interface configuration files.


root@node055 # cat /etc/hostname.nxge3
node055 netmask + broadcast + group production up

root@node055 # cat /etc/hostname.nxge9
group production standby up



VCS Configuration File Entry (main.cf)



group Multinic (
        SystemList = { node055 = 0, node056 = 1, node057 = 2, node058 = 3,
                 node059 = 4 }
        Parallel = 1
        AutoStartList = { node055, node056, node057, node058, node059 }
        )

        MultiNICB MNICB-Res (
                Critical = 0
                Device = { nxge3 = "", nxge9 = "" }
                UseMpathd = 1
                GroupName = production
                ConfigCheck = 0
                )

        Phantom Phantom (
                Critical = 0
                )

Thursday, 16 May 2013

Linux IP Multipath configuration (bonding)


Check all your network interfaces using ethtool command

[root@MyLinux ~]# ethtool eth0
Settings for eth0:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised auto-negotiation: Yes
        Speed: 1000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: g
        Wake-on: g
        Link detected: yes
[root@MyLinux ~]# ethtool eth1
Settings for eth1:
        Supported ports: [ TP ]
        Supported link modes:   10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Supports auto-negotiation: Yes
        Advertised link modes:  10baseT/Half 10baseT/Full
                                100baseT/Half 100baseT/Full
                                1000baseT/Full
        Advertised auto-negotiation: Yes
        Speed: 1000Mb/s
        Duplex: Full
        Port: Twisted Pair
        PHYAD: 1
        Transceiver: internal
        Auto-negotiation: on
        Supports Wake-on: g
        Wake-on: g
        Link detected: yes

Check all the requiured kernel modules are available(bonding and mii)
[root@MyLinux ~]# modprobe -l | grep bonding
/lib/modules/2.6.18-308.el5/kernel/drivers/net/bonding/bonding.ko

[root@MyLinux ~]# modprobe -l | grep mii
/lib/modules/2.6.18-308.el5/kernel/drivers/net/mii.ko

Editing the modprobe.conf file. Append below line in modprobe.conf
[root@MyLinux etc]# cat modprobe.conf
alias bond0 bonding
options bond0 mode=1 miimon=100

Where

mode=0 (balance-rr)
Round-robin policy: Transmit packets in sequential order from the first available slave through the last. This mode provides load balancing and fault tolerance.

mode=1 (active-backup)
Active-backup policy: Only one slave in the bond is active. A different slave becomes active if, and only if, the active slave fails. The bond's MAC address is externally visible on only one port (network adapter) to avoid confusing the switch. This mode provides fault tolerance. The primary option affects the behavior of this mode.

mode=2 (balance-xor)
XOR policy: Transmit based on [(source MAC address XOR'd with destination MAC address) modulo slave count]. This selects the same slave for each destination MAC address. This mode provides load balancing and fault tolerance.

mode=3 (broadcast)
Broadcast policy: transmits everything on all slave interfaces. This mode provides fault tolerance.

mode=4 (802.3ad)
IEEE 802.3ad Dynamic link aggregation. Creates aggregation groups that share the same speed and duplex settings. Utilizes all slaves in the active aggregator according to the 802.3ad specification.


Load both kernel modules and confirm the file edit by below commands

[root@MyLinux etc]# modprobe bonding
[root@MyLinux etc]# modprobe mii


Create a new network configuration file for bond0 and edit eth0 and eth1 accordingly under /etc/sysconfig/network-scripts/ directory

ifcfg-bond0

[root@MyLinux network-scripts]# cat ifcfg-bond0
DEVICE=bond0
BOOTPROTO=none
ONBOOT=yes
NETMASK=255.255.254.0
IPADDR=192.168.10.139
USERCTL=no
GATEWAY=192.168.10.1
TYPE=Ethernet
IPV6INIT=no
PEERDNS=yes
[root@MyLinux network-scripts]#

ifcfg-eth0

[root@MyLinux network-scripts]# cat ifcfg-eth0
# Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
DEVICE=eth0
BOOTPROTO=none
#HWADDR=e4:1f:13:1e:c4:00
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
TYPE=Ethernet

ifcfg-eth1

[root@MyLinux network-scripts]# cat ifcfg-eth1
# Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no
TYPE=Ethernet

Restart network services now.
[root@MyLinux etc]# cd /etc/sysconfig/network-scripts/
[root@MyLinux network-scripts]# /etc/init.d/network restart
Shutting down interface eth0:                              [  OK  ]
Shutting down interface eth1:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface bond0:                               [  OK  ]

Check the bond status using below commands

[root@MyLinux ~]#  cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.4.0-1 (October 7, 2008)

Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 100
Up Delay (ms): 0
Down Delay (ms): 0

Slave Interface: eth0
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: e4:1f:13:1e:c4:00

Slave Interface: eth1
MII Status: up
Speed: 1000 Mbps
Duplex: full
Link Failure Count: 0
Permanent HW addr: e4:1f:13:1e:c4:02


[root@MyLinux ~]# ifconfig -a
bond0     Link encap:Ethernet  HWaddr E4:1F:13:1E:C4:00
          inet addr:192.168.10.139  Bcast:10.64.209.255  Mask:255.255.254.0
          inet6 addr: fe80::e61f:13ff:fe1e:c400/64 Scope:Link
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:2420 errors:0 dropped:0 overruns:0 frame:0
          TX packets:530 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:210110 (205.1 KiB)  TX bytes:351640 (343.3 KiB)

eth0      Link encap:Ethernet  HWaddr E4:1F:13:1E:C4:00
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:545 errors:0 dropped:0 overruns:0 frame:0
          TX packets:530 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:53341 (52.0 KiB)  TX bytes:351640 (343.3 KiB)
          Interrupt:98 Memory:f2000000-f2012800

eth1      Link encap:Ethernet  HWaddr E4:1F:13:1E:C4:00
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:1875 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:156769 (153.0 KiB)  TX bytes:0 (0.0 b)
          Interrupt:193 Memory:f4000000-f4012800