查看完整版本: [轉貼]VMware esxi 備份還原ghettoVCB-restore.sh 設定說明

chun 2012-6-19 16:20

[轉貼]VMware esxi 備份還原ghettoVCB-restore.sh 設定說明

<a href="http://blog.faq-book.com/?p=4269">http://blog.faq-book.com/?p=4269</a>
<div><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span style="font-family: 細明體; ">一、 介紹<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span style="font-family: 細明體; ">此腳本主要是用來還原虛擬機的備份。也屬於<span lang="EN-US"><a href="http://blog.faq-book.com/?p=3980" style="outline: none; border: none; color: rgb(63, 138, 216); text-decoration: none; ">ghettoVCB</a></span>中的一部份。<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span style="font-family: 細明體; ">在這個腳本中支持兩個主要的用途<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US">1.&nbsp;</span><span style="font-family: 細明體; ">恢復一個備份的<span lang="EN-US">VM</span>包含所有在這個資料儲存區的<span lang="EN-US">VMDKs<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US">2.&nbsp;</span><span style="font-family: 細明體; ">恢復多個儲存於資料儲存區的備份的<span lang="EN-US">VM</span>,包含所有在這個資料儲存區的<span lang="EN-US">VMDKs<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span style="color: rgb(255, 0, 0); "><span style="font-family: 細明體; ">使用腳本時先注意,該還原目地有足夠的空間,然後在嘗試還原。以避免問題的產生。</span></span><span style="color: rgb(255, 0, 0); font-family: 細明體; ">支持的還原格式<span lang="EN-US">:</span></span><span lang="EN-US" style="color: rgb(255, 0, 0); "></span><span lang="EN-US" style="color: rgb(255, 0, 0); font-family: 細明體; ">zeroedthick(default behavior)</span><span style="color: rgb(255, 0, 0); font-family: 細明體; ">、<span lang="EN-US">2gbsparse</span>、<span lang="EN-US">thin</span>、<span lang="EN-US">eagerzeroedthick</span>。</span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span style="font-family: 細明體; ">使用需求<span lang="EN-US">:<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span style="font-family: 細明體; ">需使用<span lang="EN-US">ghettoVCB.sh</span>備份<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US">ESX(i) 3.5</span><span style="font-family: 細明體; ">、<span lang="EN-US">4</span>或<span lang="EN-US">5.x<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span style="font-family: 細明體; ">能<span lang="EN-US">SSH</span>連線訪問的到該台主機<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span style="font-family: 細明體; ">詳細內容可參考</span><span lang="EN-US">:&nbsp;<a href="http://communities.vmware.com/docs/DOC-8760" style="outline: none; border: none; color: rgb(63, 138, 216); text-decoration: none; ">VMware<span lang="EN-US"><span lang="EN-US">官網<span lang="EN-US">–ghettoVCB-restore.sh</span></span></span></a><o:p></o:p></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span style="font-family: 細明體; ">二、&nbsp;<span lang="EN-US">ghettoVCB-restore.sh&nbsp;</span>設定說明<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span style="font-family: 細明體; ">首先,先下載<span lang="EN-US"><a href="https://github.com/lamw/ghettoVCB/downloads" style="outline: none; border: none; color: rgb(63, 138, 216); text-decoration: none; ">ghettoVCB-restore</a></span>,然後上傳到要還原的該台主機上,若不知怎麼上傳的人可以參考<span lang="EN-US"><a href="http://blog.faq-book.com/?p=3980" style="outline: none; border: none; color: rgb(63, 138, 216); text-decoration: none; "><span lang="EN-US"><span lang="EN-US">此篇</span></span></a></span>的前半部<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US">1.&nbsp;</span><span style="font-family: 細明體; ">解壓縮上傳的資料<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span style="font-family: 細明體; ">解壓縮後會看到<span lang="EN-US">ghettoVCB-restore.sh</span>該檔。此檔案就是用來將備份的<span lang="EN-US">VM</span>還原使用。<span lang="EN-US"><o:p></o:p></span></span></p><br style="color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" width="595" style="margin: 1em 0px 1em 8.45pt; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; width: 446.55pt; background-color: black; border: none; "><tbody><tr><td width="595" style="width: 446.55pt; border: 1pt inset; "><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">~ #&nbsp;</span></span><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; color: yellow; ">tar -zxvf lamw-ghettoVCB-518cef7.tar.gz</span></span><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; color: white; "><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">tar: warning: skipping header 'g'<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">lamw-ghettoVCB-518cef7/<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">lamw-ghettoVCB-518cef7/README<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">lamw-ghettoVCB-518cef7/ghettoVCB-restore.sh<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">lamw-ghettoVCB-518cef7/ghettoVCB-restore_vm_restore_configuration_template<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">lamw-ghettoVCB-518cef7/ghettoVCB-vm_backup_configuration_template<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">lamw-ghettoVCB-518cef7/ghettoVCB.conf<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">lamw-ghettoVCB-518cef7/ghettoVCB.sh<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">~ #&nbsp;</span></span><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; color: yellow; ">cd lamw-ghettoVCB-518cef7<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">~ #&nbsp;</span></span><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; color: yellow; ">ls</span></span><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ghettoVCB-vm_backup_configuration_template&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; README<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: yellow; ">ghettoVCB-restore.sh</span></span><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; color: white; ">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ghettoVCB.conf<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">ghettoVCB-restore_vm_restore_configuration_template&nbsp; ghettoVCB.sh</span></span><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; "><o:p></o:p></span></p></td></tr></tbody></table><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span id="more-4269"></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); ">&nbsp;</p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US" style="font-family: 細明體; ">2.&nbsp;</span><span style="font-family: 細明體; ">查看<span lang="EN-US">ghettoVCB-restore.sh</span>使用到的參數</span></p><br style="color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" width="595" style="margin: 1em 0px 1em 8.45pt; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; width: 446.55pt; background-color: black; border: none; "><tbody><tr><td width="595" style="width: 446.55pt; border: 1pt inset; "><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">~ #&nbsp;</span></span><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; color: yellow; ">./ghettoVCB-restore.sh<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">###############################################################################<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">#<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; "># ghettoVCB-restore for ESX/ESXi 3.5, 4.x+ and 5.0<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; "># Author: William Lam<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; "># http://www.virtuallyghetto.com/<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; "># Documentation: http://communities.vmware.com/docs/DOC-8760<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; "># Created: 08/18/2009<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; "># Last modified: 2011_11_19_1<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">#<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">###############################################################################<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">&nbsp;</span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">Usage: ./ghettoVCB-restore.sh -c [VM_BACKUP_UP_LIST] -l [LOG_FILE] -d [DRYRUN_DEBUG_INFO]<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">&nbsp;</span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">OPTIONS:<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">&nbsp;&nbsp; -c&nbsp;&nbsp;&nbsp;&nbsp; VM backup list</span></span><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: yellow; ">&nbsp;</span></span><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; color: red; ">(</span></span><span class="apple-style-span"><span style="font-size: 10pt; font-family: 細明體; color: red; ">要還原備份的列表<span lang="EN-US">)<o:p></o:p></span></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">&nbsp;&nbsp; -l&nbsp;&nbsp;&nbsp;&nbsp; File ot output logging&nbsp;</span></span><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: red; ">&nbsp;(</span></span><span class="apple-style-span"><span style="font-size: 10pt; font-family: 細明體; color: red; ">指定<span lang="EN-US">LOG</span>所要儲存的路徑<span lang="EN-US">)<o:p></o:p></span></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">&nbsp;&nbsp; -d&nbsp;&nbsp;&nbsp;&nbsp; Dryrun/Debug Info [1|2]</span></span><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: yellow; ">&nbsp;</span></span><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; color: red; ">(</span></span><span class="apple-style-span"><span style="font-size: 10pt; font-family: 細明體; color: red; ">可用來測試或是<span lang="EN-US">Debug</span>還原看是否有誤<span lang="EN-US">)</span></span></span><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: yellow; "><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">&nbsp;</span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">(e.g.)<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">&nbsp;</span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">Output will go to stdout<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">&nbsp;&nbsp;&nbsp;&nbsp; ./ghettoVCB-restore.sh -c vms_to_restore<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">&nbsp;</span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">Output will log to /tmp/ghettoVCB-restore.log<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">&nbsp;&nbsp;&nbsp;&nbsp; ./ghettoVCB-restore.sh -c vms_to_restore -l /tmp/ghettoVCB-restore.log<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">&nbsp;</span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">Dryrun/Debug Info (dryrun only)<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">&nbsp;&nbsp;&nbsp;&nbsp; ./ghettoVCB-restore.sh -c vms_to_restore -d 1<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">&nbsp;&nbsp;&nbsp;&nbsp; ./ghettoVCB-restore.sh -c vms_to_restore -d 2</span></span><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; "><o:p></o:p></span></p></td></tr></tbody></table><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US">&nbsp;</span><span style="font-family: 細明體; ">&nbsp;</span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US">3.&nbsp;</span><span style="font-family: 細明體; ">建立還原使用的<span lang="EN-US">list<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span style="font-family: 細明體; ">要建立此<span lang="EN-US">list</span>主要是讓在還原的時後比較方便。然而在這一份<span lang="EN-US">list</span>中有幾點要注意的。<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US">(1) VM</span><span style="font-family: 細明體; ">備份檔所在地的完整路徑。<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US">(2)&nbsp;</span><span style="font-family: 細明體; ">恢復後的<span lang="EN-US">VM</span>要存放的完整路徑<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US">(3)&nbsp;</span><span style="font-family: 細明體; ">設定恢復硬碟的格式<span lang="EN-US">&nbsp;(</span>格式不懂的可以參考<span lang="EN-US"><a href="http://blog.faq-book.com/?p=4043" style="outline: none; border: none; color: rgb(63, 138, 216); text-decoration: none; ">VMware ESX(i)<span lang="EN-US"><span lang="EN-US">虛擬磁碟格式介紹</span></span></a>)<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span style="font-family: 細明體; ">格式代號<span lang="EN-US">&nbsp;&nbsp;&nbsp;&nbsp;</span>格式名稱<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;1 = zeroedthick<o:p></o:p></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;2 = 2gbsparse<o:p></o:p></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;3 = thin<o:p></o:p></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;4 = eagerzeroedthick<o:p></o:p></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US">(4)&nbsp;</span><span style="font-family: 細明體; ">此<span lang="EN-US">list</span>請使用在<span lang="EN-US">ESX</span>或<span lang="EN-US">ESX(i)</span>主機上。請勿用在<span lang="EN-US">non-Linux/UNIX</span>系統上,避免特殊符號影響導致腳本錯誤。<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span style="font-family: 細明體; ">以下是<span lang="EN-US">list</span>的範例,還請之後依照各人而設定。<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span style="font-family: 細明體; ">在<span lang="EN-US">list</span>裡可以直接把硬碟的格式代號也加入,方便日後查詢。不過要記得<span lang="EN-US">#</span>才不會影響到腳本。<span lang="EN-US"><o:p></o:p></span></span></p><br style="color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" width="595" style="margin: 1em 0px 1em 8.45pt; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; width: 446.55pt; background-color: black; border: none; "><tbody><tr><td width="595" style="width: 446.55pt; border: 1pt inset; "><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">~ #&nbsp;</span></span><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; color: yellow; ">vi vms_to_restore<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span style="color: rgb(255, 255, 255); "><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; "># DISK_FORMATS</span></span><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; "><o:p></o:p></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span style="color: rgb(255, 255, 255); "><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; "># 1 = zeroedthick</span></span><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; "><o:p></o:p></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span style="color: rgb(255, 255, 255); "><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; "># 2 = 2gbsparse</span></span><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; "><o:p></o:p></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span style="color: rgb(255, 255, 255); "><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; "># 3 = thin</span></span><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; "><o:p></o:p></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span style="color: rgb(255, 255, 255); "><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; "># 4 = eagerzeroedthick</span></span><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; "><o:p></o:p></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span style="color: rgb(255, 255, 255); "><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; "># e.g.</span></span><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; "><o:p></o:p></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; ">&nbsp;</span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span style="color: rgb(255, 255, 0); "><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; ">"/vmfs/volumes/datastore1/backup/backup/test/test-2012-01-11_23-48-35;/vmfs/volumes/datastore1;4"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span></span><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; "><o:p></o:p></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span style="color: rgb(255, 0, 0); "><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; ">#"VM</span><span style="font-size: 10pt; font-family: 細明體; ">備份檔所在地的完整路徑<span lang="EN-US">;</span>恢復後的<span lang="EN-US">VM</span>要存放的完整路徑<span lang="EN-US">;</span>恢復硬碟的格式&nbsp;<span lang="EN-US">"</span></span></span><span style="font-size: 10pt; font-family: 細明體; "><span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span style="color: rgb(255, 0, 0); "><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; ">#</span><span style="font-size: 10pt; font-family: 細明體; ">在這邊要注意一下是「<span lang="EN-US">;</span>」而不是「<span lang="EN-US">:</span>」</span></span><span style="font-size: 10pt; font-family: 細明體; color: red; "><span lang="EN-US"><o:p></o:p></span></span></p></td></tr></tbody></table><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US" style="font-family: 細明體; ">4.&nbsp;</span><span style="font-family: 細明體; ">測試<span lang="EN-US">Dryrun/Debug<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span style="font-family: 細明體; ">設定好<span lang="EN-US">vms_to_restore</span>後,可以使用<span lang="EN-US">Dryrun/Debug</span>來測試看看腳本和<span lang="EN-US">vms_to_restore</span>是否有問題。<span lang="EN-US"><o:p></o:p></span></span></p><br style="color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" width="595" style="margin: 1em 0px 1em 8.45pt; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; width: 446.55pt; background-color: black; border: none; "><tbody><tr><td width="595" style="width: 446.55pt; border: 1pt inset; "><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">Dryrun/Debug Info [1|2]<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">&nbsp;</span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">Dryrun:<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">~ #&nbsp;</span></span><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; color: yellow; ">./ghettoVCB-restore.sh -c vms_to_restore -d 1<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">&nbsp;</span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">Debug:<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">~ #&nbsp;</span></span><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; color: yellow; ">./ghettoVCB-restore.sh -c vms_to_restore -d 2</span></span><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: yellow; "><o:p></o:p></span></p></td></tr></tbody></table><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US">5.&nbsp;</span><span style="font-family: 細明體; ">還原備份<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span style="font-family: 細明體; ">要還原備份時請使用參數「<span lang="EN-US">-c</span>」然後接<span lang="EN-US">vms_to_restore</span>也就是剛剛所建的<span lang="EN-US">list<o:p></o:p></span></span></p><br style="color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" width="595" style="margin: 1em 0px 1em 8.45pt; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; width: 446.55pt; background-color: black; border: none; "><tbody><tr><td width="595" style="width: 446.55pt; border: 1pt inset; "><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">~ #&nbsp;</span></span><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; color: yellow; ">./ghettoVCB-restore.sh -c vms_to_restore<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">################## Restoring VM: test&nbsp; #####################<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">Start time: Wed Jan 11 23:52:11 UTC 2012<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">Restoring VM from: "/vmfs/volumes/datastore1/backup/backup/test/test-2012-01-11_23-48-35"<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">Restoring VM to Datastore: "/vmfs/volumes/datastore1" using Disk Format: "eagerzeroedthick"<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">Creating VM directory: "/vmfs/volumes/datastore1/test-2012-01-11_23-48-35" …<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">Copying "test.vmx" file …<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">Restoring VM's VMDK(s) …<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">Updating VMDK entry in "test.vmx" file …<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">Destination disk format: VMFS eagerzeroedthick<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">Cloning disk '/vmfs/volumes/datastore1/backup/backup/test/test-2012-01-11_23-48-35/test.vmdk'…<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">Clone: 100% done.<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">Registering test …<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">23<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">End time: Wed Jan 11 23:52:29 UTC 2012<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">################## Completed restore for test! #####################<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">&nbsp;</span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">&nbsp;</span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">Start time: Wed Jan 11 23:52:11 UTC 2012<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">End&nbsp;&nbsp; time: Wed Jan 11 23:52:29 UTC 2012<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">Duration&nbsp; : 18 Seconds<o:p></o:p></span></span></p></td></tr></tbody></table><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span style="font-family: 細明體; ">還原完成後開啟<span lang="EN-US">VMware vSphere Client</span>會看到剛剛所還原回去的<span lang="EN-US">VM</span>已經自己掛上了。<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span style="font-family: 細明體; ">接下來就可以開啟<span lang="EN-US">VM</span>後測試看試否有問題。<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><a href="http://blog.faq-book.com/wp-content/uploads/image/VMware/VMware%20esxi%20-ghettoVCB-restore.sh/1.jpg" style="outline: none; border: none; color: rgb(63, 138, 216); text-decoration: none; "><img alt="" height="189" src="http://blog.faq-book.com/wp-content/uploads/image/VMware/VMware%20esxi%20-ghettoVCB-restore.sh/1.jpg" width="452" style="border: 1px solid rgb(204, 204, 204); padding: 6px; "></a></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US">6.&nbsp;</span><span style="font-family: 細明體; ">備份<span lang="EN-US">log</span>設定<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span style="font-family: 細明體; ">如果要設定<span lang="EN-US">log</span>的話,會建議把<span lang="EN-US">log</span>存在不會因重開機,而刪檔的地方吧。<span lang="EN-US"><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span style="font-family: 細明體; ">若只是要測試的話就放在<span lang="EN-US">/tmp</span>下就可以了。<span lang="EN-US"><o:p></o:p></span></span></p><br style="color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><table border="1" cellpadding="0" cellspacing="0" class="MsoNormalTable" width="595" style="margin: 1em 0px 1em 8.45pt; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; width: 446.55pt; background-color: black; border: none; "><tbody><tr><td width="595" style="width: 446.55pt; border: 1pt inset; "><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span style="color: rgb(255, 0, 0); "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; ">#</span></span><span class="apple-style-span"><span style="font-size: 10pt; font-family: 細明體; ">還原備份並設定<span lang="EN-US">LOG</span>存放處</span></span></span><span class="apple-style-span"><span style="font-size: 10pt; font-family: 細明體; "><span lang="EN-US"><o:p></o:p></span></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">~ #&nbsp;</span></span><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; color: yellow; ">./ghettoVCB-restore.sh -c vms_to_restore -l /tmp/ghettoVCB-restore.log<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">Logging output to "/tmp/ghettoVCB-restore.log" …<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">Destination disk format: VMFS eagerzeroedthick<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">Cloning disk '/vmfs/volumes/datastore1/backup/backup/test/test-2012-01-11_23-48-35/test.vmdk'…<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">Clone: 100% done.<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">24<o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">&nbsp;</span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span style="color: rgb(255, 0, 0); "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; ">#</span></span><span class="apple-style-span"><span style="font-size: 10pt; font-family: 細明體; ">備份完成,到<span lang="EN-US">tmp</span>查看<span lang="EN-US">log</span></span></span></span><span class="apple-style-span"><span style="font-size: 10pt; font-family: 細明體; "><span lang="EN-US"><o:p></o:p></span></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: white; ">~ #&nbsp;</span></span><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; color: yellow; ">cat /tmp/ghettoVCB-restore.log</span></span><span class="apple-style-span"><span lang="EN-US" style="font-size: 10pt; color: white; "><o:p></o:p></span></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span style="color: rgb(255, 255, 255); "><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; ">Destination disk format: VMFS eagerzeroedthick</span></span><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; "><o:p></o:p></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span style="color: rgb(255, 255, 255); "><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; ">Cloning disk '/vmfs/volumes/datastore1/backup/backup/test/test-2012-01-11_23-48-35/test.vmdk'…</span></span><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; "><o:p></o:p></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span style="color: rgb(255, 255, 255); "><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; ">Clone: 100% done.</span></span><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; "><o:p></o:p></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span style="color: rgb(255, 255, 255); "><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; ">Registering test …</span></span><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; "><o:p></o:p></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span style="color: rgb(255, 255, 255); "><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; ">End time: Thu Jan 12 00:05:47 UTC 2012</span></span><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; "><o:p></o:p></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span style="color: rgb(255, 255, 255); "><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; ">################## Completed restore for test! #####################</span></span><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; "><o:p></o:p></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span style="color: rgb(255, 255, 255); "><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; ">&nbsp;</span></span><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; "><o:p></o:p></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span style="color: rgb(255, 255, 255); "><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; ">&nbsp;</span></span><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; "><o:p></o:p></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span style="color: rgb(255, 255, 255); "><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; ">Start time: Thu Jan 12 00:05:30 UTC 2012</span></span><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; "><o:p></o:p></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span style="color: rgb(255, 255, 255); "><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; ">End&nbsp;&nbsp; time: Thu Jan 12 00:05:47 UTC 2012</span></span><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; "><o:p></o:p></span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 593px; clear: both; "><span style="color: rgb(255, 255, 255); "><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; ">Duration&nbsp; : 17 Seconds</span></span><span lang="EN-US" style="font-size: 10pt; font-family: 細明體; color: yellow; "><o:p></o:p></span></p></td></tr></tbody></table><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span lang="EN-US">&nbsp;</span></p><p class="MsoNormal" style="margin-top: 1em; margin-bottom: 1em; width: 658px; clear: both; color: rgb(102, 102, 102); font-family: 'Lucida Grande', 'Lucida Sans Unicode', 'Lucida Sans', sans-serif; font-size: 13px; line-height: 23px; text-align: -webkit-auto; background-color: rgb(231, 231, 231); "><span style="font-family: 細明體; ">到這邊備份還原的部份就<span lang="EN-US">ok</span>了</span></p></div>
頁: [1]
查看完整版本: [轉貼]VMware esxi 備份還原ghettoVCB-restore.sh 設定說明