I'm a student from France trying to restore a VM from Veeam Backup & Replication to GCP by using a PowerShell script, aiming to automate this task in the future.
I found a script on youtube of a person doing exactly what I'm looking for, so I tried to understand the script and copied it with my values.
I had first many errors, that I debugged step by step. I'm now like "blocked" with an error that I don't understand :
Code: Select all
Start-VBRVMRestoreToGoogleCloud : Cannot validate argument on parameter 'RestorePoint'. The argument is null. Provide a valid value for the argument,
and then try running the command again.
At C:\Users\sa_veeam\Documents\Test script.ps1:12 char:47
+ Start-VBRVMRestoreToGoogleCloud -RestorePoint $restorepoint -Zone $gc ...
+ ~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (:) [Start-VBRVMRestoreToGoogleCloud], ParameterBindingValidationException
+ FullyQualifiedErrorId : ParameterArgumentValidationError,Veeam.Backup.PowerShell.Cmdlets.StartVBRVMRestoreToGoogleCloud
Here is my PowerShell script :
Code: Select all
$gcpaccount = Get-VBRGoogleCloudComputeAccount -Name "xxxxxx"
$gcpregion = Get-VBRGoogleCloudComputeRegion -Account $gcpaccount -Name "europe-west1"
$gcpzone = Get-VBRGoogleCloudComputeZone -Region $gcpregion -Name "europe-west1-b"
$gcptype = Get-VBRGoogleCloudComputeInstanceType -Zone $gcpzone -Name "e2-small"
$gcpvpc = Get-VBRGoogleCloudComputeVPC -Account $gcpaccount -Name "default"
$gcpsubnet = Get-VBRGoogleCloudComputeSubnet -VPC $gcpvpc -Region $gcpregion -Name "default"
$restorepoint = Get-VBRRestorePoint -Name "xxxxxxx" | Sort-Object $_.creationtime -Descending | Select -First 1
$gcpdisk = New-VBRGoogleCloudComputeDiskConfiguration -Diskname "xxxxxx.vmdk" -DiskType StandardPersistent
$gcprestoredVMname = "testRestoredVM"
$gcpproxy = New-VBRGoogleCloudComputeProxyAppliance -InstanceType $gcptype -RedirectorPort 443 -Subnet $gcpsubnet
Start-VBRVMRestoreToGoogleCloud -RestorePoint $restorepoint -Zone $gcpzone -InstanceType $gcptype -VMName $gcprestoredVMName -Subnet $gcpsubnet -DiskConfiguration $gcpdisk -ProxyAppliance $gcpproxy -AllocatePublicIP