We encountered two problems while:
1) creating backups for virtual machines using the same name based on vCloud Director
2) trying to restore virtual machines from backup based on vCloud Director
1) While trying to create backup for a VM deployed in vApp in vCloud Director using PowerShell everything works when the VM name is unique:
Code: Select all
param([string]$vm_name,[string]$index)
Add-PSSnapin VeeamPSSnapin
$vmcloud = Find-VBRvCloudEntity -Name "$vm_name"
$repository = Get-VBRBackupRepository -Name "Backup Repository 1"
Add-VBRvCloudJob -Name "$($vm_name)_$($index)" -Entity $vmcloud -BackupRepository $repository
Get-VBRJob -Name "$($vm_name)_$($index)" | Set-VBRJobAdvancedBackupOptions -Algorithm ReverseIncremental
Get-VBRJob -Name "$($vm_name)_$($index)" | Set-VBRJobAdvancedOptions -RetainDays 14
Get-VBRJob -Name "$($vm_name)_$($index)" | Set-VBRJobAdvancedViOptions -VMToolsQuiesce $True
$Job = Get-VBRJob -Name "$($vm_name)_$($index)"
$Job.BackupStorageOptions.EnableDeletedVmDataRetention = $true
$Options = $Job.GetOptions()
$Options.SanIntegrationOptions.FailoverFromSan = $True
$Options.BackupStorageOptions.StgBlockSize = "KbBlockSize512"
$Options.BackupStorageOptions.RetainCycles = 1
$Job.SetOptions($Options)
Get-VBRJob -Name "$($vm_name)_$($index)" | Start-VBRJob -runasync
Write-Host "Done!"
2) While trying to restore a VM from backup to vCloud Director (not vApp but VM) the restore fails because it cannot find a restore point. Strangely when you look at restore point for VM using PowerShell it shows vApp's name as vm's name:
Code: Select all
param([string]$vm_name,[string]$index)
Add-PSSnapin VeeamPSSnapin
$restorepoint = Get-VBRBackup -Name "$($vm_name)_$($index)" | Get-VBRRestorePoint -Name * | Sort-Object $_.creationtime -Descending | Select -First 1
Start-VBRvCloudRestoreVm -RestorePoint $restorepoint -PowerUp -RunAsync
Write-Host "Done!"