PowerShell script exchange
Post Reply
gk87
Influencer
Posts: 15
Liked: never
Joined: Jun 09, 2017 11:47 am
Contact:

Instant VM Recovery followed by Quick Migration

Post by gk87 »

So I'm working on this script to start an Instant VM Recovery for Disaster Recovery to another location which is followed by a Quick Migration. The Instant VM Recovery runs fine for a VM but I'd like to move the VM to another datastore and not have the VM run directly from the backup file, where the Quick Migration is used for. However the Quick Migration does not stop the Instant VM Recovery process nor delete the VM created by the Instant VM Recovery. What am I missing / misinterpreting?

At least, that's what the below code is supposed to achieve if I'm not mistaken. Correct me if I'm wrong. The required snippets of the code:

Code: Select all

Start-VBRInstantRecovery -RestorePoint $vmRestorePoint `
-VMName $targetVMName `
-Server $targetHost `
-Resourcepool $targetResourcePool `
-Datastore $targetDatastore `
-Folder $targetFolder `
-Nicsenabled:$nicsEnabled `
-Powerup:$powerUp `
-Reason "$vm.vmName - Disaster Recovery to $targetVMName" #`
# Should we use RunAsync or not? Might cause hammering resulting in busy hosts/storage and failure of applying DRS Recommendations
#-RunAsync`
Followed by:

Code: Select all

$recoveredVM = Find-VBRViEntity -Name $targetVMName
Start-VBRQuickMigration -Entity $recoveredVM `
-Server $targetHost `
-ResourcePool $targetResourcePool `
-Datastore $targetDataStore `
-Folder $targetFolder `
-DeleteSorceVmFiles # `
# Should we use RunAsync or not? Might cause hammering resulting in busy hosts/storage and failure of applying DRS Recommendations
#-RunAsync
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Instant VM Recovery followed by Quick Migration

Post by veremin »

I think you can simply migrate VM to a new datastore, using Quick Migration cmdlet, check whether the operation has finished successfully and after that dispose Instant VM Recovery session. Thanks!
gk87
Influencer
Posts: 15
Liked: never
Joined: Jun 09, 2017 11:47 am
Contact:

Re: Instant VM Recovery followed by Quick Migration

Post by gk87 »

Thanks for the reply. So I can run the instant VM Recovery and then the VBR Quick Migration, but how would I monitor the VBR Quick Migration via Powershell to see what the status is?

Image

Extra question: Is there a way to define a custom name for the two jobs?
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Instant VM Recovery followed by Quick Migration

Post by veremin »

What if you asssign Start-VBRQuickMigration to a variable and check its status afterwards? Thanks!
gk87
Influencer
Posts: 15
Liked: never
Joined: Jun 09, 2017 11:47 am
Contact:

Re: Instant VM Recovery followed by Quick Migration

Post by gk87 »

I tried that before but that doesn't return anything. It works for the instant VM Recovery cmdlet but not for Quick Migration cmdlet.

Code: Select all

$quickMigration = Start-VBRQuickMigration -Entity $recoveredVM `
-Server $targetHost `
-ResourcePool $targetResourcePool `
-Datastore $targetDataStore `
-Folder $targetFolder `
-DeleteSorceVmFiles `
-Runasync

$quickMigration returns nothing
gk87
Influencer
Posts: 15
Liked: never
Joined: Jun 09, 2017 11:47 am
Contact:

Re: Instant VM Recovery followed by Quick Migration

Post by gk87 »

Correction on my previous post: It doesn't work for Instant VM Recovery either but that feature supports Get-VBRInstantRecovery. There is no Get-VBRQuickMigration. Looking for a way to see the status of a Quick Migration.
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Instant VM Recovery followed by Quick Migration

Post by veremin »

Hmm, what if you check the disk path of the VM? Thanks!
fzdk
Lurker
Posts: 1
Liked: never
Joined: Mar 14, 2019 8:03 am
Full Name: Frank Zehrer
Contact:

[MERGED] Quick Migration Job Status

Post by fzdk »

Hi all,

actually i am struggeling with VBR 9.5.0.1922.
I have to migrate a certain amount of VMs via Quick Migration and wrote a small PowerShell script to start the job.
Now i want to get the Jobstatus out of this job.
But i cannot find any command to support this.

E.g. the Get-VBRJob cmdlet, you can get the following jobs:

Backup jobs
Replication jobs
Backup copy jobs
File copy jobs
VM Copy jobs

But not Quick Migration Jobs.
Is there any way to get at least a status if the job has finished?
I have now tried several hours and several commands without any luck.

Any hint is highly appreciated.

Cheers,
Frank
ejenner
Veteran
Posts: 636
Liked: 100 times
Joined: Mar 23, 2018 4:43 pm
Full Name: EJ
Location: London
Contact:

Re: Quick Migration Job Status

Post by ejenner »

turn on notifications in the job settings?
veremin
Product Manager
Posts: 20415
Liked: 2302 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Instant VM Recovery followed by Quick Migration

Post by veremin »

You can try to check the disk path of migrated VM and see whether it helps. Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests