宜蘭縣教育支援平台 會員登入 會員註冊 我的i教書

« 上一篇 | 下一篇 »

參考網站:
ghettoVCB 還原 ESXI Guest OS

1. VM 備份檔的位置


2. 刪除 VM







3. 建立要還原的 VM 虛擬機器清單
[root@esxi:~]  vi /vmfs/volumes/ST500G/vm_to_restore.lst
# DISK_FORMATS
# 1 = zeroedthick  (一次給足全部的硬碟大小,需要時才初使化未使用的空間)
# 2 = 2gbsparse  (將硬碟分割成多個 2G 的硬碟)
# 3 = thin  (隨著使用量而增加硬碟大小,達到設定上限時就不會在增加)
# 4 = eagerzeroedthick  (一次給足全部的硬碟大小,全部初始化可直接使用)
# 格式,以 ; 做分隔
# "VM 備份檔所在的完整路徑;還原後的 VM 要存放的完整路徑;還原時硬碟的格式"

"/vmfs/volumes/SynologyNAS/CentOS 7 Base/CentOS 7 Base-2017-04-05_12-33-10;/vmfs/volumes/ST500G;3"

4. 進行復原
[root@esxi:~] /opt/ghettovcb/bin/ghettoVCB-restore.sh -c /vmfs/volumes/ST500G/vm_to_restore.lst -l /vmfs/volumes/ST500G/ghettoVCB_log/ghettoVCB-restore.$(date +%F)

################## Restoring VM: CentOS 7 Base  #####################
Start time: Wed Apr  5 23:40:28 CST 2017
Restoring VM from: "/vmfs/volumes/SynologyNAS/CentOS 7 Base/CentOS 7 Base-2017-04-05_12-33-10"
Restoring VM to Datastore: "/vmfs/volumes/ST500G" using Disk Format: "thin"
Creating VM directory: "/vmfs/volumes/ST500G/CentOS 7 Base" ...
Copying "CentOS 7 Base.vmx" file ...
Restoring VM's VMDK(s) ...
Updating VMDK entry in "CentOS 7 Base.vmx" file ...
Option --adaptertype is deprecated and hence will be ignored
Destination disk format: VMFS thin-provisioned
Cloning disk '/vmfs/volumes/SynologyNAS/CentOS 7 Base/CentOS 7 Base-2017-04-05_12-33-10/CentOS 7 Base_0.vmdk'...
Clone: 100% done.
Registering CentOS 7 Base ...
33
End time: Thu Apr  6 00:04:58 CST 2017
################## Completed restore for CentOS 7 Base! #####################


Start time: Wed Apr  5 23:40:28 CST 2017
End   time: Thu Apr  6 00:04:58 CST 2017
Duration  : 24.50 Minutes


---------------------------------------------------------------------------------------------------------------

5. 更多 ghettoVCB-restore.sh 指令用法
[root@esxi:~]  /opt/ghettovcb/bin/ghettoVCB-restore.sh
###############################################################################
#
# ghettoVCB-restore for ESX/ESXi 3.5, 4.x, 5.x & 6.x
# Author: William Lam
# http://www.virtuallyghetto.com/
# Documentation: http://communities.vmware.com/docs/DOC-8760
# Created: 08/18/2009
# Last modified: 2015_04_04_1
#
###############################################################################

Usage: /opt/ghettovcb/bin/ghettoVCB-restore.sh -c [VM_BACKUP_UP_LIST] -l [LOG_FILE] -d [DRYRUN_DEBUG_INFO]

OPTIONS:
   -c     VM backup list
   -l     File ot output logging
   -d     Dryrun/Debug Info [1|2]

(e.g.)

Output will go to stdout
        /opt/ghettovcb/bin/ghettoVCB-restore.sh -c vms_to_restore

Output will log to /tmp/ghettoVCB-restore.log
        /opt/ghettovcb/bin/ghettoVCB-restore.sh -c vms_to_restore -l /tmp/ghettoVCB-restore.log

Dryrun/Debug Info (dryrun only)
        /opt/ghettovcb/bin/ghettoVCB-restore.sh -c vms_to_restore -d 1
        /opt/ghettovcb/bin/ghettoVCB-restore.sh -c vms_to_restore -d 2

如果你的網誌不支援引用網址自動搜尋功能,那麼你可以使用下列的直接引用網址來引用本文章:

http://blog.ilc.edu.tw/blog/trackback.php?id=690492