VMware免費並且可線上備份(不須關機)的方式,大概就是ghettoVCB.sh最為好用。
以下為我的設定步驟流程,好讓自己不要忘記。
1. 開啟SSH Service
2.下載ghettoVCB.sh
3. ghettoVCB.sh設定備份
4. 防火牆修改
5. 時區修改
6. 設定排程
1. 開啟SSH Service
Configuration → Security Profile → Services → Properties
SSH → Options → Start
SSH 進入系統
登入系統發現時區是UTC,與台灣時區+8不同,可以透過一些方式來改變系統時區
2.下載ghettoVCB.sh
下載路徑如下:
https://github.com/lamw/ghettoVCB
透過Winscp上傳至VMware Host,因為VMware Host 重新開機後會固定把特定檔案恢復,所以我放在我的Local Datastore上,這樣可以避免檔案遺失。
3. ghettoVCB.sh設定備份
設定檔案權限為700
#cd /vmfs/volumes/datastore1/ghettoVCB-master/
#chmod 700 ghettoVCB.sh
#chmod 700 ghettoVCB-restore.sh
我會修改到的檔案內容如下: (其實還很多參數可以調整,這邊是紀錄我自己常用的)
#vi /vmfs/volumes/datastore1/ghettoVCB-master/ghettoVCB.sh
測試備份
Usage: ghettoVCB.sh [options]
OPTIONS:
-a Backup all VMs on host (全部備份)
-f List of VMs to backup (指定List 檔案備份)
-m Name of VM to backup (overrides -f) (指定VMware 名稱備份)
-c VM configuration directory for VM backups
-g Path to global ghettoVCB configuration file
-l File to output logging (log 外倒預設在/tmp/)
-w ghettoVCB work directory (default: /tmp/ghettoVCB.work)
-d Debug level [info|debug|dryrun] (default: info) (測試備份)
目前有一台Guest OS在這台Host 上
#esxcli vm process list
test2008
World ID: 10758
Process ID: 0
VMX Cartel ID: 10757
UUID: 42 03 44 5b 8d 93 9e ea-4e 7d 33 0b 94 8a b6 e8
Display Name: test2008
Config File: /vmfs/volumes/51ad5de7-376d0ac1-1adc-001b21af457e/test2008/test2008.vmx
執行測試備份
#/vmfs/volumes/datastore1/ghettoVCB-master/ghettoVCB.sh -d dryrun -m test2008
Logging output to “/tmp/ghettoVCB-2013-07-26_06-33-33-11099.log” …
2013-07-26 06:33:34 — info: ============================== ghettoVCB LOG START ==============================
2013-07-26 06:33:34 — info: CONFIG – VERSION = 2013_01_11_0
2013-07-26 06:33:34 — info: CONFIG – GHETTOVCB_PID = 11099
2013-07-26 06:33:34 — info: CONFIG – VM_BACKUP_VOLUME = /vmfs/volumes/XXXXXXXXX
2013-07-26 06:33:34 — info: CONFIG – VM_BACKUP_ROTATION_COUNT = 3
2013-07-26 06:33:34 — info: CONFIG – VM_BACKUP_DIR_NAMING_CONVENTION = 2013-07-26_06-33-33
2013-07-26 06:33:34 — info: CONFIG – DISK_BACKUP_FORMAT = thin
2013-07-26 06:33:34 — info: CONFIG – POWER_VM_DOWN_BEFORE_BACKUP = 0
2013-07-26 06:33:34 — info: CONFIG – ENABLE_HARD_POWER_OFF = 0
2013-07-26 06:33:34 — info: CONFIG – ITER_TO_WAIT_SHUTDOWN = 3
2013-07-26 06:33:34 — info: CONFIG – POWER_DOWN_TIMEOUT = 5
2013-07-26 06:33:34 — info: CONFIG – SNAPSHOT_TIMEOUT = 15
2013-07-26 06:33:34 — info: CONFIG – LOG_LEVEL = dryrun
2013-07-26 06:33:34 — info: CONFIG – BACKUP_LOG_OUTPUT = /tmp/ghettoVCB-2013-07-26_06-33-33-11099.log
2013-07-26 06:33:34 — info: CONFIG – ENABLE_COMPRESSION = 0
2013-07-26 06:33:34 — info: CONFIG – VM_SNAPSHOT_MEMORY = 0
2013-07-26 06:33:34 — info: CONFIG – VM_SNAPSHOT_QUIESCE = 0
2013-07-26 06:33:34 — info: CONFIG – ALLOW_VMS_WITH_SNAPSHOTS_TO_BE_BACKEDUP = 0
2013-07-26 06:33:34 — info: CONFIG – VMDK_FILES_TO_BACKUP = all
2013-07-26 06:33:34 — info: CONFIG – VM_SHUTDOWN_ORDER =
2013-07-26 06:33:34 — info: CONFIG – VM_STARTUP_ORDER =
2013-07-26 06:33:34 — info: CONFIG – EMAIL_LOG = 1
2013-07-26 06:33:34 — info: CONFIG – EMAIL_SERVER = XXXXXXXXXXXXXXXX
2013-07-26 06:33:34 — info: CONFIG – EMAIL_SERVER_PORT = 25
2013-07-26 06:33:34 — info: CONFIG – EMAIL_DELAY_INTERVAL = 1
2013-07-26 06:33:34 — info: CONFIG – EMAIL_FROM = XXXXXXXXXXXXXXXXX
2013-07-26 06:33:34 — info: CONFIG – EMAIL_TO =XXXXXXXXXXXXXXX
2013-07-26 06:33:34 — info: CONFIG – WORKDIR_DEBUG = 0
2013-07-26 06:33:34 — info:
2013-07-26 06:33:34 — dryrun: ###############################################
2013-07-26 06:33:34 — dryrun: Virtual Machine: test2008
2013-07-26 06:33:34 — dryrun: VM_ID: 1
2013-07-26 06:33:34 — dryrun: VMX_PATH: /vmfs/volumes/test2008/test2008.vmx
2013-07-26 06:33:34 — dryrun: VMX_DIR: /vmfs/volumes/test2008
2013-07-26 06:33:34 — dryrun: VMX_CONF: test2008/test2008.vmx
2013-07-26 06:33:34 — dryrun: VMFS_VOLUME: XXXXXX
2013-07-26 06:33:34 — dryrun: VMDK(s):
2013-07-26 06:33:34 — dryrun: test2008-000001.vmdk 40 GB
2013-07-26 06:33:34 — dryrun: INDEPENDENT VMDK(s):
2013-07-26 06:33:34 — dryrun: TOTAL_VM_SIZE_TO_BACKUP: 40 GB
2013-07-26 06:33:34 — dryrun: Snapshots found for this VM, please commit all snapshots before continuing!
2013-07-26 06:33:34 — dryrun: THIS VIRTUAL MACHINE WILL NOT BE BACKED UP DUE TO EXISTING SNAPSHOTS!
2013-07-26 06:33:34 — dryrun: ###############################################
2013-07-26 06:33:34 — info: ###### Final status: OK, only a dryrun. ######
2013-07-26 06:33:34 — info: ============================== ghettoVCB LOG END ================================
#chmod 644 /etc/vmware/firewall/service.xml
#chmod +t /etc/vmware/firewall/service.xml
#vi /etc/vmware/firewall/service.xml
#chmod 444 /etc/vmware/firewall/service.xml
#vi /vmfs/volumes/datastore1/ghettoVCB-master/time.sh
*******************************************************************
#!/bin/shcp /vmfs/volumes/datastore1/ghettoVCB-master/localtime /etc/localtime*******************************************************************#chmod 755 /vmfs/volumes/datastore1/ghettoVCB-master/time.sh
/vmfs/volumes/datastore1/ghettoVCB-master/time.sh
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1436