PostJob workaround for current V7 Bug

PowerShell script exchange

PostJob workaround for current V7 Bug

Veeam Logoby Bunce » Wed Aug 21, 2013 7:22 am 1 person likes this post

Hey All,

There's a slight bug in replication jobs that useDisk Exclusions in V7 - the jobs won't run.. The workaround is to create the 'excluded' disk on the Replica - thin provisioned to prevent using up any space - so that the job still runs. Refer this post for more detail:
viewtopic.php?f=2&t=17636

The problem is that after a successful job run, the disks on the replica are removed, so any subsequent jobs will fail unless they are manually re-added again. We have quite a few replication jobs, and manually recreating the disk for each job, after each run, until a fix is found, isn't really viable.

So I figured a post-job script to re-add the disks to the replica would be worth trying. I''m OK with powershell, but haven't had much experience with Veeam PS snap-in as yet..

Three questions come to mind:
  • Can we piggy back off Veeam's PS shell to make VM vmdk changes, or do I have to shell into the PowerCLI?
  • Rather than create an individual script for each Job, can we pass the current job name (that calls the script) as a parameter in the post-job activity command?
  • Does anyone have any tips or snippets that might help me get started?

I'm thinking script would follow the below (pseudocode):

Code: Select all
$JobName (pipe in)

For each VM in JobName
   For each VMDK in SOURCE VM
      - If TARGET VM doesn't have matching disk at SCSI ID
         - Create VMDK (thin provisioned, of same size/SCSI ID as source)
      - End If
   Next VMDK
Next VM


Thanks in advance,
Andrew
Bunce
Expert
 
Posts: 254
Liked: 8 times
Joined: Fri Sep 18, 2009 9:56 am
Location: Adelaide, Australia
Full Name: Andrew

Re: PostJob workaround for current V7 Bug

Veeam Logoby v.Eremin » Wed Aug 21, 2013 3:47 pm

Can we piggy back off Veeam's PS shell to make VM vmdk changes, or do I have to shell into the PowerCLI?

PowerCLI

Rather than create an individual script for each Job, can we pass the current job name (that calls the script) as a parameter in the post-job activity command?

I believe it’s not. Though, you can find within the script a name of replication job that has just finished:

Code: Select all
Get-VBRJob | where {$_.jobtype -eq "replica"} | sort-object {$_.FindLastSession().endtime} -Descending | Select-Object name -First 1


Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 3 guests