• slider image 168
:::
條列式新聞
新聞載入中,請稍後...

7-3-2-2 差異性備份-非官方-不建議使用

https://ayufan.eu/projects/proxmox-ve-differential-backups/

ayufan's site

Proxmox VE differential backups

Posted on Jan 22, 2016

Proxmox VE是服務器一個完整的虛擬化管理解決方案。可以虛擬化甚至在Linux和Windows服務器上運行要求最苛刻的應用程序工作負載。

由於缺乏更好的備份功能,我在 Proxmox VE 準備補丁以支持差異性備份。這些補丁已經使用了一年多。

這個外掛程式?

我的外掛延伸vzdump,xdelta3和Web GUI支持。是的,這些外掛完全支持的OpenVZ和KVM。

系統管理員可以使用備份作業一個額外的參數(數據中心 - >備份 - >添加/編輯)完全備份間隔:

  • 默認情況下此值設置為0,它的作用是:使用舊的行為(總是創建完整備份)。

  • 但是,如果你指定的值大於0,例如7.將指示vzdump創建完整備份每週一次和使用差異的休息。

請參考下面的例子:

    vzdump 101 --remove 0 --mode snapshot --compress lzo --storage local --node pve2 --fullbackup 4

它將創建VM101的全備份,每4天,使用LZO,存儲在本地存儲壓縮。

    vzdump 101 --remove 0 --mode snapshot --compress gzip --storage PVE2 --node pve2 --fullbackup 7

它將創建VM101的全備份,每7天,使用 gzip,存儲在  PVE2  的 Storage 存儲壓縮。

 

PS:要注意的是 local 或是 PVE2 等這些 Storage 裡存放 VZDUMP 備份的位置,Max Backupds 不能設定為1,必須為2以上。

 

如何安裝?

有三個文件:

    c760d7481beae8dba3c62f1d95c6fbde  pve-2.2-diff-backup-addon
    42c1a0f34eca9ac23de83523db00f6c5  pve-2.3-diff-backup-addon
    1292670afa84914aac4ebda59d2a7122  pve-3.0-diff-backup-addon
    cd68c203bb1804105a3b4acd52382f6d  pve-3.1-diff-backup-addon
    67fb4d2b397759fb83066ae93cc07b78  pve-3.2-diff-backup-addon
    3e095bd0ed5744a545016018e235fa27  pve-3.3-diff-backup-addon
    350ed7844a5802ca114a6b60e0b013dc  pve-3.4-diff-backup-addon
    1657dbc46d9f8b379896a9c0a7dffc3e  pve-4.0-diff-backup-addon
    e5701606733fb10dc117ff2b008da11b  pve-4.1-diff-backup-addon

安裝過程非常簡單:

  1. 先登入 Proxmox 主機後,並以 root 身份 下載:

    For PVE 2.2 (棄用/不建議):

    wget http://ayufan.eu/projects/proxmox-ve-differential-backups/pve-2.2-diff-backup-addon
    

    For PVE 2.3 (棄用/不建議):

    wget http://ayufan.eu/projects/proxmox-ve-differential-backups/pve-2.3-diff-backup-addon
    

    For PVE 3.0 (棄用/不建議):

    wget http://ayufan.eu/projects/proxmox-ve-differential-backups/pve-3.0-diff-backup-addon
    

    For PVE 3.1 (棄用/不建議):

    wget http://ayufan.eu/projects/proxmox-ve-differential-backups/pve-3.1-diff-backup-addon
    

    For PVE 3.2 (棄用/不建議):

    wget http://ayufan.eu/projects/proxmox-ve-differential-backups/pve-3.2-diff-backup-addon
    

    For PVE 3.3 (棄用/不建議):

    wget http://ayufan.eu/projects/proxmox-ve-differential-backups/pve-3.3-diff-backup-addon
    

    For PVE 3.4 (舊版本):

    wget http://ayufan.eu/projects/proxmox-ve-differential-backups/pve-3.4-diff-backup-addon
    

    For PVE 4.0 (現在的版本):

    wget http://ayufan.eu/projects/proxmox-ve-differential-backups/pve-4.0-diff-backup-addon
    

    For PVE 4.1 (測試版):

    wget http://ayufan.eu/projects/proxmox-ve-differential-backups/pve-4.0-diff-backup-addon
    
  2. 執行bash腳本。該腳本包含所有所需的修補程序:

    bash pve-4.1-diff-backup-addon apply
    
  3. 當一切都正確,你會看到:

    Proxmox VE 4.1 - differential backup support  
    Kamil Trzcinski, http://ayufan.eu/, ayufan@ayufan.eu
    
    PATCHED: /usr/share/pve-manager/  
    PATCHED: /usr/share/perl5/PVE/
    
    Restarting PVE API Proxy Server: pveproxy. 
    Restarting PVE Daemon: pvedaemon.
    
  4. 下載並安裝xdelta3。如果你想使用LZO壓縮,你必須下載我xdelta3編譯。

    wget http://ayufan.eu/projects/proxmox-ve-differential-backups/pve-xdelta3_3.0.6-1_amd64.deb  
    dpkg -i pve-xdelta3_3.0.6-1_amd64.deb
    

    不過,如果你偏執安裝不受信任的應用程序,可以自己編譯的包。所有源代碼可以在這裡找到:PVE-xdelta3-master.tar.bz2

    xdelta以前的版本是3.0.5。請升級到較新的一項:3.0.6。

