[Linux] CentOS 6.x / 7.x change Hostname

{Centos 6.x}
step01. check current hostname
# hostname

step02.
# vi /etc/sysconfig/network
———modify———
HOSTNAME=改成你要的主機名稱
———modify———

step03.
# vi /etc/hosts
———modify———
* IP FQDN Hostname *
192.168.1.1  www1.dns.com.tw www1
———modify———

step04.
# service network restart 或 sync;sync;sync;shutdown -r now , init 6

Done.

{Centos 7.x}
step01. check current hostname
# hostname

step02. 永久的名稱
# hostnamectl –static set-hostname www1.dns.com.tw

若暫時等同用CentOS 6.x > hostname www1.dns.com.tw)
# hostnamectl –transient set-hostname www1.dns.com.tw

—-hostnamectl 三個模式—
-static        靜態
–transient 短暫
–pretty       機靈

step03.
systemctl restart network.service  或 sync;sync;sync;reboot , init 6
** Check **
# cat /proc/sys/kernal/hostname
# hostname
# hostname -f  (查詢 FQDN)
# hostname -i  (查詢主機對應IP)
# hostname -I  (查詢主機對應所有IP)

**Caution**
若只用指令hostname來變更CentOS 6.x僅是暫改,若重開機還是會回復原先主機名稱 !

[Cisco] UCSM / FI6248UP ‘default Keyring’s certificate is invalid, reason: expired’

在維護已久的UCSM (FI6xxx) series總是容易見著這樣的錯誤訊息。不去理會其它不會對維運設備造成太大影響,只是偶而客戶問及總不希望有個錯誤訊息掛載在那兒。
ucs-error.jpg

Resolution :

step01. SSH login UCSM

step02. # scope security

step03. /security# scope keyring default

step04./security/keyring# set regenerate yes

step05./security/keyring* commit-buffer // 套用立即生效

等待幾分鐘這個錯誤訊息即會消失..^O^


 

Rerfernce :

  1. vStrong.info – HOW TO: Regenerate expired UCS Manager certificate
  2. virtualbuildingblocks.com – Regenerate Expired Cisco UCS Certificate
  3. vnotions – Fix: Cisco UCSM – Default Keyring’s certificate is invalid

[Web] Let use HFS be security + STunnel

讓如何HFS.exe小型網頁伺服器可以使用 SSL 443加密呢? 那就是找個伴侶唄..

step01. download STunnel 工具

step02. 下載好即安裝它 ‘ stunnel-5.49-win32-installer.exe’ 過程是在產生憑證自行定義之。

step03. 編輯 %PROGRAMFILES(x86)%\stunnel\config\stunnel.conf

————————————stunnel.conf————————————
拿掉註解 ‘ ; ‘分號
; TLS front-end to a web server
[https]
accept = 443
connect = 80
cert = stunnel.pem
; “TIMEOUTclose = 0″ is a workaround for a design flaw in Microsoft SChannel
; Microsoft implementations do not use TLS close-notify alert and thus they
; are vulnerable to truncation attacks
;TIMEOUTclose = 0
————————————stunnel.conf end————————————

step04. stunnel > Configuration > Reload Configuration
stunnel-config-reload.jpg

step05. try HFS , https://HFS-ip-address
hfs-enable-ssl.jpg

Enjoy ^O^!

[Linux] How to use Memtest86+ v5.01 from PXE boot on BIOS

step01. ready Binary zip/gz file , 載點

step02. create /memtest86boot directory

step03. extract zip/gz file , then put ‘memtest86+-5.01.bin‘ into /MT folder

step04. download ‘some one custome tfptd packages environment

step05. extract MemTest86.zip , rename ‘PXE_Mem_test’ to ‘MT86’

step06. perform ‘TFTPD32’

step08.extract memtest86+ v5.01 binary zip/gz pub ‘MT’ , remove .bin extension otherwise it will NOT BOOT!

memtest86_001.jpg

step09. TFTPD32 settings > TFTP Base directory 指向 ‘%path%MT86’
memtest86_002.jpg

step10. DHCP > Boot file : pxememtest.0
memtest86_003.jpg

