vCenter : Prepare SQL DB for vCloud and VDI installation

For the detailed steps, please refer to :
http://vmwaremine.com/2012/11/12/prepare-dbs-for-vsphere-5-1-installation-or-upgrade-part-1/

The important thing is to execute the following 4 DB scripts in MSSQL management studio.Which will create the relative DBs and users. Please change the password in the script accordingly.

vcdb_db_schema  <DB schema for vCenter Server>
vum_db_schema  <DB schema for VMWare Update Manager>
RSA_db_schema  <DB schema for vCenter SSO RSA DB>
RSAUser_db_schema <DB schema for vCenter SSO RSA USER>

Then configure the privilege for vpxuser and vumuser.

Then configure MS SQL ODBC on vCenter server.
Note, only 32bit odbc(C:\Windows\SysWOW64\odbcad32.exe) can be used to establish the VUM DB connection.
For VCDB, you can use the 2008R2 builtin 64bit odbc.
For the detailed steps, please refer to :
http://vmwaremine.com/2012/11/12/prepare-dbs-for-vsphere-5-1-installation-or-upgrade-part-1/

vCloud Director : How to renew SSL certificate?

By default, the SSL certificates generated by the following commands only valid for 90 days :

1
2
3
4
5
#ssh root@vcloudip
#cd /opt/vmware/vcloud-director/jre/bin/
#./keytool -keystore certificates.ks -storetype JCEKS -storepass yourpasswd -genkey -keyalg RSA -alias http
And
#./keytool -keystore certificates.ks -storetype JCEKS -storepass yourpasswd -genkey -keyalg RSA -alias consoleproxy

We can create  longer(example 360 days) certificates by assigning -validity option as the following commands:

1
2
3
4
5
#ssh root@vcloudip
#cd /opt/vmware/vcloud-director/jre/bin/
#./keytool -keystore certificates.ks -storetype JCEKS -storepass yourpasswd -validity 360 -genkey -keyalg RSA -alias http
#./keytool -keystore certificates.ks -storetype JCEKS -storepass yourpasswd -validity 360 -genkey -keyalg RSA -alias consoleproxy
#cp certificates.ks /opt/vmware/vcloud-director/ssl/

After creating the certificate , use the following command to replace the old certificate:

1
2
3
4
5
6
7
8
9
10
#ssh root@vcloudip
#service vmware-vcd stop
#cd /opt/vmware/vcloud-director/bin/
#./configure
Specify your generated SSL certificate's path(this example: /opt/vmware/vcloud-director/ssl/certificates.ks)
Enter the keystore and certificate passwords.
Please enter the password for the keystore:
Please enter the private key password for the 'http' SSL certificate:yourpasswd
Please enter the private key password for the 'consoleproxy' SSL certificate:yourpasswd
Choose "Yes" when it asks you to start the VCD service.

At the browser side , clean the browser cookies and cache and link to vCloud Director URL.

簡單介紹一下Zabbix

Zabbix Logo

Zabbix Logo

Zabbix 是一個監控套件
可監控網路上的devices

主要利用的監控方法有 Zabbix Agent, SNMP, SNMP trap, IPMI, SSH,TELNET,WEB,Database,JMX 跟自訂的scripts(Zabbix 稱External check)

Zabbix Agent 又可分主動(Active)跟被動(Passive)

Passive Agent : 由zabbix server 定期訪問Client device 上的 zabbix agent, 取得的讀值
Active  Agent : Client device 上的 zabbix agent 定期主動回報自己的讀值

Zabbix Agent 內建有多種對OS層的監控項目
https://www.zabbix.com/documentation/2.0/manual/config/items/itemtypes/zabbix_agent

可自訂自己的方法到Zabbix Agent來加強想要監控的項目。Zabbix 稱 UserParameterm。如get ipmi sdr from KCS。只要OS能拿到的都能監控。

Zabbix 主要的監控觀念  : Host, Item , Trigger ,  Action

Host : 要被監控的Device
Item : 監控的方法或是資料蒐集的方法
Trigger : 邏輯判斷蒐集到的值是否在定義的範圍內
Action : 若不是就行動。
             如Email 給誰 or IM 給走XMPP標準的的IM or SMS 給誰orv執行scripts等~