如何移除這個外掛?

移除的過程比安裝簡單。鍵入bash的:

    bash pve-4.1-diff-backup-addon revert

一段時間後,你會看到:

    Proxmox VE 4.1 - differential backup support  
    Kamil Trzcinski, http://ayufan.eu/, ayufan@ayufan.eu

    RESTORED: /usr/share/pve-manager/  
    RESTORED: /usr/share/perl5/PVE/

    Restarting PVE API Proxy Server: pveproxy.
    Restarting PVE Daemon: pvedaemon.

What about UPGRADE? (READ THIS)

This is important part. If you will ever want to upgrade your Proxmox installation (byapt-get dist-upgrade or apt-get upgradeALWAYS revert/uninstall patches. You will still be able to apply them afterwards.

如何取得新的外掛版本?

  • Use previous patch to revert changes.
  • 下載新的外掛版本,如前所述適用。

結果

結果是令人嘖嘖稱奇!這些都是實實在在的數值:

    VM   full      diff 1day   diff 2days   diff 3days    diff 4days
    1.   39.10GB   41MB        47MB         51MB          55MB
    2.   96.84GB   1.07GB      1.38GB       1.43GB        1.68GB
    3.   83.95GB   1.68GB      2.66GB       3.69GB        4.25GB
    4.   9.19GB    76KB        76KB         166MB         198MB

真得可以看得到這裡的差異. The diff sizes strictly depends on the use of the VMs. Using differential backups I have backups from last month (full backup once a week, differential daily)

Why this is not upstream?

I tried to push the changes upstream. They were rejected by Dietmar:

We removed that feature 3 years ago. I have no plans to re-add that. We want to keep vzdump a simple tool.

But I thought that it would be really shame if I wouldn’t go public with this.

Is it stable?

Yes, it is. This extensions uses xdelta3 as differential backup tool, which proven to be well tested and stable. I use it for about 9 months on 4 different Proxmox based servers. No problems so far.

However, if you happen to be paranoidal about backups… You should consider running following script. The script simply tries to verify all differential backups. I recently updated the script to support new VMA archive. So now you can verify backups all supported backups.

    wget http://ayufan.eu/projects/proxmox-ve-differential-backups/pve-verify-backups
    chmod +x pve-verify-backups
    ./pve-verify-backups <backup-dir>

FAQ

In case of any problems applying or reverting patches you can always simple revert back to stock. Simply reinstall modified packages:

    apt-get --reinstall install pve-manager qemu-server libpve-storage-perl

Then you can try to reapply patches once again.

In order to remove all leftovers you have to edit /etc/pve/vzdump.cron and removefullbackup switch from vzdump command line.

Changelog

  • v1: initial public release with support for PVE2.2 and PVE2.3 (2013-03-05)
  • v2: improved kvm backup size and speed for PVE2.3 (2013-03-08)
  • v3: added support for PVE3.0 (2013-06-02)
  • v3': updated pve-verify-backups to support VMA archives (2013-06-06)
  • v3'': updated patches to support PVE3.1 (2013-08-24)
  • v3'': updated xdelta3 to 3.0.6. More info about changes: http://xdelta.org/ (2013-08-24)
  • v3'': updated patches to support PVE3.2 (2014-03-15)
  • v3'': added FAQ (2014-04-30)
  • v3'': updated patches to support PVE3.3 (2014-09-23)
  • v3'': updated patches to support PVE3.4 (2015-02-26)
  • v3'': updated patches to support PVE4.0 (2015-11-07)
  • v3'': updated patches to support PVE4.1 (2016-01-22)

Detailed list of changes

  1. pve-xdelta3:
    • repackaged from http://packages.debian.org/wheezy/xdelta3
    • added support for lzop
    • removed all python references
  2. vzdump:
    • added “fullbackup” option
  3. qmrestore and vzrestore:
    • added support for differential backups
  4. PVE.dc.BackupEdit:
    • added controls for maxfiles and fullbackup

:::
展開 | 闔起

文章類別

書籍目錄

展開 | 闔起

線上使用者

7人線上 (5人在瀏覽線上書籍)

會員: 0

訪客: 7

更多…