step11.
Let’s use hardware on BIOS environment to PXE boot + memtest86+..
Enjoy !


Reference :
* Symantec – Running Memtest86+ Using the Altiris PXE Server
* wiki.seanmadden.net – Memtest over PXEBoot
How To Setup a custom PXE Server on Windows OS

[NetApp] 7-mode single interface use multiple IP

ifconfig interface_name [-]alias address

<Create>
ifconfig e0a alias x.x.x.x

<Remove>
ifconfig e0a -alias x.x.x.x

** sample /etc/rc **
# Modify 2018-10-25 By xxxx
ifgrp create lacp bond0 -b rr e0a e0b e1a e1b
hostname Filer
ifconfig bond0 192.168.1.100 netmask 255.255.255.0 mediatype auto mtusize 9000
ifconfig bond0 alias 192.168.2.100
route add default 192.168.1.254 1
routed on
options dns.enable on
options nis.enable off
setflag smb_enable_2_1 1 # enable SMB2.1 is 1 ; disable is 0
savecore
priv set diag; setflag smb_enable_2_1 0; priv set

wrfile /etc/rc , then “Ctrl+c"

source /etc/rc

 


Reference : NetApp – Create and remove aliases

[Linux] How to get Your Public IP Address

# curl ipinfo.io/ip

# curl ifconfig.co

# curl ifconfig.me

# curl icanhazip.com

# curl ipecho.net/plain;echo

# wget -qO- http://ipecho.net/plain | xargs echo

# wget -qO- http://ipecho.net/plain ; echo

# wget -qO – icanhazip.com

# hostname -I


 

Reference :
tecadmin.net – 5 Commands to Get Public IP using Linux Terminal

[Hardware] Server do memory run over 24H or 72H testing

說到記憶體測試大概腦中浮現 MetTest86+ ,但發現沒有Plus字樣的MemTest86它可以把過程編成一個報告(內含Vendor名稱,機器Mode name , 機器Serial Number )這個是很好作一個驗收工具且免費版即可作到唷!

PS:報告格式 " MemTest86-Report-年月日-時分秒.html "

sample如下:
memtest86-report.jpg

另外,若打算存報告的話建議是用usb boot 且製作usb boot不適用自行用rufus這類工具製作,不論是MemTest86+ 或 MemTest86 二家都有提供製作成USB開機工具.

 


1. MemTest86 – Official Site of the x86 Memory Testing Tool

2. Memtest86+ – Advanced Memory Diagnostic Tool

[VMware] How to use PXE deploy ESXi 6.5 or 6.7

Prepare :
1. tftp server , 載點
2. Web server , 我習慣用 hfs , 載點
3. ESXi 6.5 or 6.7 iso source , 載點
PS: 若 Serva也是不錯工具免費版目前最多佈署3個sessions,兼併很多角色Server , 載點

Procedure :

step01. Create tftp root directory (e.g. I create directory at c:\tmp\tftp_root )

step02.
> perform tftpd64.exe > Settings > DHCP ‘Boot File’ 加入一串 mboot.EFI
> 設定DHCP派送IP , IP pool start address (e.g. 我設定是 199.1.1.101開始,最多10組DHCP IP) ;需不需要Gateway再個案設定之. Mask (Opt 1) 設定為 255.255.255.0
tftpd_mboot.efi.jpg

step03. extract ESXi 6.5 or 6.7 ISO put under tftp directory (e.g. c:\tmp\tftp_root\ESXi67 )

step04. 將 ESXi source 目錄 \EFI\BOOT\BOOTX64.EFI 複製到你預設 tftp root directory底下,更名為 mboot.EFI (e.g. c:\tmp\tftp_root\mboot.EFI )

step05. copy ESXi source ‘ EFI\BOOT\BOOT.CFG ‘ put ur tftp root directory (e.g. c:\tmp\tftp_root\BOOT.CFG )

