PowerShell script exchange
Post Reply
c82djau
Novice
Posts: 3
Liked: 1 time
Joined: Jun 18, 2015 2:00 pm
Full Name: c82djau
Contact:

Start-VBRRestoreVM proxy

Post by c82djau »

Hi,

I use the command Start-VBRRestoreVM.
How can I specify a proxy to restore a VM ?

The Task created with the command Start-VBRRestoreVM return :

Code: Select all

Info                 : Veeam.Backup.Model.CRestoreSessionInfo
Initiator            : Veeam.Backup.Model.CRestoreSessionInfo+SInitiator
Platform             : EVmware
Options              : <ViVmRestoreSpec InitiatorName="" InitiatorSid="unknown"><OibId>d2415595-b551-43dc-ac56-01eacc37
                       6170</OibId><OibDate>635701683126430000</OibDate><VmName>MYVM</VmName><TargetVmName>tes
                       t_veeam</TargetVmName><BackupName>Metrologie</BackupName><TargetHostId>79f3812d-f5fd-48c5-b9c8-d
                       04b010ef2aa</TargetHostId><TargetHostName>MYESX</TargetHostName><TargetStorageR
                       ef>datastore-199340</TargetStorageRef><TargetStorageName>MYLUN</TargetStorag
                       eName><TargetResPoolRef>resgroup-478</TargetResPoolRef><TargetResPoolName>Resources</TargetResPo
                       olName><TargetVmFolderRef>group-v67</TargetVmFolderRef><TargetVmFolderName>vm</TargetVmFolderNam
                       e><IsPowerOn>False</IsPowerOn><MultiRestoreId>8f38e7c6-3062-4f69-93df-7d3218bd2e27</MultiRestore
                       Id><RestoreType>SingleRestore</RestoreType><TargetProxyAutoDetect>True</TargetProxyAutoDetect><R
                       estoreLocation>Different</RestoreLocation><SourceShareCredsId>00000000-0000-0000-0000-0000000000
                       00</SourceShareCredsId><TapeRestoreSessionId>00000000-0000-0000-0000-000000000000</TapeRestoreSe
                       ssionId><SqlAdditionalRestores /></ViVmRestoreSpec>
StateXml             : <StateXml />
LeaseId              : 00000000-0000-0000-0000-000000000000
FileLogger           : Veeam.Backup.Core.FileCommanderLogger
RestoreType          : SingleRestore
MultiRestoreId       : 8f38e7c6-3062-4f69-93df-7d3218bd2e27
RestoreSessionAudit  : Veeam.Backup.Core.RestoreSessionAudit
ItemsRestoreAudit    :
SessionInfo          : Veeam.Backup.Model.CRestoreSessionInfo
Id                   : 1d3a9cf2-ed01-461a-b124-3b71cb0d9be4
JobType              : RestoreVm
JobName              : MYVM
Name                 : MYVM
JobSpec              :
JobTypeString        : Full VM restore
Operation            :
Description          :
BaseProgress         : 0
IsCompleted          : False
IsWorking            : False
JobId                : 4e3421ae-a845-4402-baad-10c196d83175
Result               : None
State                : Starting
EndTime              : 01/01/1900 00:00:00
CreationTime         : 18/06/2015 14:47:52
AuxData              :
IsLowerAgentPriority : True
LogName              : MYVM
LogsSubFolder        : MYVM
Logger               : Veeam.Backup.Core.XmlLogger
Tracer               : Veeam.Backup.Core.CSessionLogTracer
I watch for this command but it must be set quickly after the task creation ?
Get-VBRJob -Name "Backup Job 01", "Backup Job 02" | Set-VBRJobProxy -Proxy $"SourceProxy"

Thanks,
David
veremin
Product Manager
Posts: 20400
Liked: 2298 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Start-VBRRestoreVM proxy

Post by veremin »

It's not possible to select particular proxy for VM restore via PowerShell. However, prior to restore within the script you can temporarily disable all proxies but one (Disable-VBRViProxy), and initiate restore (Start-VBRRestoreVM). Restore will have no other choices, but to pick the only left proxy. Thanks.
tgietz
Veeam Software
Posts: 163
Liked: 20 times
Joined: Mar 05, 2018 3:10 pm
Full Name: Tobias Gietz
Location: Germany
Contact:

Re: Start-VBRRestoreVM proxy

Post by tgietz »

Hi,

is it still not possible to select a particular proxy for VM restore via PowerShell or Rest API?

Best Regards
Tobias
david.domask
Veeam Software
Posts: 2123
Liked: 513 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Start-VBRRestoreVM proxy

Post by david.domask » 1 person likes this post

Doesn't look like we have a flag for it Tobias.

https://helpcenter.veeam.com/docs/backu ... ml?ver=120

So for now use the workaround Vladimir recommended with scripting disabling specific proxies and re-enabling them after starting the restore.
David Domask | Product Management: Principal Analyst
tgietz
Veeam Software
Posts: 163
Liked: 20 times
Joined: Mar 05, 2018 3:10 pm
Full Name: Tobias Gietz
Location: Germany
Contact:

Re: Start-VBRRestoreVM proxy

Post by tgietz »

Hi David,

thank you for our feedback.

As I understood the customer, it is a larger environment. The restore of a vm should be automated every day over a special proxy. Disabling other proxies will probably affect the active backup of other jobs.

Regards
Tobias
bmcguire
Veeam Software
Posts: 39
Liked: 3 times
Joined: Jan 24, 2023 3:28 pm
Full Name: Benjamin McGuire
Contact:

Re: Start-VBRRestoreVM proxy

Post by bmcguire »

https://helpcenter.veeam.com/docs/backu ... /UpdateJob

You can change proxy resources - Automatic selection or you can select a proxy resource

storage": {
"backupRepositoryId": "88788f9e-d8f5-4eb4-bc4f-9b3f5403bcec",
"backupProxies": {
"autoSelection": true,
"proxyIds": [ ]

proxyIds
Array of strings <uuid> unique
Array of proxy IDs.
david.domask
Veeam Software
Posts: 2123
Liked: 513 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Start-VBRRestoreVM proxy

Post by david.domask »

@bmcguire, I believe that is for creating backup jobs, and doesn't influence restores in any ways; that is just for ensuring a virtual machine backup job will use a specific proxy, this thread is about restores and using a specific proxy, but thank you anyways.

@tgietz, a disabled proxy that is already in use in a Backup Job won't be a problem; test it in lab, just start a job with a specific proxy, wait for data to start transferring, then disable the proxy in the UI; AFAIR, any jobs _currently_ using the proxy will continue to use it until the end of the job. To the best of my knowledge, disabling the proxy just prevents the Scheduler from considering such proxies for task assignment, it won't affect already assigned tasks. Though, I'm not sure how queued tasks are handled in this scenario, so it bears testing.

Point is, you don't need to leave the proxies disabled for a long time; do some timing tests and see how long it typically takes for the resources to be assigned during the restore (you can just check the UI for when it starts transferring data), and once the proxy is assigned, you can re-enable the rest of the proxies. This should be a pretty short window, so I'm doubtful it will impact backups _that_ often if there are even a handful of valid proxies in use. But this bears testing before putting into production in full.
David Domask | Product Management: Principal Analyst
tgietz
Veeam Software
Posts: 163
Liked: 20 times
Joined: Mar 05, 2018 3:10 pm
Full Name: Tobias Gietz
Location: Germany
Contact:

Re: Start-VBRRestoreVM proxy

Post by tgietz »

@david.domask Thank you for the Tipps. I will suggest it to the customer as a workaround.
AndyBG
Novice
Posts: 3
Liked: 1 time
Joined: Oct 05, 2022 5:35 pm
Full Name: Andy G
Contact:

Re: Start-VBRRestoreVM proxy

Post by AndyBG »

@c82djau - I think the API link @bmcguire was looking for is https://helpcenter.veeam.com/docs/backu ... &t=request

I have tested this myself (in the lab) and can confirm that it indeed accepts a targeted proxy (list) when performing a full VM restore.

I have also tried providing it an "incorrect proxy" (aka, on the wrong network) and it even tries to use that as well, so use with caution to avoid a slow restore.

Image
Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 7 guests