ProxmoxVE 每日自動快照 終於發現這個神兵利器

先前使用XenServer在7.X版之後,有自動排程快照的功能
說真的這個功能非常的吸引,但是因為Citrix在後面一直縮減功能,加上每費版的單個硬碟只能2T,光做個NAS備份都不夠。
管理功能只好改用XCP-NG

也為了相容性的關係,所以XenServer我們一直使用的是6.5版

昨天在查資料的時候,看到原來ProxmoxVE也可以有類似的自動快照功能,其實很早就有這個功能了,只是一直沒有看到相關的資訊
所以就裝起來試了一下

指令如下
1.apt-get install unzip
2.wget https://github.com/Corsinvest/cv4pve-autosnap/releases/download/v1.7.0/cv4pve-autosnap-linux-x64.zip
3.unzip cv4pve-autosnap-linux-x64.zip
4.cp cv4pve-autosnap /usr/bin
5.chmod +x /usr/bin/cv4pve-autosnap
6.apt install libcurl4 liblttng-ust0

安裝好就可以來指Shell script來做快照排程了
cv4pve-autosnap –host=127.0.0.1 –username=root@pam –password=密碼 –vmid=’all’ snap –label=’Daily’ –keep=3
快照建立,留3份 –username=root@pam <–這個不要修改

cv4pve-autosnap –host=127.0.0.1 –username=root@pam –password=密碼 –vmid=’all’ clean –label=’Daily’ –keep=3
清快照,留3份

快照名稱
auto’你輸入的Label’西元年後(2碼)時(2碼)分(2碼)秒(2碼)
長出來的快照如下

設定好,就放下去crontab做排程,再塔配ve dump做備份,完全性完全足夠了。

剛才在弄另一台機器時,出現快照失敗,按照節省工具箱的說明,主要是raw不支援快照。

cv4vpe備份失敗,snapshot feature is not available
RAW格式不支援sanpshot

目前機器還開著,晚一點關機,再來做轉換格式的動作。應該就能支援快照了

參考文件
1.快照設定文件
2.節省工具箱

20200130 我發現一件事,就是VZDUMP備份的速度相當的慢
在同樣的硬體下同樣的分割下(EXT4),XenServer備份加上壓縮的時間,機乎是VZDUMP+Compress備份方式時間的一半,而且壓縮率,並不如XenServer來的高。

VM的硬碟容量32G
備份的Read/Write都在 3~6MB/s,真的相當的緩慢。
簡而言之,目前的備份對比來說,即花時間,又佔空間。
1個小時25分鐘,備份32G的資料才備份68%
假設如果備份是線性的,那麼需要2個小時5分才備份的完
這樣的效能真的不能拿來放重要的系統,風險性太高了。

最後,2個小時零7分備份完成,看來備份和快照要怎麼搭配,還要再想想。

20200131 今天做快照出現了錯誤訊息

ACTION Snap
VMs: all
Label: Daily
Keep: 3
State: False
—– VM 101 —–
VM 101 consider enabling QEMU agent see https://pve.proxmox.com/wiki/Qemu-guest-agent
Create snapshot: autoDaily200131082946
================ EXCEPTION ================
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException
‘System.Dynamic.ExpandoObject’ does not contain a definition for ‘data’
at CallSite.Target(Closure , CallSite , Object )
at System.Dynamic.UpdateDelegates.UpdateAndExecute1[T0,TRet](CallSite site, T0 arg0)
at CallSite.Target(Closure , CallSite , Object )
at Corsinvest.ProxmoxVE.Api.PveClientBase.TaskIsRunning(String node, String task)
at Corsinvest.ProxmoxVE.Api.PveClientBase.WaitForTaskToFinish(String node, String task, Int64 wait, Int64 timeOut)
at CallSite.Target(Closure , CallSite , PveClient , String , Object , Int32 , Int64 )
at System.Dynamic.UpdateDelegates.UpdateAndExecuteVoid5[T0,T1,T2,T3,T4](CallSite site, T0 arg0, T1 arg1, T2 arg2, T3 arg3, T4 arg4)
at Corsinvest.ProxmoxVE.Api.Extension.ResultExtension.WaitForTaskToFinish(Result result, VMInfo vm, Int64 timeout)
at Corsinvest.ProxmoxVE.Api.Extension.VM.Snapshots.Create(String name, String description, Boolean state, Int64 timeout)
at Corsinvest.ProxmoxVE.AutoSnap.Api.Application.Snap(String vmIdsOrNames, String label, Int32 keep, Boolean state, Int64 timeout)
at Corsinvest.ProxmoxVE.AutoSnap.ShellCommands.<>c__DisplayClass9_1.b__1()
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.<>c__DisplayClass144_0.b__0(CancellationToken _)
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken)
at McMaster.Extensions.CommandLineUtils.CommandLineApplication.Execute(String[] args)
at Corsinvest.ProxmoxVE.Api.Shell.Helpers.ShellHelper.ExecuteConsoleApp(CommandLineApplication app, String[] args)
ACTION Clean
VMs: all
Label: Daily
Keep: 3
—– VM 101 —–


還不知道原因是什麼,不過可以看的出來,這個快照產生工具,是使用微軟的c#開發的。

20200904 有新版本
https://github.com/Corsinvest/cv4pve-autosnap/releases/download/v1.9.4/cv4pve-autosnap-linux-x64.zip
請用這個路徑下載安裝

2 thoughts on “ProxmoxVE 每日自動快照 終於發現這個神兵利器

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *