Setting VDR (設定 VMWare Data Recovery 服務)
先設好少於 500G 的 cifs 空間。大於此容量會有備份失敗及莫名的 error 發生。
設定 cifs 的取用者帳號密碼。
放入 VDR 光碟於 vCenter + vSphere Client 的電腦安裝(如此可方便管理,最好不要安裝於其他電腦,除非另有目的)。
設定時會與 vCenter 作密碼的認證結合,若往後 vCenter 換密碼,要再到 VDR 去重設。
VDR 虛擬機要校時,可用一般的 centos 指令。
請於 dns 伺服器設定各 esx 伺服器、vCenter 、storage 等等的相關 A 記錄,否則備份會失敗。
開始設定 backup 規則。backup 只會在你設定的非尖峰時間自行備份,無法設定精確的時間,但可以執行「立即備份」的功能。
試看看 restore 功能,restore 可以馬上執行,一個約 30G 的虛擬機在 30-40 分鐘可以還原成功。還原成功的虛擬機要再注意 ip 是否有跑掉,若有再進入虛擬機 OS 去調整。
初始備份比較久,備份大概也要半小時左右,初始備份有五台機器,只用掉大約 50G 的容量,應該是有用到壓縮技術。
之後的備份是累進式備份,只備份差異點,所以應該省空間與時間。
目前看來五台虛擬機初始備份加上三個禮拜每天備份,用掉大約 80G 的容量。
手動刪除備份點不能馬上執行,需等到離峰時間,VDR 會自動將備份點移除。
vdr 各版本與 vsphere 相容版本表查詢網頁。
vdr 的 vm 最好不要跟 dns 的 vm 放在同一個 esx 伺服器上,以免在 vdr 備份時 cpu 使用過高會影響 dns 的運作,進而也影響了 vdr 的備份工作。
vdr 1.2 版居然在 migrate 到另一個 esx 伺服器的時候丟失了所有的備份記錄,導致需重作各 vm 的備份。
vSphere 4.1 update 1 可更新 vdr 到 2.0 版。下載網址: http://downloads.vmware.com/d/details/vdr20/dHRAYnQld2ViZHBqcA==
vdr 2.0 iso (md5sum:9fd31be3ac0d9f6f07d330107317318a) (sha1sum:37e0f6e3888845d9137a92fe15ab2590fb8ad6db)
以 mac 作 check sum 指令為: openssl md5 /filename 或 openssl sha1 /filename 都可以。
移除 vdr 1.2 安裝 vdr 2.0:
至 vCenter 機器 (windows 2008 r2) 上的「新增、移除程式」中移除 vdr 程式。
至 vClient 上停止 vdr 1.2 的 vm。
至 vClient 上 deploy 新的 ovf 檔案(於 iso 燒成光碟中的 vdr ovf 目錄中),有問時區時選 asia/taipei。設定 hostname (我設為 vdr)
vdr 2.0 的 vm 上顯示 vmware tools 的狀態是 unmanaged 是沒關係的,不用再裝 vmware tools。
至 vClient 上 power on 新的 vdr 2.0 的 vm。
開 console 看開機是否成功,開機完成會有藍底白字畫面。
在 vm 的 console 中按 configuration 以設定此 vdr 的 ip。
在 vm 的 console 中按 login ,以 root 帳號進入,預設密碼是 vmw@re ,接著在 tty 下輸入 passwd 以更改 root 密碼。
有需要可進入 ip:5480 來管理 ip 及相關網卡設定。
至 vCenter 機器 (windows 2008 r2) 上開 vdr 安裝光碟 autorun 程式,並選 install plugin。安裝 vdr plugin 成功後重啟 vClient,即可看到新的 plugin。
可掛載 vdr 1.2 版原先的備份空間,並看到 restore 視窗中有虛擬機的備份,各時間都有,但備份的時間設定則不見,需重設。
可再掛載另一個 cifs 空間,如開設 QNAP NAS 並設定帳號有 quota 500g 的限制(保險起見我設 490g),vdr 2.0 最多只能掛載兩個 cifs 空間。
進入 vdr console 後下指令 ping centos 與 ping centos.domainname.com ,發現打 ping centos 無法解析 ip,而 fqdn 可以解析到 ip。
打開 /etc/resolv.conf 加入一行字: search domainname.com 存檔即可。不用重開服務或重開機。
無法 connect 此 appliance 且亦無法 power on 此虛擬機,並且出現 error: another task is already in progress 錯誤:
進入 vdr 的虛擬機 summary 頁面,看有沒有出現此虛擬機是 move 還是 copy 的問題,選 i copied it。
等 summary 恢復正常頁面後,power on 此虛擬機。
再到 plug-in 頁面進入 vdr appliance 2.0 按 connect 按鈕,即可解決。
若還是無法解決或其他 vm 也出現此狀況,或許可以試試以下 quote 引文的方式,也就是進入 vmware 的 ssh 介面中下 #/sbin/services.sh restart 指令,但我沒嘗試過:
Solving the "Another task is already in progress" error in VMWare ESXi Server
by Albert Tedjadiputra
Hi guys, just wanted to add something here,
I'm using ESXi 4.0, and i was facing the problem of "Another task is already in progress" error, practically the VM could not be used at all (turn on restart or even force off).
in ESXi 4.0 SSH console, using the command "service mgmt-vmware restart" will do no good :-(
therefore the solution is by using: services.sh restart command, quite simple and it doesn't kill the whole VM process which is currently running on production, the only thing that is affected is the VCB backup, it failed when that command issued. Finally in your vCenter console, right click on your ESXi host in which you run the command and then click on reconnect.
hope this can be a blessing for everyone.
Cheers,
Albert
Note: enabling SSH on ESXi
http://www.vm-help.com/esx/esx3i/ESXi_enable_SSH.php
1.
Use SSH to perform service console restart
The restart doesn't affect the working VM in production so it is safe to run this command during busy hours
或此頁面 quoted from http://www.vm-help.com/esx/esx3i/ESXi_enable_SSH.php:
ESXi 3.5 does ship with the ability to run SSH, but this is disabled by default (and is not supported). If you just need to access the console of ESXi, then you only need to perform steps 1 - 3.
1) At the console of the ESXi host, press ALT-F1 to access the console window.
2) Enter unsupported in the console and then press Enter. You will not see the text you type in.
3) If you typed in unsupported correctly, you will see the Tech Support Mode warning and a password prompt. Enter the password for the root login.
4) You should then see the prompt of ~ #. Edit the file inetd.conf (enter the command vi /etc/inetd.conf).
5) Find the line that begins with #ssh and remove the #. Then save the file. If you're new to using vi, then move the cursor down to #ssh line and then press the Insert key. Move the cursor over one space and then hit backspace to delete the #. Then press ESC and type in :wq to save the file and exit vi. If you make a mistake, you can press the ESC key and then type it :q! to quit vi without saving the file.
6) Once you've closed the vi editor, run the command /sbin/services.sh restart to restart the management services. You'll now be able to connect to the ESXi host with a SSH client.
Tip - with some applications like WinSCP, the default encryption cipher used is AES. If you change that to Blowfish you will likely see significantly faster transfers.
Update for ESXi 3.5 Update 2 - With Update 2 the service.sh command no longer restarts the inetd process which enables SSH access. You can either restart your host or run ps | grep inetd to determine the process ID for the inetd process. The output of the command will be something like 1299 1299 busybox inetd, and the process ID is 1299. Then run kill -HUP <process_id> (kill -HUP 1299 in this example) and you'll then be able to access the host via SSH.
You can also download an oem.tgz file which will enable SSH (and FTP). Copy the file to a datastore with the VI client and then to bootbank with the command cp /vmfs/volumes/<datastore>/oem.tgz /bootbank/oem.tgz and then reboot.
備份目的地若有軔體更新(如 QNAP 、 Synology 等 NAS 的更新)會造成 VDR 的備份失敗,可在 VDR 介面中,刪除有問題的備份目的地,再重新加入。
windows 2003 當機也會造成 VDR 備份失敗 (無法製作快照),將 win 2003 的 vm 關機或 power off,然後重開機即可。若要馬上測試,可先按製作快照,沒問題的話, VDR 也會沒問題。
另一個 3948 錯誤,會伴隨 unable to access file unspecified filename since it is locked 的錯誤訊息:
http://communities.vmware.com/thread/393833 說可以 Try creating a new snapshot and after that "Delete all" snapshots. 但新製好的映像上面有 consolidate helper - 0 的映像,且 delete all 後,再重新製作 snapshot 又出現 consolidate helper - 0 映像檔。
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=10051 有提到 lock file 的解法,但似乎不可行。改用下面方法解決。
查了相關文件,http://4sysops.com/archives/vmware-backups-troubleshoot-the-consolidate-helper-0-backup-error/ 有提到應該是兩個 snapshot 的製作同時進行,一個製作導致了 lock file,因而導致此錯誤訊息。
文章提出四種方式解決
vMotion 虛擬機到另一個 host。然後再 delete all snapshot。然後再 create 一個看還會不會出現 consolidate helper -0 映像,且伴隨 lock file 錯誤。
手動作一個 snapshot,再 delete all 映像。
將虛擬機器關機,然後 migrate host and datastore 到另一台機器(host 要改位置、datastore要改位置)。然後 delete all snapshot、再 create a snapshot,看還會不會出現 consolidate helper -0 映像,且伴隨 lock file 錯誤。
將有問題的虛擬機 convert 成一個新的虛擬機,舊的停用或刪除。
如上述,試到第三個方法才解決問題。 先放一天再跑 vdr 看看,沒有問題再放回原來的 host 與 datastore。
3960 error:
Option 2 - Disable VSS application quiescing using VMware Tools (在 windows 2003 server 中):
Open the C:\ProgramData\VMware\VMware Tools\Tools.conf file in a text editor, such as Notepad. If the file does not exist, create it.
Add these lines to the file:
[vmbackup]
vss.disableAppQuiescing = true
Save the file and exit the editor.
Restart the VMware Tools Service for the changes to take effect. Click Start > Run, type services.msc, and click OK.
Right-click the VMware Tools Service and click Restart.
原文引用:
http://www.ntueees.tp.edu.tw/wordpress/?p=1040
機房vm化後限於$$$的關係,datastores未100%建置完成,雖有qnap牌8T供使用,但畢竟不是太高檔貨,2個NIC就想拿來模擬HBA那是異想天開,流量保證讓你有接不完的抱怨電話。因此所有的VMDK就存在DL585 G7本機SAS上,深怕哪天SAS死掉又沒備援HD不知如何是好,所幸VDR可備份在類SAMBA磁碟,至少有「備」無患!
但VDR仍有限制,至少測試上是這樣的,第一個限制是基於校能關係,它「建議」遠端儲存空間不要大於500G,第二個限制是你不可以「同時」備份許多VM,它也會死機,全部error或鎖死給你看。在第二個限制上我認為是最麻煩的一件事,一旦鎖死就必須把VDR看開機。
上圖為標準的error -102 (I/O error),http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1037859
另有最常出現的error -2241 ( Destination index invalid/damaged)http://kb.vmware.com/selfservice/microsites/search.do?cmd=displayKC&docType=kc&docTypeID=DT_KB_1_1&externalId=1018060
若按照上面KB可以解決那最好,事實上我即便是按KB來做一樣無法解決問題,而且問題更是千奇百怪,例如umount磁碟之後仍然可以連線該磁碟,超神奇的是df指令不會列出該磁碟;再例如出錯之後於Configuration下的Destination出現/dev/hdb,/dev/hdc/,dev/hdd,/dev/hde等奇怪磁碟;再來一例是若我將mount進的磁碟(samba)調整大小時,它會另外再多加相同名稱的destinations,而且容量還秀出不同,然後二個destinations會mount在一起,超神奇。無論如何神奇,我最後都重開機解決,login到RDV command並無助於解決我的問題。
最重要的備份不能同時進行,四個vm同時備份還可以,但有出錯的機率,三個vm差不多,你可以用backup job的方式將三個vm同時備份,VDR預設時間都是在在傍晚6時到隔天6時,接著每個job再間隔一小時以免死機。
My backup starts > Create a new snapshot > Few seconds later… the snapshot is removed and get this warning..
Solution:
Edit the VDR machine hostfile and add the ESX + vCenter server hosts by name and ip:
- Open the VDR console: login with Root / vmw@re
- Type: “vi /etc/hosts”
- Add your ESX hosts + name;
- : x to safe your configuration;
Rerun your backup schedule: