PowerShell script exchange
Post Reply
lrhazi
Enthusiast
Posts: 94
Liked: 3 times
Joined: Jan 03, 2017 8:15 pm
Full Name: Mohamed Lrhazi
Contact:

How to check status of Start-VBRInstantRecovery?

Post by lrhazi »

When you call this function, how do you check that it succeeded?

It does not appear to return a result object.
veremin
Product Manager
Posts: 20282
Liked: 2257 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: How to check status of Start-VBRInstantRecovery?

Post by veremin »

You can get a restore session using Get-VBRRestoreSession cmdlet and check its result by querying result parameter. Thanks!
lrhazi
Enthusiast
Posts: 94
Liked: 3 times
Joined: Jan 03, 2017 8:15 pm
Full Name: Mohamed Lrhazi
Contact:

Re: How to check status of Start-VBRInstantRecovery?

Post by lrhazi »

I see that I can query for existing sessions, with Get-VBRInstantRecovery, but how do I know which session is the one I just started, or failed to start ?
lrhazi
Enthusiast
Posts: 94
Liked: 3 times
Joined: Jan 03, 2017 8:15 pm
Full Name: Mohamed Lrhazi
Contact:

Re: How to check status of Start-VBRInstantRecovery?

Post by lrhazi »

I can filter by VM name, but still, what if there many running already, for the same VM ? How do I tell which one is really the one I just started or failed to start?
veremin
Product Manager
Posts: 20282
Liked: 2257 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: How to check status of Start-VBRInstantRecovery?

Post by veremin »

You can assign result of Start-VBRInstantRecovery cmdlet execution to a variable and work with the variable afterwards (in order to be sure). Thanks!
lrhazi
Enthusiast
Posts: 94
Liked: 3 times
Joined: Jan 03, 2017 8:15 pm
Full Name: Mohamed Lrhazi
Contact:

Re: How to check status of Start-VBRInstantRecovery?

Post by lrhazi »

Unfortunately, the cmdlet does not seem to return anything at all!
veremin
Product Manager
Posts: 20282
Liked: 2257 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: How to check status of Start-VBRInstantRecovery?

Post by veremin »

Hmm, then, your only option is to run Get-VBRRestoreSession (returns all sessions) or Get-VBRInstantRecovery (returns only currently running sessions) and filter them based on CreationTime parameter - the latest one should be the one that has been just started. Returned session object also has different result and state parameters that should give you clues on whether the execution went successfully or not. Thanks!
lrhazi
Enthusiast
Posts: 94
Liked: 3 times
Joined: Jan 03, 2017 8:15 pm
Full Name: Mohamed Lrhazi
Contact:

Re: How to check status of Start-VBRInstantRecovery?

Post by lrhazi »

Thanks a lot Vladimir. I will do that... The right way would have been for the Cmdlet to return an object that reliably identifies the session it started.
veremin
Product Manager
Posts: 20282
Liked: 2257 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: How to check status of Start-VBRInstantRecovery?

Post by veremin »

If you use -RunAsync switch, cmdlet will return an object, but the object doesn't have any creationtime parameter, so it will be useless for your goal. Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests