PowerShell script exchange
Post Reply
AntoeADV
Novice
Posts: 3
Liked: 1 time
Joined: Jan 25, 2021 4:09 pm
Contact:

Resource Pool Problem

Post by AntoeADV »

Hello, I'm trying to write a simple script to backup a VM to a new location :

Code: Select all

$restorepoint = Get-VBRRestorePoint -Name myserver
$server = Get-VBRServer -Name "myesx.local"
$rpool = Find-VBRViEntity -ResourcePools -Server "myvcenter.local" -Name "MY-CLUSTER"
$datastore = Find-VBRViDatastore -Server $server
Start-VBRRestoreVM -Restorepoint $restorepoint[1] -Server $server -ResourcePool $rpool -Datastore $datastore
But i have a problem with the ResourcePools, it's always telling me that it's empty even if it's not.
Here is the echo result of my $rpool variable :

Code: Select all

 PS C:\PROD\shell> echo $rpool

ConnHostId : 9c1acd1d-22bf-4d07-909f-e865ab53914e
Type       : Datacenter
Reference  : datacenter-21
Id         : 9c1acd1d-22bf-4d07-909f-e865ab53914e_datacenter-21
Name       : MY-CLUSTER
Path       : myvcenter.local\MY-CLUSTER
I've seen on another post that Find-VBRViDatastore is not working well, that's why i use the Find-VBRViEntity function but it's still not working.

Any idea why it's not working ? Thanks for the help

The error i get (it's in french sorry) :

Code: Select all

Start-VBRRestoreVM : Impossible de valider l'argument sur le paramètre « ResourcePool ». L’argument est Null. Spécifiez une valeur valide pour l’argument, puis réessayez.
Au caractère Ligne:5 : 81
+ ... repoint $restorepoint[1] -Server $server -ResourcePool $rpool -Datast ...
+                                                            ~~~~~~
    + CategoryInfo          : InvalidData : (:) [Start-VBRRestoreVM], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Veeam.Backup.PowerShell.Cmdlets.StartVBRRestoreVM
    
PetrM
Veeam Software
Posts: 3229
Liked: 520 times
Joined: Aug 28, 2013 8:23 am
Full Name: Petr Makarov
Location: Prague, Czech Republic
Contact:

Re: Resource Pool Problem

Post by PetrM »

Hello and Welcome to our Community!

The type of $rpool object is "Datacenter" but should be "ResourcePool" if you want to specify the target resource pool as an argument. However, resource pool is not a mandatory argument and you may use another container as a target, for example datastore or folder.

Thanks!
AntoeADV
Novice
Posts: 3
Liked: 1 time
Joined: Jan 25, 2021 4:09 pm
Contact:

Re: Resource Pool Problem

Post by AntoeADV » 1 person likes this post

Thanks for the help !
I used Folder as you said and it's now working.
I need to tweak it now to do what i want but that's better so thanks again.
AntoeADV
Novice
Posts: 3
Liked: 1 time
Joined: Jan 25, 2021 4:09 pm
Contact:

Re: Resource Pool Problem

Post by AntoeADV »

I have another question.
I managed to restore my servers with a network remapping via the -TargetNetwork parameters :

Start-VBRRestoreVM -Restorepoint $restorepoint[1] -Server $esxserver -Folder $folder -SourceNetwork $networksource -TargetNetwork $networkdest -Datastore $datastore[14] –PowerUp $true

But my VMs start with the new network disconnected. Is there any way to restore with the card connected via the Veeam script ? Or is it only possible with powerCLI ?

Thanks
oleg.feoktistov
Veeam Software
Posts: 1912
Liked: 635 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Resource Pool Problem

Post by oleg.feoktistov »

Not yet implemented for Start-VBRRestoreVM cmdlet, so you'll need to use PowerCLI. Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 15 guests