-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Veeam: Support Veeam 11 and 12 #8241
Conversation
The following comes from Veeam release note ``` Mods: please move to the PowerShell forum. Yes, this is known change to a PowerShell module from a snap-in, it was made during a beta stage for v11. The requirements for PowerShell 5.1 (up from 2) are covered in the Release Notes, and the details about the PowerShell module are covered in the "What's New" documentation. Details are here: PowerShell • PowerShell module — By popular demand, we switched from the PowerShell snap-in to the PowerShell module, which can be used on any machine with the backup console installed. We also no longer require PowerShell 2.0 installed on the backup server, which is something many customers had problems with. • New PowerShell cmdlet — Version 11 adds 184 new cmdlets for both newly added functionality and expanded coverage of the existing features with a particular focus on restore functionality. ``` This fixes the error message when assign VM to backup offering ``` 2023-10-25 12:35:11,032 DEBUG [o.a.c.b.v.VeeamClient] (API-Job-Executor-5:ctx-5f068dbb job-42 ctx-3fbfe1a2) (logid:5840110c) Veeam response for PowerShell commands [PowerShell Add-PSSnapin VeeamPSSnapin;$Job = Get-VBRJob -name "template_job_zone1_default";$Job.GetBackupTargetRepository() ^| select Name ^| Format-List] is: [^M ^M Name : Default Backup Repository^M ^M ^M ^M Add-PSSnapin : No snap-ins have been registered for Windows PowerShell version 5.^M At line:1 char:1^M + Add-PSSnapin VeeamPSSnapin;$Job = Get-VBRJob -name template_job_zone1 ...^M + ~~~~~~~~~~~~~~~~~~~~~~~~~~^M + CategoryInfo : InvalidArgument: (VeeamPSSnapin:String) [Add-PSSnapin], PSArgumentException^M + FullyQualifiedErrorId : AddPSSnapInRead,Microsoft.PowerShell.Commands.AddPSSnapinCommand^M ^M ]. ```
2023-10-25 13:30:15,357 DEBUG [o.a.c.b.v.VeeamClient] (API-Job-Executor-1:ctx-8fff2101 job-46 ctx-e7b5b953) (logid:1c585ee5) Veeam response for PowerShell commands [PowerShell Import-Module Veeam.Backup.PowerShell;$Job = Get-VBRJob -name "template_job_zone1_default";$Job.GetBackupTargetRepository() ^| select Name ^| Format-List] is: [WARNING: The names of some imported commands from the module 'Veeam.Backup.PowerShell' include unapproved verbs that might make them less discoverable. To find the commands with unapproved verbs, run the Import-Module command again with the Verbose parameter. For a list of approved verbs, type Get-Verb. Name : Default Backup Repository ]. 2023-10-25 13:30:15,357 WARN [o.a.c.b.v.VeeamClient] (API-Job-Executor-1:ctx-8fff2101 job-46 ctx-e7b5b953) (logid:1c585ee5) Exception caught while trying to clone Veeam job: com.cloud.utils.exception.CloudRuntimeException: Can't find any repository name for Job [name: template_job_zone1_default].
2023-10-25 13:37:28,343 DEBUG [o.a.c.b.v.VeeamClient] (API-Job-Executor-1:ctx-92428196 job-49 ctx-4c5c5364) (logid:0271069c) Veeam response for PowerShell commands [PowerShell Import-Module Veeam.Backup.PowerShell -WarningAction SilentlyContinue;$Job = Get-VBRJob -name "template_job_zone1_default";$Job.GetBackupTargetRepository() ^| select Name ^| Format-List] is: [^M ^M Name : Default Backup Repository^M ^M ^M ^M ]. 2023-10-25 13:37:28,344 WARN [o.a.c.b.v.VeeamClient] (API-Job-Executor-1:ctx-92428196 job-49 ctx-4c5c5364) (logid:0271069c) Exception caught while trying to clone Veeam job: com.cloud.utils.exception.CloudRuntimeException: Can't find any repository name for Job [name: template_job_zone1_default]. at org.apache.cloudstack.backup.veeam.VeeamClient.getRepositoryNameFromJob(VeeamClient.java:384)
marvin.cloudstackException.CloudstackAPIException: Execute cmd: listbackupproviderofferings failed, due to: errorCode: 530, errorText:Veeam B&R API call unauthorized, please ask your administrator to fix integration issues. v1_4 is not supported in veeam 12a, refer to https://helpcenter.veeam.com/docs/backup/em_rest/http_authentication.html?ver=120
administrator@VEEAM12A C:\Users\Administrator>PowerShell Import-Module Veeam.Backup.P owerShell -WarningAction SilentlyContinue;$Job = Get-VBRJob -name "Backup Job Automat ic" Get-VBRJob : A positional parameter cannot be found that accepts argument 'Job'. At line:1 char:78 + ... gAction SilentlyContinue;$Job = Get-VBRJob -name Backup Job Automatic + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: (:) [Get-VBRJob], ParameterBindingEx ception + FullyQualifiedErrorId : PositionalParameterNotFound,Veeam.Backup.PowerShell.C mdlets.GetVBRJob administrator@VEEAM12A C:\Users\Administrator>PowerShell Import-Module Veeam.Backup.P owerShell -WarningAction SilentlyContinue;$Job = Get-VBRJob -name 'Backup Job Automat ic'
(1) get backup metrics via Veeam API on veeam11, it works ``` administrator@VEEAM11A C:\Users\Administrator>PowerShell Import-Module Veeam.Backup.P owerShell -WarningAction SilentlyContinue;$backups = Get-VBRBackup;foreach ($backup i n $backups) {$backup.JobName;$storageGroups = $backup.GetStorageGroups();foreach ($gr oup in $storageGroups) {$usedSize = 0;$dataSize = 0;$sizePerStorage = $group.GetStora ges().Stats.BackupSize;$dataPerStorage = $group.GetStorages().Stats.DataSize;foreach ($size in $sizePerStorage) {$usedSize += $size;}foreach ($size in $dataPerStorage) {$ dataSize += $size;}$usedSize;$dataSize;}echo "====="} i-13-22-VM-CSBKP-b3b3cb75-cfbf-4496-9c63-a08a93347276 ===== backup-job-based-on-sla ===== i-12-20-VM-CSBKP-9f292f11-00ec-4915-84f0-e3895828640e ===== i-2-5-VM-CSBKP-0d752ca6-d628-4d85-a739-75275e4661e6 1268682752 15624049921 ===== i-32-56-VM-CSBKP-b374b20e-9e8f-427a-a02f-1cd740bce044 569131008 2147506678 ===== ``` on veeam12, the powershell command does not return datasize and usedsize. ``` administrator@VEEAM12A C:\Users\Administrator>PowerShell Import-Module Veeam.Backup.P owerShell -WarningAction SilentlyContinue;$backups = Get-VBRBackup;foreach ($backup i n $backups) {$backup.JobName;$storageGroups = $backup.GetStorageGroups();foreach ($gr oup in $storageGroups) {$usedSize = 0;$dataSize = 0;$sizePerStorage = $group.GetStora ges().Stats.BackupSize;$dataPerStorage = $group.GetStorages().Stats.DataSize;foreach ($size in $sizePerStorage) {$usedSize += $size;}foreach ($size in $dataPerStorage) {$ dataSize += $size;}$usedSize;$dataSize;}echo "====="} Backup Job Automatic ===== Backup Job Manual ===== i-2-4-VM-CSBKP-506760dc-ed77-40d6-a91d-e0914e7a1ad8 ===== Backup Job Automatic ===== ``` (2) get VM RestorePoints via Veeam API Currently cannot insert BackupVO to database ``` Caused by: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Incorrect datetime value: '03/11/2023 16:26:12' for column 'date' at row 1 ``` fixed by getting date from CreateTimeUtc in API response instead of powershell output ``` administrator@VEEAM12A C:\Users\Administrator>PowerShell Import-Module Veeam.Backup.P owerShell -WarningAction SilentlyContinue;$restore = (Get-VBRRestorePoint -Name "i-2- 4-VM" ^| Where-Object {$_.IsConsistent -eq $true});if ($restore) { $restore ^| Format -List } ... Id : f6d504cf-eafe-4cd2-8dfc-e9cfe2f1e977 ... PointId : c030b23e-d7fa-45b6-a5a7-feb8525d2563 ... CreationTime : 03/11/2023 16:26:12 CreationTimeUtc : 03/11/2023 16:26:12 Type : Full Algorithm : Full ... IsConsistent : True ... CompletionTimeUtc : 03/11/2023 16:26:59 ... ``` (3) format Date to new format accepted by database It fixes the issue below Caused by: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Incorrect datetime value: '2023-11-03T16:26:12.209913Z' for column 'date' at row 1 The new date is '2023-11-03 16:26:12'.
If user uses a older version (e.g 9.x), please update the backup.plugin.veeam.version (zone setting) to 9
@blueorangutan package |
@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Packaging result [SF]: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 8353 |
@blueorangutan package |
@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
@blueorangutan test rocky8 vmware-70u3 |
@weizhouapache a [SL] Trillian-Jenkins test job (rocky8 mgmt + vmware-70u3) has been kicked to run smoke tests |
@blueorangutan test ubuntu22 vmware-80 |
@weizhouapache a [SL] Trillian-Jenkins test job (ubuntu22 mgmt + vmware-80) has been kicked to run smoke tests |
[SF] Trillian test result (tid-8871)
|
test results
|
@weizhouapache [SL] unsupported parameters provided. Supported mgmt server os are: |
this PR has been reviewed by @rohityadavcloud @DaanHoogland merging |
@weizhouapache @DaanHoogland do we need to forward merge 4.18 branch now to cut 4.19 RC3 or can it wait for later? |
I can wait. 4.18.2/4.19.1 is good to me. |
Thanks @weizhouapache - looks like this has made into 4.18 branch; but as it also forward merged for main/4.19 branch (ie. RC3) @shwstppr ? |
@rohityadavcloud |
This PR fixes several issues in the testing of Veeam 11 and Veeam12 - Import Veeam.Backup.PowerShell and silently ignore the warning messages - Fix issue when assign vm to backup offerings, which caused by separator (\r\n) - Fix authorization failure in veeam 12a, which is because v1_4 is not supported in veeam 12a any more - Fix exception if backup name has space - Fix backup metrics in veeam12, which is because powershell command does not return the values needed - Fix Incorrect datetime value, which is because powershell command returns a datetime which is not supported in Java - Fix issue during backup restoration if VM has both ROOT and DATA disks. This PR also has the following update - Add integration test test/integration/smoke/test_backup_recovery_veeam.py - Make some UI changes - Add zone setting backup.plugin.veeam.version. If it is not set, CloudStack will get veeam version via powershell commands. - Add zone setting backup.plugin.veeam.task.poll.interval and backup.plugin.veeam.task.poll.max.retry
Description
This PR fixes several issues in the testing of Veeam 11 and Veeam12
This PR also has the following update
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?