step06. edit BOOT.CFG
PS:刪除此範本所有的 ‘ / ‘ 假若我的安裝source ‘ESXi67’在 c:\tmp\tftp_root\ESXi67 ;我tftp root 錄路徑為 ‘ / ‘ ; 多加一串 ‘prefix=‘ ; 存檔後再複蓋 ESXi source \  底下BOOT.CFG
———————————BOOT.CFG Start———————————————
bootstate=0
title=Loading ESXi installer
timeout=5
prefix=ESXi67
kernel=b.b00
kernelopt=ks=http://199.1.1.1/ks/ks.cfg
modules=jumpstrt.gz — useropts.gz — features.gz — k.b00 — chardevs.b00 — user.b00 — procfs.b00 — uc_intel.b00 — uc_amd.b00 — vmx.v00 — vim.v00 — sb.v00 — s.v00 — ata_liba.v00 — ata_pata.v00 — ata_pata.v01 — ata_pata.v02 — ata_pata.v03 — ata_pata.v04 — ata_pata.v05 — ata_pata.v06 — ata_pata.v07 — block_cc.v00 — bnxtnet.v00 — brcmfcoe.v00 — char_ran.v00 — ehci_ehc.v00 — elxiscsi.v00 — elxnet.v00 — hid_hid.v00 — i40en.v00 — iavmd.v00 — igbn.v00 — ima_qla4.v00 — ipmi_ipm.v00 — ipmi_ipm.v01 — ipmi_ipm.v02 — iser.v00 — ixgben.v00 — lpfc.v00 — lpnic.v00 — lsi_mr3.v00 — lsi_msgp.v00 — lsi_msgp.v01 — lsi_msgp.v02 — misc_cni.v00 — misc_dri.v00 — mtip32xx.v00 — ne1000.v00 — nenic.v00 — net_bnx2.v00 — net_bnx2.v01 — net_cdc_.v00 — net_cnic.v00 — net_e100.v00 — net_e100.v01 — net_enic.v00 — net_fcoe.v00 — net_forc.v00 — net_igb.v00 — net_ixgb.v00 — net_libf.v00 — net_mlx4.v00 — net_mlx4.v01 — net_nx_n.v00 — net_tg3.v00 — net_usbn.v00 — net_vmxn.v00 — nhpsa.v00 — nmlx4_co.v00 — nmlx4_en.v00 — nmlx4_rd.v00 — nmlx5_co.v00 — nmlx5_rd.v00 — ntg3.v00 — nvme.v00 — nvmxnet3.v00 — nvmxnet3.v01 — ohci_usb.v00 — pvscsi.v00 — qcnic.v00 — qedentv.v00 — qfle3.v00 — qfle3f.v00 — qfle3i.v00 — qflge.v00 — sata_ahc.v00 — sata_ata.v00 — sata_sat.v00 — sata_sat.v01 — sata_sat.v02 — sata_sat.v03 — sata_sat.v04 — scsi_aac.v00 — scsi_adp.v00 — scsi_aic.v00 — scsi_bnx.v00 — scsi_bnx.v01 — scsi_fni.v00 — scsi_hps.v00 — scsi_ips.v00 — scsi_isc.v00 — scsi_lib.v00 — scsi_meg.v00 — scsi_meg.v01 — scsi_meg.v02 — scsi_mpt.v00 — scsi_mpt.v01 — scsi_mpt.v02 — scsi_qla.v00 — shim_isc.v00 — shim_isc.v01 — shim_lib.v00 — shim_lib.v01 — shim_lib.v02 — shim_lib.v03 — shim_lib.v04 — shim_lib.v05 — shim_vmk.v00 — shim_vmk.v01 — shim_vmk.v02 — smartpqi.v00 — uhci_usb.v00 — usb_stor.v00 — usbcore_.v00 — vmkata.v00 — vmkfcoe.v00 — vmkplexe.v00 — vmkusb.v00 — vmw_ahci.v00 — xhci_xhc.v00 — elx_esx_.v00 — btldr.t00 — weaselin.t00 — esx_dvfi.v00 — esx_ui.v00 — lsu_hp_h.v00 — lsu_lsi_.v00 — lsu_lsi_.v01 — lsu_lsi_.v02 — lsu_lsi_.v03 — native_m.v00 — qlnative.v00 — rste.v00 — vmware_e.v00 — vsan.v00 — vsanheal.v00 — vsanmgmt.v00 — tools.t00 — xorg.v00 — imgdb.tgz — imgpayld.tgz
build=
updated=0
———————————BOOT.CFG End———————————————-

