繼前一篇 Synology Active Backup for Business for Hyper-V VM Failed to Backup #01
取得 Patch 跳過了 5 個 Snapshots 的問題後
還是備份失敗
於是再用 Support Center App 產生 Active Backup for Business 的 Debug Log 後
在 ActiveBackup\volume1\@ActiveBackup\log\vm.log 中看到
synoabk_vm_backup[6175]: synoabk_vm::[WARNING] hyperv_agent.cpp:1381(6175,139923524343360) [6175]hypervisor_agent/hyperv_agent.cpp:145 {"error_class":"PowerShellException","error_message":"Missing an argument for parameter 'Id'. Specify a parameter of type 'System.Int32[]' and try again.","error_params":{"Activity":"Stop-Process","Category":5,"Reason":"ParameterBindingException","TargetName":"","TargetType":"","error_id":"MissingArgument,Microsoft.PowerShell.Commands.StopProcessCommand"},"success":false}
難道是 Powershell 語法錯誤少帶一個參數?
繼續又看到synoabk_vm_backup[6175]: synoabk_vm::[ERROR] hyperv_disk.cpp:74(6175,139923524343360) Connect to HyperV disk server failed. [No such file or directory], sock[/run/synoabk/virtual_disk_server_6175.sock]
synoabk_vm_backup[6175]: synoabk_vm::[WARNING] hyperv_agent.cpp:1386(6175,139923524343360) [6175]virtual_disk/hyperv_disk.cpp:75 HyperV Message: null
%UserProfile%\AppData\Local\ActiveBackup\**Some GUID**\2.6.0-0025\hyperv_helper.exe
莫非就是那個 hyperv_helper.exe ?
於是我到 Microsoft Security Virus & threat protection 把那個程式加為例外 (Exclusions)
雖然說他的路徑有一個 GUID 讓我覺得好像路徑會每次都不一樣有點擔心
但先加例外測試成功了再來煩惱不遲
於是開始測試,果然不需要擔心煩惱,因為還是備份失敗
好吧,那個 Action blocked 的細節到底要去哪裡看呢?
原來在 Event Log 的以下位置:
Applications and Services Logs -> Microsoft -> Windows -> Widnows Defender -> Operational
那把 C:\Windows\System32\wbem\WmiPrvSE.exe 也加入 Microsoft Security Virus & threat protection 的 Exclusions 試試看
結果就成功完成備份了,這是哪招?
原來是我在測試期間直接把 Real-time protection 關掉了這招
但是當時我沒有留意到是因為自己開了大絕招所以成功
成功完成備份後,我把那個 hyperv_helper.exe 從例外清單中移除
只保留 C:\Windows\System32\wbem\WmiPrvSE.exe 一個
也是能成功完成備份 ==> 當然可以,因為開了大絕招
結果後續過程中無意間將 Defender 等各種保護再開啟後就又備份失敗了 (心累)
在這裡看到了一個熟悉的字眼: Microsoft Defender Exploit Guard
就是在 Event Log 敘述開頭指出的元兇
在 Add-MpPreference 指令的說明中有提到三個參數:
-AttackSurfaceReductionOnlyExclusions-AttackSurfaceReductionRules_Actions-AttackSurfaceReductionRules_Ids
(GPO Path: Computer Configuration/Administrative Templates/Windows Components/Microsoft Defender Antivirus/Microsoft Defender Exploit Guard/Attack Surface Reduction/Exclude files and paths from Attack Surface Reduction Rules)
$UserProfilePaths = @();
$Exclusions = @();
$ExclusionsExisted = @();
$ExclusionsExisted += ((Get-MpPreference).AttackSurfaceReductionOnlyExclusions);
$UserProfilePaths += ((Get-WMIObject -ClassName Win32_UserProfile -Filter "Special = False").LocalPath);
$HyperVHelperHit = $False;
foreach ($UserProfilePath in $UserProfilePaths) {
$ABBPath = ($UserProfilePath + '\AppData\Local\ActiveBackup');
if ((Test-Path -LiteralPath $ABBPath) -eq $True) {
$HyperVHelperHit = $True;
$ABBHelpers = @();
$ABBHelpers += ((Get-ChildItem -LiteralPath $ABBPath -Recurse) | where {$_.Extension -eq '.exe'});
if ($ABBHelpers.Count -gt 0) {
foreach ($ABBHelper in $ABBHelpers) {
if ($ExclusionsExisted -NotContains $ABBHelper.FullName) {
$Exclusions += $ABBHelper.FullName;
} else {
$Exclusions = ($Exclusions | where {$_ -ne $ABBHelper.FullName});
};
};
};
};
};
if ($HyperVHelperHit -eq $True) {
$WmiPrvSE_FullName = ($env:SystemRoot+'\'+'System32\wbem\WmiPrvSE.exe');
if ($ExclusionsExisted -NotContains $WmiPrvSE_FullName) {
$Exclusions += $WmiPrvSE_FullName;
} else {
$Exclusions = ($Exclusions | where {$_ -ne $WmiPrvSE_FullName});
};
};
if ($Exclusions.Count -gt 0) {
foreach ($Exclusion in $Exclusions) {
write-host ('Add "' + $Exclusion + '" as Exclusion to Microsoft Security Virus & Threat Protection');
Add-MpPreference -AttackSurfaceReductionOnlyExclusions $Exclusion
};
};
至此暫時是能進行備份作業了,後續再觀察看看
Synology 的技術支援工程師回覆我說:
hyperv_helper.exe 是 ABB 備份過程放到目標機器上協助執行備份任務的程式。
ABB 會需要透過 hyperv_helper.exe 在備份任務的過程做兩件事:
- 計算 CBT 回報給 ABB
- 讀取目標虛擬機的虛擬硬碟資料,傳遞給 ABB 儲存
之前沒有碰到此問題,是因為備份任務在執行到上述兩事項之前就因為 snapshot limit 問題而中止了。
因此需要請您協助將該程式加入防毒程式的例外清單內以避免防毒軟體誤判導致備份異常。
沒有留言:
張貼留言