廣告

2025 年 1 月
 12345
6789101112
13141516171819
20212223242526
2728293031  

彙整

ESXi Server使用vcbMounter與vcbRestore線上備份與還原(含異機還原)

ESXi Server使用vcbMounter與vcbRestore線上備份與還原(含異機還原)

這種方式還原系統時,只能還原到該備份檔案當下備份時的主機上,要還原至其他主機上會出錯,異機還原要另外處理

參考網址

http://www.weithenn.org/cgi-bin/wiki.pl?vcbMounter_%E5%8F%8A_vcbRestore#Heading4

http://blog.slps.tp.edu.tw/00086/?p=220#more-220

異機還原

http://bbs.vmsky.com/thread-11439-1-1.html

使用ssh連線到ESXi Server上

備份指令(留意大小寫)

vcbMounter -h <備份的VM在那台ESXi Server > -u root –p <PW> -a ipaddr:<VM IP> -r <指定ESXi Server上的儲存媒體之備份目錄> -t fullvm

-M 0/1 ç 分割檔案的參數 1為不分割

例:

將 10.10.10.43 的ESXi SERVER上的 10.10.10.2 這台VM 備份到 10.10.10.43 的這個 /vmfs/volumes/NAS-ESXi-VM-Backup/bdc-vm_backup_20110428 儲存媒體的指定目錄下

vcbMounter -h 10.10.10.43 -u root -p <PW> -a ipaddr:10.10.10.2 -r /vmfs/volumes/NAS-ESXi-VM-Backup/bdc-vm_backup_20110428 -t fullvm

還原指令(還原時候該台ESXi Server不可有相同的目錄或同名Guest OS)

vcbRestore -h hostIP -u root -p password -s <來源檔案>

例:

vcbRestore -h 10.10.10.46 -u root -p <PW> -s /vmfs/volumes/NAS-ESXi-VM-Backup/bdc-vm_backup_20110428-test

異機還原:

vi 虛擬機器中的catalog file

1.

2. version= esx-3.0

3. state= poweredOn

4. display_name= "Win2000Pro"

5. uuid= "564d617f-26af-80b9-a93b-1c542015b355"

6. disk.scsi0:0.filename= "scsi0-0-0-Win2000Pro.vmdk"

7. disk.scsi0:0.diskname= "[ESX02-storage1] Win2000Pro/Win2000Pro.vmdk"

8. config.vmx= "[ESX02-storage1] Win2000Pro/Win2000Pro.vmx"

9. host= ESX02.tw.fedex.com

10. timestamp= "Mon Sep  3 08:54:36 2007"

11. config.suspenddir= "[ESX02-storage1] Win2000Pro/."

12. config.snapshotdir= "[ESX02-storage1] Win2000Pro"

13. config.file0= "Win2000Pro.vmsd"

14. config.file1= "Win2000Pro.vmxf"

15. config.file2= "Win2000Pro.nvram"

16. config.logdir= "[ESX02-storage1] Win2000Pro"

17. config.log0= "vmware-7.log"

18. config.log1= "vmware-8.log"

19. config.log2= "vmware-9.log"

20. config.log3= "vmware-10.log"

21. config.log4= "vmware-11.log"

22. config.log5= "vmware-6.log"

23. config.log6= "vmware.log"

24. folderpath= "/ha-folder-root/ha-datacenter/vm"

25. resourcepool= "/ha-folder-root/ha-datacenter/host/ESX02-Server/Resources/Production"

基本上只要修改3種設定
[ESX02-storage1] -> 改成 另一台ESX storage name
ESX02-Server -> 改成 另一台 ESX Server Name
Production -> 改成 另一台 你想要存放的 Resource Pool Name
之後再利用vbcRestore還原, 系統會根據catalog文件的路徑自動還原

apache根目錄只顯示預設的歡迎畫面問題

CentOS 5.5 的 apache 怎麼設定 /etc/httpd/conf/httpd.conf 根目錄並加入自己的網頁都只會顯示 預設的歡迎畫面,確無法顯示:
1

將/etc/httpd/conf.d/welcome.conf改名或刪除後即可正常使用。

vix-async-pipe程序造成 ESXi Server Cpu Loading滿載問題

今天看到其中一台 ESXi Server Cpu的LOADING滿載,可是看這台下面的VM機器CPU LOADING都很低,是什麼東西造成的到底?

1

 

使用SSH連入再下 top 指令查看,原來是這隻程序在搞鬼,不太清楚它是做啥用的,

vix-async-pipe

 

查了官方網頁的解法:

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1030894

To renice the vix-async-pipe process:

  1. Identify the PID (process ID) of the process with the command:
    # ps ax|grep vix-async-pipe
    In the output, the first number on the left is the PID of the process.

  2. With the PID from step 1, run the command:
    # renice -5 <PID>

  3. To confirm that the change took effect, run the command top and look at the value in the NI column.

沒用……………………………………

 

官方網頁說若沒用再試試這招:

http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1003490

[root@server]# service mgmt-vmware restart
Stopping VMware ESX Server Management services:
VMware ESX Server Host Agent Watchdog [ OK ]
VMware ESX Server Host Agent [ OK ]
Starting VMware ESX Server Management services:
VMware ESX Server Host Agent (background) [ OK ]
Availability report startup (background) [ OK ]
[root@server]# service vmware-vpxa restart
Stopping vmware-vpxa: [ OK ]
Starting vmware-vpxa: [ OK ]
[root@server]#

========================

service vmware-vpxa restart <==這部份我執行會說我系統沒這 service…所以我只有執行service mgmt-vmware restart 結果就好了!

Outlook Express開啟附件檔案時,系統延遲無回應很久或是列印緩慢問題。

請開啟檔案總管,設定所有資料夾與檔案都看的到

1

 2

然後進到下面目錄,最後的Content.IE5是隱藏的,要手動打,保持所有程式關閉狀態後再把目錄下所有檔案都刪除(Index.dat無法刪請保留)即可讓Outlook Express直接開啟附加檔案遲緩無回應問題。

C:\Documents and Settings\roger.WINPEX-GL\Local Settings\Temporary Internet Files\Content.IE5

===============================================================

也可用CCLEARN這套軟體清,方便有效!

http://sofree.cc/ccleaner/3/

Windows 2003 終端機服務預設10條連線解決方式

Windows 2003 終端機服務預設10條連線解決方式

到Windows 2003終端機server 上,開始 => 執行 => gpedit.msc 開啟本機群組原則 => 電腦設定 => 系統管理範本 => windows 元件 => 終端機服務 => 限制連線數目

即可修改連線數,修改完後可直接套用,免重開機(我測試是這樣啦~)

1

又有人掉東西 –撿到 OLYMPUS E-PL2

怪了,又有人掉東西了,這次是掉在我家門口……

 Image00001  

開起來看看吧,哇靠~~這不是我最近看討論區後最想要的一台 M 4/3 輕單眼相機 OLYMPUS E-PL2 來著嗎?!

Image00004

  1. 中英文說明書…當然有中文我就看中文,比較親切點。
    (迷之音:英文爛就說一聲) /_\
  2. 機體 + 14mm-42mm f3.5-f5.8 至於這數字幹麻的?大概可看出是3倍光學不失真變焦(42/14)。
  3. f3.5-f5.8光圈嘛…我剛google一下做了小功課,這邊有簡易說明,基本上就我的認知光圈跟景深(前主體清處後背景模糊)有很大的關係…
    http://tw.myblog.yahoo.com/jw!J0hpQNKBSEPvm_ePMoRL_VQ-/article?mid=1120
  4. 原廠包…看了一下雖然很陽春,但是中間有片軟隔板是可用魔鬼沾調整兩邊格子大小,還滿不錯的!
  5. 相機背帶、手帶都有,我應該會用背帶吧,掛脖子比較方便。
  6. 可接HDMI ,但慣例都沒有附線材,得自己花費。
  7. 買了一個鏡頭護片,感覺多少會減透光度,但其實拍起來我是沒啥感覺,沒辦法,神經太大條,很容易滿足……重點是可保護鏡頭不被刮傷,清潔比較簡易。
  8. 買一顆副廠日製電池,標榜每年過保前免費換一顆新品!?我猜外殼跟內部可回收的是環保材質,只有芯更換。不過就算這樣,可免費用到相機退休為止,也算不錯。
  9. 8G創見10 CLASS 記憶體與一些小贈品……

Image00006

分屍照…
Image00007

再來就是做些功課跟練習拍出自己想要的效果…我不專業,也稱不上業餘,但起碼我要玩的自己開心,純脆自己爽就好  XD

後記:下個月一天只能吃一餐了….我的媽呀~~透支了我 >_<

Delphi 下讓使用者選擇目錄方式:

Delphi 下讓使用者選擇目錄方式:

OpenDialog 元件是讓使用者選檔案,那選目錄要使用什麼方式呢?

USE QDialogs

procedure TForm1.cxButton1Click(Sender: TObject);
var
  Dir: WideString;
begin
  if SelectDirectory(‘請選擇目錄’, ”, Dir) then
  begin
    ShowMessage(Dir);
  end;
end;

SelectDirectory(‘請選擇目錄’, ”, Dir)