說明:

prefix=ESXi67
kernel=b.b00  // PS. v6.7僅剩 b.b00 不若之前有 tboot.b00 檔案
kernelopt=ks=http://199.1.1.1/ks/ks.cfg // PS. 若有需要無人值守必要有作KickStart編輯; e.g. 密碼 ,

step07. clock hfs.exe , (e.g. My KickStart directory  hfs root put c:\tmp\tftp_root\ks )

step08. edit ks.cfg
———————————ks.cfg End———————————————-
#
# Sample scripted installation file
#
# Accept the VMware End User License Agreement
vmaccepteula
# Set the root password for the DCUI and Tech Support Mode
rootpw P@ssw0rd!
# Install on the first local disk available on machine
install –firstdisk –overwritevmfs
# Set the network to DHCP on the first network adapter
network –bootproto=dhcp –device=vmnic0

reboot

# A sample post-install script
%post –interpreter=python –ignorefailure=true
import time
stampFile = open(‘/finished.stamp’, mode=’w’)
stampFile.write( time.asctime() )
———————————ks.cfg End———————————————-
PS: About the Default ks.cfg Installation Script 可以參考 ‘ vsphere-esxi-67-installation-setup-guide.pdf page 77

 


Reference :
1. xenappblog – Automatically Install VMware ESXi 6.7 through PXE boot

2. Virtual Reality – Automating Esxi Deployment Using PXE Boot and Kickstart

3. VMware Docs – 使用 TFTP 對 ESXi 安裝程式進行 PXE 開機

4. VMware ESXi 6.7 Installation and Setup – VMware Docs

5. 通过PXE快速部署VMware ESXi 6.5

[Lenovo] LXCA How to upgrade v1.x to v2.x

要升級 v1.x 到 v2.x 需求

a.升級到v2.1需升到v2.0
b. v1.x先升級到 v1.4.1 update package (LXCA migrationtool)
c. v2.0 升到 v2.1 需要費時 40分鐘 ~ 一小時

升級流程:
v.1x > 1.4.1 > 2.0.0 > 2.1.0

事前準備工作:
a.下載 XClarity Administrator v1.4.1 (For migration only)

Upgrade procedure :

step01. login LXCA https://lxca-ip/ui/login.html

step02. confirm current " data, settings, and device managemet" list

step03. Administration > Update Management Server > Import > Select Files "
一次選四個 ( lnvgy_sw_lxca_41-1.4.1_anyos_noarch.tgz & lnvgy_sw_lxca_41-1.4.1_anyos_noarch.xml ) > Import

step04. choice import file > Perform Update > Restart

The update request has been submitted to the management server.
Please wait…this update could take several minutes…
Refresh the browser window to check if the management server has completed the update. // 更新過程網頁無畫面時可以按下 refresh重整畫面。

step04. Motoring > Jobs

step05. check job item “Import management-server update packages" state “complete"

step06. Administration > Shut down Management Server > Reboot // Apply upgrade v1.x to v1.4.1

step07.login LXCA ,
show you message
Lenovo XClarity Administrator version 1.4.1 is intended only for migrating data and settings to another Lenovo XClarity Administrator version 2.0.0 virtual appliance. Avoid performing any other operations."

step08.登入多了一項初始化未完成Item “Configure Service And Support Settings"

step09.
*Usage Data*
We’d like to ask a favor. In order to improve the product, and make your experience better, would you allow us to collect information on how you use this product? > 當然say No就不是頭殼壞去 , then Apply

*Call Home Configuration*
> Skip Step

*Lenovo Upload Facility*
> Skip Step

*Warranty*
>Apply

*Initial Setup*
> Return to Initial Setup

step10.
Item “Work with managed systems" // 準備轉移資料/設定/管理機器清單囉 ! 要想清楚唷…點下去就無法回頭 ><

step11.按下關鍵性一刻.進入LXCA管理介面右下角就會跳出一個訊息
“This version is for Migration use Only (1.x.x to 2.0.0).

To migrate data and settings to Lenovo XClarity Administrator version 2.0.0, go to Administration > Update Management Server > Export Data and Settings. Avoid performing any other operations."

step12. Administration > Update Management Server > Export Data and Settings.  // 照作咩 ; 建議重新登出再登入才會看到

step13.
Actions > Create data packageLXCA-export-data-and-settings.png

**若有需要連OS image 及 firmware需移轉就勾選;若不需要就輸入二次 Passphrase (最少九位數唷) > confirm

LXCA-export-data-and-settings2.png

step14. 完成後有二種方式轉移
method#1. Download data (offline) 匯出檔案 > 關掉舊LXCA or disconnect LXCA NICs > 佈署新LXCA > 登入新LXCA v2.0.0 > 初始化畫面即會看到"Restore from Backup"  > Upload package > Upload > 詢問該package Passphrase > Import

LXCA_import_success.jpg

LXCA_2.jpg

LXCA_3.jpg
匯入時間需視備份檔大小而定 (e.g. 18MB 也差不多需要 15分鐘)

<Caution> 不能偷懶用 LXCA v2.1.0來匯入 v1.4.1 export data 唷..v2.1.0僅接受匯 v2.0.0版本 export data !!

<PS: New LXCA 2.0.0> 改善了新安裝LXCA若無法取得DHCP若要設定IP都需編輯eth0_config包入.iso檔名讓LXCA掛載來設定;現在在開機時會出現150秒等待設定IP畫面。LXCA210-screen.png

method#2. Push data (online) 線上移轉到新一台LXCA

step15. 登入 LXCA v2.0.0 會發現多了可以備份功能 “Back Up and Restore Data" & “可自訂notification信件內容"
LXCA_4.jpg

LXCA_8.jpg

**信件主旨為下圖**
LXCA_9.jpg

step16. 繼續給它升級下去唄..走..下一個v2.1.0
download “Lenovo XClarity Administrator Virtual Appliance Update 2.1.0″ .tgz

step17. Administration > Update Management Server > Import > Select Files "
一次選四個 ( lnvgy_sw_lxca_41-1.4.1_anyos_noarch.tgz & lnvgy_sw_lxca_41-1.4.1_anyos_noarch.xml ) > Import

step18. choice import file > Perform Update > Restart

step19. Reboot , and login LXCA verify version is v2.1.0
check version method#1 > 點選 Administration > Update management server
check version method#2 > 點擊右上角帳號 > About

Done.


Reference :
1. Lenovo XClarity Administrator Upgrading Guide from v1.x to v2.x
2. Before installing Lenovo XClarity Administrator2.1 please read
3. Lenovo XClarity older versions of XClarity Administrator Repository Pack
4. Migrating to Lenovo XClarity Administrator v2.0.0
5. Lenovo XClarity All version download

[VMware] 登入Windows版 vCenter 6.5 vSphere Web Client (Flash-base) 會一直跳出 “發生內部錯誤 – Error #1009″

在客戶升級了5.5U2 > 6.0 > 6.5U2 但居然會出現vCenter 5.5U1 Bug ;但這Bug在5.5U2已修正居然會出現不解啊 ><

情境: 使用 vSphere Web Client (Flash-base) login後會一直跳出 “發生內部錯誤 – Error #1009″ 錯誤訊息。

Workaround :

step01. 進入 C:\programdata\vmware\vCenterServer\data\vSphere Web Client\SerenityDB\

step02. 刪除 serenity 這個整個目錄

delete C:\programdata\vmware\vCenterServer\data\vSphere Web Client\SerenityDB\serenity

step03. 重啟vSphere Web Client服務即可
.\service-control –stop vspherewebclientsvc && .\service-control –start vspherewebclientsvc

step04. 確認服務處於running
.\service-control –status vspherewebclientsvc

Done.


Reference : VMware vSphere Web Client reports an internal error 1009 (2089949)