Zabbix 主要的設定項目有 : Host , item, trigger, template

Host : 設定哪個device要被監控
item : 對這個host要監控些什麼,要蒐集什麼讀值,要如何蒐集
trigger : 當蒐集到的值超出定義的範圍就 …
template : Template 包含以上辛苦設定好的三項,可export 成xml,再import到其他台zabbix上重複使用。import時可選擇不要Host, 使得template能通用。所有動作在Web UI完成,非常容易方變

跟Nagios不一樣的地方 :

1. Zabbix不需特別安裝RRD來達到繪圖功能,Zabbix內建簡單的繪圖功能,每個搜集的值都有簡易趨勢圖。
2. Nagios NRPE plugin(perl script) 在Client 端上判斷是否為問題後回傳,
Zabbix卻是在 Server端做邏輯判斷,非常彈性的可設定/改變判斷值
如 :
    Problem: If cpu1 temperature over 60 °C for last 10 minutes,
        then define it as a warning event.
    Recovery: If cpu1 temperature is within 20~60 °C for last 10 minutes,
        then define it as a recovery event.
3. 所有監控設定都是在WEB UI用滑鼠鍵盤完成。
4. 有內建對IPMI Device的監控,2.2版已加強到能監控descrete sensor
5. 前端用php
6. Zabbix 綁DB,Nagios 不用DB。

一些截圖:

用pXe遠端安裝多台Servers

所需設備

1.1台pXe Server(dhcp,tftp,apache)

2.1~40台 blank servers

3.每台servers需要有BMC功能 (沒有的話要一台一台手動開機調bios也ok)

4.一台48 Ports的SWITCH

pXe Server利用工具

1.dhcpd,tftpd,apache

2.ipmitool (控制bios開機程序)

準備工具

#yum install dhcp tftp-server httpd

設定 dhcpd.conf

Continue reading

以perceus安裝部屬實作cluster叢集

perceus 是一套可用來部屬/安裝/管理 叢集(cluster)系統的運用軟體。是一道指令。
是以master-slave的概念部屬,Master就是負責管理指派vnfs/IPs 給 slave nodes的機器。
只要指定好,各個node只要以PXE mode 開機,就會讀取到master那邊指派給的OS (tftp的方式傳輸)。
可非常快速的部屬不同服務的叢集群(cluster group)。因為都在記憶體執行,所以各node不一定需要硬碟。
故稱diskless  node

時下的機器(master)可承受32個nodes的同時開機。如果vnfs檔案作的夠輕便,512個nodes的開機時間約4分鐘。
可參考官方手冊:http://altruistic.infiscale.org/docs/

不多說了,開始動手做:

1.至perceus 官網下載 http://www.perceus.org/site/html/download.html , 本例使用redhat 5版本

1
#wget http://altruistic.infiscale.org/rhel/5/RPMS/x86_64/perceus-1.5.2-2111.x86_64.rpm

Continue reading

DNS bind9 的一些有用指令

bind9 就是用於Linux的dns伺服器套件。

bind設定檔對一些小錯誤都不計較,就算錯了一點,也能成功重啟SERVER。
但這是一個困擾的問題,等DNS生效需要一點時間,到時候才知道錯,也浪費時間。

有幾個bind相關的指令可幫助你重啟named(dns server)前,確認設定檔沒有錯誤。如下:

1.named-checkconf (檢測 named.conf 檔是否OK)

1
named-checkconf /var/named/named.conf

2.named-checkzone (檢測個別 zone 檔是否OK)

1
named-checkzone zawmin.com /var/named/named.zawmin.com.conf

3.named-bootconf (將舊的bind4 的named.boot檔轉換成bind8格式)
named-bootconf  < named.boot >  named.conf

自訂linux shell 環境

若用putty ssh 到Linux , terminal裡ls的預設資料夾顏色太暗,可以調整如下,

1.登入後
2.$vi ~/.bash_profile

把以下這兩行加入即可。

