[Linux] RHEL / CentOS 6.x use Bonding(Teaming) NICs

step01. bonding module is not loaded by default
# modprobe –first-time bonding

step02. check
# lsmod | grep -i bond
# modinfo bonding

step03. Check the available interfaces on the server
# ip addrifconfig -a (e.g. I want to use eth0 & eth1)

step04. Shutdown interface
# ifdown eth0 && ifdown && eth1

step05. Configure a channel bonding interface
** eth0 **
vi /etc/sysconfig/network-scripts/ifcfg-eth0
——————————————————————
NAME=bond0-slave0
DEVICE=eth0
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
NM_CONTROLLED=no
——————————————————————

** eth1 **
vi /etc/sysconfig/network-scripts/ifcfg-eth1
——————————————————————
NAME=bond0-slave1
DEVICE=eth1
TYPE=Ethernet
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
NM_CONTROLLED=no
——————————————————————

** bond0 **
vi /etc/sysconfig/network-scripts/ifcfg-bond0
——————————————————————
NAME=bond0
DEVICE=bond0
BONDING_MASTER=yes
TYPE=Bond
IPADDR=xx.xx.xx.xx
NETMASK=255.255.255.0
ONBOOT=yes
BOOTPROTO=none
BONDING_OPTS="mode=active-backup miimon=100″
NM_CONTROLLED=no
——————————————————————

step06. create bond.conf
# vi /etc/modprobe.d/bond.conf
——————————————————————
alias bond0 bonding
——————————————————————

step07. Restart Network service
# service network restart

step08. up interface
# ifup eth0 && ifup eth1
# ifup bond0

step09.
# cat /proc/net/bonding/bond0

 

 

 

Reference :

  1. Red Hat Enterprise Linux 6 > Deployment Guide > 11.2.4. Channel Bonding Interfaces

[HDS] Compute Blade 500 ‘LPAR’ install RHEL6.7

*Pre-check*
1.what is ur CB500 blade mode ? e.g. CB 520H B3
2.what is ur wnat to install RHEL version ? e.g. RHEL 6.7 x86_64
3.use Physical or LPAR ?

*Pre-require*
CB500_520Hx3_Driver_Utility_for_RHEL6_v0670-01.iso // 後面 v0{xx}即代表該符合RHEL版本,若是符合RHEL 6.9會顯示 v0690-01.iso
CB500_hfc_drivers_cd_0429.iso ( need extract dd.iso )

*Notes*
1. CB 520X B1/B2 and CB 520H B3 can boot only on EFI.
2. CB 520H B3 @ CB500 chassis 需符合FW
> MM : 至少 A023
> LPAR Manager  至少 02-05

*Tips*
IP address of management module : 192.168.0.1 ; https://192.168.0.1
Factory default account / password : administrator / password
following LPAR configuration is recommended :
|-CPU : 2 or more
|-MEM: 2GB or Large
|-Disk: 40GB or Large capacity
|-NIC: 1 or more

*Installation RHEL 6.7*

step01.
extract CB500_hfc_drivers_cd_0429.iso (Fibre Channel driver) 裡頭 hfc_media\linux\x86_64\rhel6\cd_media放置各版本6.x hfc dd.iso ; 因我目標是RHEL6.7所以拷貝 2.6.32-573.el6裡頭dd.iso匯出
hfc-0429-dd.jpg

step02.
vKVM mount media ‘RHEL6.7 x86_64.iso’

step03.
一開始安裝畫面選擇第二項 “Install system with basic video driver" then press ‘Tab’ key

step04.
add ‘ dd blacklist=isci ‘ ,then press ‘b‘ boot in

step05.
The message, Do you have a driver disk? click  “Yes" ; 此時將原RHEL6.7 ISO unmount ,change 2.6.32-573.el6-dd.iso

step06.
choice media /sr0 , then click ‘OK’

step07.
The message “Do you wish to load any more driver disks ?" > clock “No" ;載入HBA driver後系統會自動umount dd.iso ,所以再手動掛入RHEL 6.7 ISO

step08.
HDD custom use LVM 或 traditional extended partition 都OK

step09.
自訂安裝項目什麼都可以裝,唯獨有二個千萬別裝 (PS: CB 520H B3環境)
~ System Management > System Management > Optional packages >
freeipmi-bmc-watchdog-x.x.x-x.xx.xx
~ Base System > Base > tboot-x.xxx.el6.x86_64.rpm

step10.
Finsih install , reboot

step11.
Boot menu , Press E key ; Delete “intel_iommu=on" and “amd_iommu=on" from the boot option,and press Enter.

step12.
enter OS , config boot menu
> vi /boot/efi/EFI/redhat/grub.conf
" intel_iommu=on" // delete
" amd_iommu=on" // delete
" nmi_watchdog=0 pci=noaer " add
" terminal –timeout=10 serial console " // add
" quiet rhgb " // delete from the kernel line
" nmi_watchdog=0 mce=0 pci=noaer no_timer_check console=ttyS1,115200 " // add the ending of the Kernel line
" vga=792 " // add ,LPAR Manager version 至少 01-60
" kernel /tboot.gz logging=vga,serial,memory " // comment out
Change the first “module" to “kernel" in the line starting with “module /initramfs"
Disable TCP checksum offload function
> ethtool -k eth{x} // 顯示目前網卡各功能狀態
> ethtool -K eth{x} rx off tx off

Do not use NetworkManager service
> service NetworkManager stop
> chkconfig NetworkManager off
> chkconfig | grep NetworkManager // 再次確認

Customizing /etc/sysctl.conf

== Validate the magic SysRq key to collect information when a problem
occurs. Edit or add the following line. ==
kernel.sysrq = 1

== Add a setting to induce kernel panic when NMI occurs, with which you can
quickly detect a failure in hardware and drivers ==
kernel.unknown_nmi_panic = 0
kernel.panic_on_unrecovered_nmi = 1
kernel.panic_on_io_nmi = 1

==  Add or edit the following line to set the console log level to 3. By changing
the level, you can avoid the console overload, which can result in
significant deterioration of applications or in Linux hang-up ==
kernel.printk = 3 4 1 7

Updating Drivers
# modinfo driver name

//etc/inittab /


 

Reference:

1. Red Hat Enterprise Linux Release Dates

2. Hitachi Compute Blade 500 Series OS Installation Guide for Red Hat Enterprise Linux

[Windows] How to Restart / Shutdown machine use CMD prompt

**Restart**
C:\> shutdown.exe /m \\{FQDN或IP} /r /f /t 0 /c “add HOTFIX KBxxxxx"

**Shutdown**
C:\> shutdown.exe /m \\{FQDN或IP} /s /f /t 0 /c “face-out machine

**啟用互動式**
C:\> shutdown.exe /i
shutdown-i.jpg

 

(參數說明)
shutdown /[r|s] /m \\ComputerName /c “Comment" /d [u|p] <xx>:<yy>

Value Description
/r Restarts the remote computer.
/s Shuts down the remote computer.
/m \\ComputerName Specifies the destination computer.
/c “Comment Enables you to comment in detail about the reason for the shutdown. You can use a maximum of 511 characters. Comments must be enclosed in quotation marks.
/d [u|p] xx:yy Lists the reason for the system restart or shutdown, where xx specifies a major reason number from 0 through 255, and yy specifies a minor reason number from 0 through 65,535.
/force Forces the computer to shut down if other users are logged in. If this is not used and other users are logged in to the remote computer, the computer will not shut down or restart.

Important
If you force the computer to shut down or restart, logged in users will not have the opportunity to save their work.
/t xxx Sets the time-out period before the system shuts down or restarts to xxx seconds. The valid range is 0-600, with a default of 30. Using the /t flag implies the /force option.

[Windows] View Who Is Logged On Machine

method#1.
c:\> qwinsta.exe  /server:{FQDN或IP}

(參數)
顯示遠端桌面服務工作階段的資訊。

QUERY SESSION [sessionname | username | sessionid]
[/SERVER:servername] [/MODE] [/FLOW] [/CONNECT] [/COUNTER] [/VM]

sessionname 識別名稱為 sessionname 的工作階段。
username 以使用者 username 來識別工作階段。
sessionid 以識別碼 sessionid 來識別工作階段。
/SERVER:servername 要查詢的伺服器 (預設值是目前的伺服器)。
/MODE 顯示目前的線路設定值。
/FLOW 顯示目前的流量控制設定值。
/CONNECT 顯示目前的連線設定值。
/COUNTER 顯示目前遠端桌面服務計數器的資訊。
/VM 顯示虛擬機器中工作階段的相關資訊。

 