第一個參數為提示文字,第二個參數可設定預設目錄,第三個參數為使用者選取目錄後的目錄路徑

可對SelectDirectory按F1查詢使用方式,還有VCL的用法可用,代的參數又不一樣,有興趣的可研究一下。

有不會念的中文字?微”軟”新注音手寫板幫助您

1. 開起記事本
2.保持遊標在記事本上
3.切換成新注音輸入法
4.選取 工具選單 => 輸入法整合器 
1

在上面寫上文字,再把滑鼠移到到左邊對應的文字上停止,就可看到注音唸法了,當然點下去就會把選取的字輸出到記事本上,可當手寫板用。
2

Mailscanner取回隔離區的信-Releasing mail from the quarantine

Releasing mail from the quarantine – queue files

For the purposes of this, I’m assuming you have set up a single (safe!) postfix instance, with messages going to the HOLD queue, before being processed by MailScanner and sent to the INCOMING queue. You also need to be saving whole messages as queue files.

In MailScanner.conf ensure that you have

# When you quarantine an entire message, do you want to store it as
# raw mail queue files (so you can easily send them onto users) or
# as human-readable files (header then body in 1 file)?
Quarantine Whole Messages As Queue Files = yes 

Quarantined emails are by default kept in /var/spool/MailScanner/quarantine and sorted into subdirectories by date. With any luck it will be dead easy to find, as MailScanner will have sent a message including text along the lines of either:

A: If it’s a quarantined virus, or other dangerous content.

“Note to Help Desk: Look on the <Your text> in /var/spool/MailScanner/quarantine/20050309 (message
6BC5E368497.3C3A6).” 

MailScanner keeps such quarantined emails in their own directories, thus the directory containing the quarantined message will be (in this example): /var/spool/MailScanner/quarantine/20050309/6BC5E368497.3C3A6. In this directory, you should see the original queue file, named as a 10 digit hex number matching the name of the directory. There should also be copies of any attachments that may have been picked up by the virus scanning engine or file filtering.

B: If it’s a quarantined spam

"Your system administrators will need the following information:
Server name: <Your Server>
Message id: 46EE0E18151.CE630
Date code: 20080509"

MailScanner keeps all spam on a given day in the same directory, thus the directory containing the quarantined message will be (in this example): /var/spool/MailScanner/quarantine/20080509/spam.

If you want to check the original message use:

# postcat <filename>

Releasing an email from quarantine is a simple matter of replacing the queue file back into the Postfix queue, so that it gets sent. The permissions on the file are wrong, however and must be changed.

# chmod 700 <filename>

The file must now be moved into /var/spool/postfix/incoming. There may be 16 directories in there (Collectively referred to as ‘hashed queue files’) each corresponding to a hexadecimal digit, depending which version of Postfix you are running. First check if you have hashed queue files by:

# ls /var/spool/postfix/incoming

If no directories are listed then follow the instructions below but do not add the trailing letter/ number.

The file must be placed in the directory which corresponds to the first digit of the filename. So in the example above, it must go into /var/spool/postfix/incoming/6. We must also be sure to preserve the ownership and permissions of the file when moving it, so we use “cp -p”. If the message is a spam, we must also remove the trailing 6 characters.

Thus for the example above:

# cp –p 6BC5E368497 /var/spool/postfix/incoming/6

or for the example quarantined spam

# cp –p 46EE0E18151.CE630 /var/spool/postfix/incoming/4/46EE0E18151

The email will disappear from the queue and be delivered.

Thanks to Joshua Hirsh for the details and Stef Morrell for writing the document

Releasing mail from the quarantine – with a bash script

Maybe it’s too circuitous for you to do all the steps in the section above to release a mail. For this I wrote a tiny script to release very easily. To use this script you should set the MailScanner environment identically to the article above.

To use this script copy it to a file and make it executable.

The Syntax: release.sh <Message-ID> (e.g. release.sh 5B604228086.932F0)

#!/bin/sh

if [ -z "$1" ]; then
        echo "Syntax: release.sh <Message-ID> i.e. 5B604228086.932F0 (case sensitive)" 
        exit
fi

#change in the quarantine folder
folder=`find /var/spool/MailScanner/quarantine/ -name $1`
cd $folder

#set the mailfile executable
mailname=`echo $1 | cut -d . -f 1`
chmod u+x $mailname

#lets get the first character
char=`echo $1 | cut -b 1-1`

#copy the mail 
cp -a $mailname /var/spool/postfix/incoming/$char/

echo Mail $mailname released

Releasing mail from the quarantine – message files

