PowerShell script exchange
Post Reply
Bunce
Veteran
Posts: 259
Liked: 8 times
Joined: Sep 18, 2009 9:56 am
Full Name: Andrew
Location: Adelaide, Australia
Contact:

PostJob workaround for current V7 Bug

Post by Bunce » 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:
http://forums.veeam.com/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
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: PostJob workaround for current V7 Bug

Post by veremin »

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 11 guests