When I do the same restore from the GUI it works fine, so I'm suspecting there is something somewhat obvious I'm missing. I did a couple of searches in the forum and didn't see a similar error except when folks were changing versions of ESXi, which I'm not doing.Failed to register VM, configFile '[datastore] ServerName/ServerName.vmx', name 'ServerName', isTemplate 'False', poolRef '', hostRef 'host-83', folderRef 'group-v22'
The object has already been deleted or has not been completely created
Here's my script as it stands
Code: Select all
Add-PSSnapin -Name VeeamPSSnapin
# Set your variables like a good boy
$sRestoreDatastore = ""
$sRestoreHostFullName = ""
$sRestorePoint = ""
$sRestoreReason = ""
$sRestoreServer = ""
$sVM = ""
# First remind Veeam what is there to be restored
Get-VBRBackupRepository -Name Veeam | Sync-VBRBackupRepository
# Set the variables
$sRestoreVMName = "VM_Name"
$sRestoreHost = "Host_Name"
$sRestoreResourcePool = "Production"
$sRestoreDatastoreName = "Datastore_Name"
# Now get the details that Veeam needs
$sRestorePoint = Get-VBRRestorePoint –Backup(Get-VBRBackup) –Name $sRestoreVMName | select –Last 1
$sRestoreServer = Get-VBRServer -Name $sRestoreHost
$sRestoreDatastore = Find-VBRViDatastore -Server $sRestoreServer -Name $sRestoreDatastoreName
# and now do the restore
Start-VBRRestoreVM -RestorePoint $sRestorePoint -Server $sRestoreServer `
-Datastore $sRestoreDatastore -ResourcePool $sRestoreResourcePool `
-VMName $sRestoreVMName -Reason "Scripted restore" -PowerUp:$False
Best regards,
D