1
2
LS_COLORS="no=00:fi=00:di=00;94:ln=00;36:pi=40;33:so=00;35:bd=40;33;01:cd=40;33;01:or=01;05;37;41:mi=01;05;37;41:ex=00;32:*.cmd=00;32:*.exe=00;32:*.com=00;32:*.btm=00;32:*.bat=00;32:*.sh=00;32:*.csh=00;32:*.tar=00;31:*.tgz=00;31:*.arj=00;31:*.taz=00;31:*.lzh=00;31:*.zip=00;31:*.z=00;31:*.Z=00;31:*.gz=00;31:*.bz2=00;31:*.bz=00;31:*.tz=00;31:*.rpm=00;31:*.cpio=00;31:*.jpg=00;35:*.gif=00;35:*.bmp=00;35:*.xbm=00;35:*.xpm=00;35:*.png=00;35:*.tif=00;35:"
export LS_COLORS

3.$source ~/.bash_profile

本例把di從34(深藍)調成94(淺藍)。

順便把shell prompt也調一下,讓它顏色變亮+顯示路徑資訊,加入以下兩行至 ~/.bash.profile,

1
2
PS1="\n\e[1;37m[\e[0;32m\u\e[0;35m@\e[0;32m\h\e[1;37m]\e[1;37m[\e[0;31m\w\e[1;37m]\n$ "
export PS1

4.$source ~/.bash_profile

檔案類型跟色碼可參考下表 Continue reading

Google換背景事件,微軟幽默回應

前幾天Google悄悄的上了一個”搜尋首頁可以換背景“的功能。

在左下角可以看到一個 “變更背景圖片” 或  “Change background image” 的連接,按下去就可以選取你想要換的背景圖。

前提是你要有Google 帳號,在登入的模式才能作更換背景的動作。(這是一個誘導使用者申請Google Account的手法嗎?)

可從 公開圖片庫編者精選自己的Picassa網路相片個人電腦裡的圖片 選取。

Google搜尋頁啟動了背景功能,若不特別選取圖片,它就每天輪播一張編者精選圖片當成背景圖片。

若想取消,就再點一下搜尋頁面左下角的”除背景圖片”,即可回到傳統Google搜尋頁

如下:

Google Change Background Image

Google Change Background Image

Google Change Background Image

Google Change Background Image

Google Change Background Image

Google Change Background Image

搜尋引擎崁漂亮背景圖片的功能,Bing 一開始就有了,也有不少人認為Google學Bing

雖然我很喜歡Google,但我覺得使用個人化背景後,連到Google.com,會lag , 沒有傳統那麼順了。

背景圖片很大,整體的呈現也沒有Bing做得好看。我個人還是喜歡乾淨的傳統頁面。

對此,Microsoft的回應倒蠻幽默的(我覺得MS越來越幽默了!!!就像上次的IE6葬禮事件一樣),

歐洲的微軟 communication team ,用他們的Twitter 帳號,發了這樣的一個Tweet:”We’ve lost a background image, if found please return to bing.com ;) “,

意思是說:”我們遺失了一張背景圖片,若拾獲請歸還給bing.com ;) “。該Tweet的連接及圖片如下,

連結:http://twitter.com/MSEurope/status/15838998934

圖片:

Microsoft Lost Background Tweet

Microsoft Lost Background Tweet

從這些事件可看出一個現象,如果Copy到微軟的東西,大部分網友是不以為意的,只看熱鬧。

但反過來,如果微軟Copy到別人的東西,網友的反彈就會很激烈囉。

微軟每次的幽默回應,讓我對微軟刮目相看。

利用linux指令工具玩Twitter

第一種方法

如果不要裝任何套件,linux可以這樣玩Twitter

1
2
3
curl -u zawmin -d status="輸入你的TWEET MESSAGE" http://www.twitter.com/statuses/update.json

Enter host password for user 'zawmin':

輸入密碼後,你的TWEET就被推上去囉, 範例中zawmin就是Twitter帳號 ~

第二種方法

Andrew Price用python寫了一個twitter client程式Tywt,到 Twyt Download Repository下載 , 前提是你機器上要有 python,python-simplejason等相依程式。下載後如下安裝

1
#python setup.py intall

查看有些什麼功能 Continue reading