Method#2
c:\> query.exe /server:{FQDN或IP}

(參數)
QUERY { PROCESS | SESSION | TERMSERVER | USER }

Method#3 (GUI)
工作管理員 > 使用者

[Linux] RHEL6 install Hitachi multipath ‘HDLM’

step01. 準備好 HDLM Linux License *.plk ; 可以查看確認該檔文字內容有無 for Linux ,若沒有可不是隨便將for Windows 改為 for Linux就可以用唷!

step02. 更名License KEY改為或複製成hdlm_license
# mv “HDS VSP GXXX SNXXXXXX DXXX XXXXXXXXXXXX".plk /var/tmp/hdlm_license

step03.  放入 HDLM CD-ROM

step04. 掛載HDLM光碟
# mount -t iso9660 /dev/cdrom /media
Or
# mount /dev/cdrom /media

step05. check HDLM version
# /media/HDLM_Linux/installhdlm -v

step06. 安裝HDLM
# /media/HDLM_Linux/installhdlm
—————————————————–
KAPL09210-I installhdlm will now start.
KAPL09093-I HDLM 8.5.1-00 will be installed. Is this OK ? [y/n]: y
Preparing packages for installation…
KAPL09076-I The permanent license was installed.
HDLM-8.5.1.0.808-4
KAPL09043-I The installation of HDLM-8.5.1.0.808-4 completed successfully.
KAPL09211-I installhdlm completed successfully.
—————————————————–

step07. 檢查HDLM已安裝
# rpm -qa | grep -i hdlm

step08. 詳看HDLM資訊
# rpm -qi HDLM

step09. 若未重開機啟動
# /opt/DynamicLinkManager/bin/dlmstart
# /etc/init.d/DLMManager start

step10. 加入HDLM環境變數 > /opt/DynamicLinkManager/bin
[BourneAgain shell ]
# PATH=$PATH:/opt/DynamicLinkManager/bin ; export PATH

[C shell]
# set path= ( $path /opt/DynamicLinkManager/bin )

step11. 若未重啟系統請立即重啟一次
# shutdown -r now
Or
# init 6

step12. 查看dlnkmgr運作狀態及設定,版本,Load Balance模式,自動容錯切換狀態(aft),硬碟
# /opt/DynamicLinkManager/bin/dlnkmgr view -sys
我大多會注意三項資訊及狀態 > { Load Balance , Path Health Checking , Auto Failback )

HDLM-view-sys.png# /opt/DynamicLinkManager/bin/dlnkmgr view -lu
# /opt/DynamicLinkManager/bin/dlnkmgr view -path
# /opt/DynamicLinkManager/bin/dlnkmgr view -drv

Done.

–Maintenance–

**啟用Load Balance及變更模式為Round-Robin**
# /opt/DynamicLinkManager/bin/dlnkmgr set -lb on -lbtype rr
(模式如下)
rr       >for the Round Robin algorithm
exrr   >for the Extended Round Robin algorithm
lio      >for the Least I/Os algorithm
exlio  >for the Extended Least I/Os algorithm
lbk     >for the Least Blocks. algorithm
exlbk >for the Extended Least Blocks algorithm

**啟用及變更Path Health Checking及間隔時間**
# /opt/DynamicLinkManager/bin/dlnkmgr set -pchk on -intvl 10

**啟用Automatic Failback及間隔時間**
# /opt/DynamicLinkManager/bin/dlnkmgr set -afb on -intvl 10 (預設是關閉)

**查詢HDLM指令用法**
# /opt/DynamicLinkManager/bin/dlnkmgr help view


Reference :

1. Eddynurh’s Weblog – HDLM Installation

2. 馬克思 Linux學習筆記 – HDLM install on RHEL5.2

3. (原廠) Hitachi Command Suite – Dynamic Link Manager(for Linux®) User Guide

4. 杨红1989 – LINUX 安装HDS HDML报错

[AIX] IBM AIX Useful CLI for maintenance

1. 備份到磁帶機
#smitty mksysb
Esc+4" // choice media “tape;rmt0″
以下二項改為yes
EXPAND /tmp if needed ?
Disable software packing of backup ?
最後按下Enter即開始備份

2. 檢查有無異常錯誤
# errpt ; 若要詳細則是 errpt -a
# errclear 0 // 清除所有錯誤訊息