If you don’t quarantine the complete queue file, but instead have the rfc822 message file, releasing messages are actually a bit simpler (for postfix) than the above, since you can use the postfix sendmail convenience program.

In MailScanner.conf you have

Quarantine Whole Messages As Queue Files = no 

and in the quarantine directory you have a file called message (this is the complete human-readible message, but without the envelope info). Just do

cd /path/to/quarantine/dir
sendmail -t -i < message

to send the message to the recipient(s) as found in the message file, or

cd /path/to/quarantine/dir
sendmail -i alternate_recipient@example.net < message

to send the message to an alternate recipient (of course you can combine them). The -i option is to avoid terminating the message prematurely on a spurious single “.” on a line in the message file.

If you use MailWatch, this can also release the message iff you don’t quarantine the whole message file as the queue file, although this uses a different method to release messages from the GUI.

Releasing mail from the quarantine – queue files postfix (again)

In a larger environment with many hosts and thousands of quarantined emails per day, we’ve found it impractical to reply to each email released or deleted from a queue, and simply process it without fanfare. The code below is modified from the release.sh above to accomodate moving the released mail back into postfix using the original mail ID. In addition, our postfix install required us to rename the queue file to its shortname, that is, the 10 or 11 character filename before postfix would accept the email into the queue.

The Syntax: release.sh <Message-ID> (e.g. release.sh 5B604228086.932F0)

#!/bin/sh

if [ -z "$1" ]; then
        echo "Syntax: release.sh <Message-ID> i.e. 5B604228086.932F0 (case sensitive)" 
        exit
fi

#change in the quarantine folder
folder=`find /var/spool/MailScanner/quarantine/ -name $1 | sed -e "s/$1//g"`
cd $folder

#set the mailfile executable
mailname=`echo $1 | cut -d . -f1`
chmod u+x $1

#lets get the first character
char=`echo $1 | cut -b 1-1`

#copy the mail 
cp -a $1 /var/spool/postfix/incoming/$char/$mailname

The following is for recent postfixes (2.3, 2.4) which seem to have a flat incoming directory:

#!/bin/sh

# this is the final destination for the mail to be released:
# postfix's incoming queue
POSTFIX_DEST=/var/spool/postfix/incoming

# check for valid parameters
if [ -z "$1" ]; then
        echo "Syntax: release.sh <Message-ID>"
        echo "Example: release.sh 678362AC.9CFE7"
        exit
fi

# find the specific mail in the quarantine folders
folder=`find /var/spool/MailScanner/quarantine/ -name $1`

mailname=`echo $1 | cut -d . -f1`

# copy the mail 
if [ -e $POSTFIX_DEST/$mailname ] ; then
        echo "ERROR: $mailname already in $POSTFIX_DEST! EXITING"
        echo "This should not happen"
        exit 255
fi

cp -avi "$folder/$mailname" "$POSTFIX_DEST/$mailname"

# make it 0700 so that the mail is deemed ready
chmod 0700 $POSTFIX_DEST/$mailname

Releasing mail from the quarantine – the one liner

sudo install -m 0700 -o postfix <source message> /var/spool/postfix/incoming

Releasing mail from the quarantine – alias with intelligence

integrate() {
  # integration: antonym of quarantine
  # Pass the message ID as obtained from user's email as $1
  DEST=$(postconf queue_directory | cut -d= -f2)/incoming
  SOURCE=$(find /var/spool/MailScanner/quarantine -name "$1")
  install --verbose --mode=0700 --owner=postfix $SOURCE $DEST
}

Updated bash script

Line 9 on initial bash script returned filename with full path and not folder, as expected. Instructions at the top also used the cp -p option, and not -a. Instead of cd’ing to quarantine folder, this will do the copy and preserve permissions.

#!/bin/sh

if [ -z "$1" ]; then
        echo "Syntax: release.sh <Message-ID> i.e. 5B604228086.932F0 (case sensitive)" 
        exit
fi

#find the quarantined file and set permissions
quarantined_file=`find /var/spool/MailScanner/quarantine/ -name $1`
chmod u+x $quarantined_file

#truncate the filename
mailname=`echo $1 | cut -d . -f 1`

#lets get the first character
char=`echo $1 | cut -b 1-1`

#copy the mail, destination is the truncated filename
cp -p $quarantined_file /var/spool/postfix/incoming/$char/$mailname

echo Mail $mailname released

截取印表機驅動程式

截取印表機驅動程式:

如果有台PC有某台印表機的DRIVER,但是你想把這台印表機的DRIVER轉到SERVER上,可是網路上卻抓不到此台印表機的Driver,就可用這程式抓取,小巧好用!

http://www.novell.com/communities/node/350/printer%20driver%20generator