3.詳列機器 (Hostname) , (Serial Number) , (memory) , Machine-Type , CPU
# prtconf | pg

4. 查看硬碟數量 / 容量大小
# lsdev -Cc disk
# lscfg -vl hdisk{x}

5. 查看OS版本
#oslevel -s

6. 檢查磁碟使用狀況
# lsvg rootvglsvg -l rootvg | pg

7. 查看CPU/Disk use utilization
# topas

8. 查看記憶體狀況
# nmon

9. 清除機器 informtion 燈號
# /usr/lpp/diagnostics/bin/usysfault -s normal

10. 檢查硬體Devices狀況
# lsdev -Cc adapter

11. 檢查使用容量大小
# df -m

補充:
不小心啟用了IBM Console 九宮格要如何消除
Shift + Num鍵

 

[Windows]如何讓Windows 2012 / 2016 工作管理員 – 效能 – 磁碟出現

在Windows 8開始在工作管理員 > 效能 都有監看磁碟效能;即使到了Windows 10依舊還是有的。眼尖的各位應有發現在Windows Server 2012 (伺服器版本)居然沒有 !! 真正有夠夭壽骨…

別急著生氣話說微軟說開啟會影響伺服器效能會被拖累..如下圖所示.
diskperf-source-info.png

既然這樣預設關閉,總是能開啟對吧^O^

Solution :

step01. cmd.exe (以系統管理人員身份執行)

step02. diskperf -Y (無需重新開機 ; 建議在查看磁碟效能需求再開啟它;用完建議關掉它吧)

diskperf.png


Reference :

  1. Microsoft TechNet – Diskperf
  2. Step-By-Step: Enabling Disk Performance Counters in Windows Server 2012 R2 Task Manager
  3. Server & Tools Blogs > Windows 8 / Windows Server 2012: The New Task Manager

[Windows] 更換’命令提示列(cmd.exe) / PowerShell美美字體

打開 cmd.exe 輸入 chcp 會秀出系統預設Big5 (CP950 ; Code Page 950 ) ;若要用UTF-8;Unicode(65001) 則輸入 chcp 65001

那拜讀到The Will Will Web 保哥 編改了 微軟雅黑字體 ( Microsoft YaHei Mono) 放置他的專案GitHub 字型 下載字型。

再開啟cmd.exe / powershell 順道將’預設值’及’內容’都把字型改成下載保哥編改過的Microsoft YaHei Mono字型即可看看美美字體。


Reference :

The Will Will Web 保哥 – ‘讓你的命令提示字元或 WSL 擁有一個美麗等寬的字型設定’

[VMware] Consolidation failed for disk node ‘scsi0:0’:5 (Input/output error)

當客戶反應說他們因儲存設備某一個LUN有問題;需立即將某台虛擬機器搬離這個有問題的LUN。但卻無法搬離開且有些怪異現象出現!

狀況查看:
1.  該台VM service運作正常。
2. 但用備份方式是都有錯誤狀況. e.g.
# use export to .ova/ovf > 失敗 (Failed to eport Virtual Machine: Unable to read data from the transport connection: The connection was closed.)
# use vmkfstools clone vmdk > 失敗 ( clone: 100% done.Failed to clone disk: Input/output error (327689).)
# use Backup (HPE VM explorer) > 失敗 (Failed: <VM/VM-000005-deltavmdk cannot be downloaded. ‘HTTP/1.1500 internal Server error’)
# use VMware Data Protect backup > 失敗 (整併磁碟節點 ‘scsi0:0’ 失敗:5 (input/output error).)
# 該VM瀏覽Datastore會發現大量 vm-000001.vmdk 增長到vm-000009.vmdk(快照檔案) ; 但由snapshot manager查看是無任何快照記錄.
# vMotion 搬移失敗.
# 指令 ‘esxcli storage core path stats get‘ 查看到僅有對應有問題的LUN,有所謂(Failed Read Operations: 74 / Failed Write Opterations: 2 )

由以上種種現象來看確實Storage volume有些狀況;但FibreChannel Switch & HBA是沒什麼問題.

最後解決客戶這問題僅能有OS level來處理;我則是用Acronis 11.7 offline backup all disk (ignore error才能成功) , then Create new VM and rexovery that image .

Done.