Comprehensive data protection for all workloads
Post Reply
danielec
Novice
Posts: 9
Liked: never
Joined: Mar 16, 2012 9:49 am
Contact:

Veeam B&R 6.5 jobs chain

Post by danielec » Nov 21, 2012 1:54 pm

With Veeam B&R 6.5 there is a new nice feature that allows to concatenate jobs.
So it is possible to build a chain of jobs like:

Start Job1 ----> End Job1 -> Start Job2 ----> End Job2 -> Start Job3 ----> End Job3 -> ...

It is possible, but I think not, to have an option that will start Job2 at a specific time if Job1 takes too much time ?
So I can have the power of chained jobs and the sure that a job will, at least, start at a specific time.

Suggestions:

1) If in the chain I disable Job2: Job3 never starts. A warning may be useful.
2) If the I change the job schedule to run at a specific time and there is a backup-window that will deny execution in that moment, it will be nice to have a warning.

Daniele
--

veremin
Product Manager
Posts: 16901
Liked: 1439 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam B&R 6.5 jobs chain

Post by veremin » Nov 21, 2012 3:14 pm

danielec wrote: It is possible, but I think not, to have an option that will start Job2 at a specific time if Job1 takes too much time ?
So I can have the power of chained jobs and the sure that a job will, at least, start at a specific time.
In order to meet your expectations I can propose you workaround, which includes putting into use “backup window” , as well as, “terminate” functionality.

Specify the “backup window” in Job1 Schedule Settings, enabling “terminate job if it exceeds backup-window”. Thus, job will be running for set period and will be terminated immediately, when it exceeds backup-window, or ,in other words, when job1 takes too much time.

Thereby ,job2 ,which was scheduled to run after the first one, will start in given time, making the allowance for amount of time required for job terminating.

Hope this helps.
Thanks.

tsightler
VP, Product Management
Posts: 5421
Liked: 2243 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: Veeam B&R 6.5 jobs chain

Post by tsightler » Nov 21, 2012 3:29 pm 2 people like this post

I'm confused by what your goal is for job chaining. You want the job to "wait" but then run after a given time anyway, so why not just schedule the job to start later and forget job chaining and the complexity and issues that it brings?

habibalby
Expert
Posts: 379
Liked: 24 times
Joined: Jul 18, 2011 9:30 am
Full Name: Hussain Al Sayed
Location: Bahrain
Contact:

Re: Veeam B&R 6.5 jobs chain

Post by habibalby » Nov 22, 2012 8:11 am

@danielec I agree with @Tom what he suggested, to start the job as per your convenience by using a Post-Activity scripts that will start the jobs by specifying a time.

Job1 takes 1 hour full backup, but you have a resources to run Job2 in some occasions Job1 might takes longer than earlier when it runs and if you run Job2 during Job1 and Job3 so in total will have 3 jobs running at the same time Job1, Job2 and Job3..

PowerShell scripts with Schedule Tasks is your ideal solution. Schedule them for your Daily as Incremental and Weekly as Full Backup it depends on when you run your Active Full Backup or Synthetic Backup that also depends on the job configuration within Veeam.

Code: Select all

Add-PSSnapin VeeamPSSnapin

# Add the name of the backup jobs to be included here. The order in which they are entered is the order in which they will run

$chainedjobs = ("Job1"), ("Job2"), ("Job3") #Or each Job in specific script that will run via Schedule Task for Weekly Full Backup and Daily Incremental.

foreach ($jobname in $chainedjobs){
$job = Get-VBRJob -name $jobname
$jobtry = 0
start-VBRJob -job $job

$job.GetLastResult()
if($job.GetLastResult() -eq "Failed"){
    do{
        Start-Sleep 480
        Start-VBRJob -job $job -RetryBackup
        $jobtry++
    }
    while(($jobtry -lt 3) -and ($job.GetLastResult() -eq "Failed"))
}
}

danielec
Novice
Posts: 9
Liked: never
Joined: Mar 16, 2012 9:49 am
Contact:

Re: Veeam B&R 6.5 jobs chain

Post by danielec » Nov 22, 2012 10:56 am

tsightler wrote:I'm confused by what your goal is for job chaining. You want the job to "wait" but then run after a given time anyway, so why not just schedule the job to start later and forget job chaining and the complexity and issues that it brings?
I agree with you, but with chained-jobs you don't want to waste time (veeam idle... sleeping).
habibalby wrote: PowerShell scripts with Schedule Tasks is your ideal solution. Schedule them for your Daily as Incremental and Weekly as Full Backup it depends on when you run your Active Full Backup or Synthetic Backup that also depends on the job configuration within Veeam.
Thanks. But I don't understand how can you meet what I want with your PowerShell Script. You Start the 3 jobs sequentialy (jobs chain).
If job1 will takes too much time you will have to wait until is finished.

Using powershell it will possible to (pseudocode):

Code: Select all

# Execute this script from Schedule Tasks (Windows)
# Set Job schedule time so veeam can schedule and start the jobs for us
job1 start at 00:00
job2 start at 01:00
job3 start at 02:00

# Chain Jobs run (bypass veeam schedule)
For Each job: job1, job2, job3; do
{
    # Disable schdule since we run the job manually
    job disable schedule
    # Check if the job is not running (veeam may have start it) if so start it 
    if (job is not Running) {
        start job
    }
}
Thanks

Daniele
--

habibalby
Expert
Posts: 379
Liked: 24 times
Joined: Jul 18, 2011 9:30 am
Full Name: Hussain Al Sayed
Location: Bahrain
Contact:

Re: Veeam B&R 6.5 jobs chain

Post by habibalby » Nov 22, 2012 11:09 am

Hi,
You can set one job per script and configure an average time cap between each job.

Thanks,

veremin
Product Manager
Posts: 16901
Liked: 1439 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Veeam B&R 6.5 jobs chain

Post by veremin » Nov 22, 2012 11:16 am

If PowerShell solution doesn’t answer your requirements, why not to try to solve this issue via GUI,as i've mentioned previously,using “backup-window” in conjunction with “terminate if the job exceeds it”?

In this specific example, if job1 ends in time, job2 starts immediately after it. Otherwise, if job1 exceeds back up window, it will be terminated, and job2 will be started approximately in specific time (the time when backup window ends), taking into account some amount of time necessary for terminating.

Thanks.

habibalby
Expert
Posts: 379
Liked: 24 times
Joined: Jul 18, 2011 9:30 am
Full Name: Hussain Al Sayed
Location: Bahrain
Contact:

Re: Veeam B&R 6.5 jobs chain

Post by habibalby » Nov 22, 2012 1:00 pm

danielec wrote: Thanks. But I don't understand how can you meet what I want with your PowerShell Script. You Start the 3 jobs sequentialy (jobs chain).
If job1 will takes too much time you will have to wait until is finished.
Does this help you out? http://s11.postimage.org/fjgu0eqpd/Veeam_Schedule.jpg

danielec
Novice
Posts: 9
Liked: never
Joined: Mar 16, 2012 9:49 am
Contact:

Re: Veeam B&R 6.5 jobs chain

Post by danielec » Nov 22, 2012 3:41 pm

v.Eremin wrote:If PowerShell solution doesn’t answer your requirements, why not to try to solve this issue via GUI,as i've mentioned previously,using “backup-window” in conjunction with “terminate if the job exceeds it”?
This is simple and correct. The only disadvance is that you have to stop/abort Job1 to start Job2 (the "backup-windows" will kill Job1)
habibalby wrote: Does this help you out? Image
Okey, you have different Windows Tasks that will run several Veeam PowerShell Script.
Each script will execute a jobs-chain of backup/replica.

But in your script, as I said before, you will execute in sequence: job1 -> job2 -> job3
If Job1 will takes a lot of time you have to wait it to finish before job2 can run...

Thanks!

habibalby
Expert
Posts: 379
Liked: 24 times
Joined: Jul 18, 2011 9:30 am
Full Name: Hussain Al Sayed
Location: Bahrain
Contact:

Re: Veeam B&R 6.5 jobs chain

Post by habibalby » Nov 22, 2012 3:47 pm

Hello, you can change the script instead of multible jobs you can put 1 job per script and that's what I'm doing.

danielec
Novice
Posts: 9
Liked: never
Joined: Mar 16, 2012 9:49 am
Contact:

Re: Veeam B&R 6.5 jobs chain

Post by danielec » Nov 22, 2012 3:53 pm

habibalby wrote:Hello, you can change the script instead of multible jobs you can put 1 job per script and that's what I'm doing.
Of course, but the topic is about jobs chain :)

habibalby
Expert
Posts: 379
Liked: 24 times
Joined: Jul 18, 2011 9:30 am
Full Name: Hussain Al Sayed
Location: Bahrain
Contact:

Re: Veeam B&R 6.5 jobs chain

Post by habibalby » Nov 22, 2012 4:07 pm

There always a workaround when things are not available by default :) of them is the separate full active baxkup schedule which is a nice to have but since its not available Task schudler is the replacement.

tsightler
VP, Product Management
Posts: 5421
Liked: 2243 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: Veeam B&R 6.5 jobs chain

Post by tsightler » Nov 22, 2012 6:40 pm 1 person likes this post

danielec wrote: I agree with you, but with chained-jobs you don't want to waste time (veeam idle... sleeping).
But this is what I don't understand. If you "don't want to waste time" then why not just start both jobs at the same time and let them run. That would "waste" even less time. I'm having a very difficult time understanding the logic of running only 1 job at a time, unless a job runs "too long" and then running a two at a time. If you have the resources to run two at a time, just do it. This is what Veeam, and it's automatic load balancing is designed to do. Don't waste time, don't waste resources, just start the job and let them run using the resources (i.e. proxies) that you have available. This will get the jobs done in the fastest time no matter what, not job chaining required.

So, I'd like to understand your reason for not wanting to just run both jobs concurrently from the start, but then being OK with running two jobs later. Note that I'm not saying there's not a good reason, only that I don't understand what it might be, and I can't really see adding all of this complication to the product for such a unique use case.

If I were attempting to meet this goal, I'd try to figure out the way to do this in the simplest possible method. I'm thinking that perhaps manipulating the availability of proxies is the easiest way to do that without chaining.

danielec
Novice
Posts: 9
Liked: never
Joined: Mar 16, 2012 9:49 am
Contact:

Re: Veeam B&R 6.5 jobs chain

Post by danielec » Nov 26, 2012 10:26 am

tsightler wrote: But this is what I don't understand. If you "don't want to waste time" then why not just start both jobs at the same time and let them run. That would "waste" even less time. I'm having a very difficult time understanding the logic of running only 1 job at a time, unless a job runs "too long" and then running a two at a time. If you have the resources to run two at a time, just do it.
Resource is the problem (destination target and proxy). So what I want is to run 1 job as fast as possible with all the resource for him. After the backup job I want to run the replica of the VM. So chained jobs are good. You don't need to know when to schedule all jobs, but just the first.

Real Example:
I hade a situation where a backup of a VM was slow, because someone made a snapshot... In this situation, if the VM with the snapshot that you wanto to bck is the first job in the sequence, you are unlucky ...

tsightler
VP, Product Management
Posts: 5421
Liked: 2243 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

Re: Veeam B&R 6.5 jobs chain

Post by tsightler » Nov 26, 2012 9:47 pm 1 person likes this post

danielec wrote: Resource is the problem (destination target and proxy). So what I want is to run 1 job as fast as possible with all the resource for him. After the backup job I want to run the replica of the VM. So chained jobs are good. You don't need to know when to schedule all jobs, but just the first.
Sounds like you could easily handle this by simply setting the number of concurrent threads supported by both your proxy and repository.

dellock6
Veeam Software
Posts: 5734
Liked: 1625 times
Joined: Jul 26, 2009 3:39 pm
Full Name: Luca Dell'Oca
Location: Varese, Italy
Contact:

Re: Veeam B&R 6.5 jobs chain

Post by dellock6 » Nov 27, 2012 1:41 pm

danielec wrote: Real Example:
I hade a situation where a backup of a VM was slow, because someone made a snapshot... In this situation, if the VM with the snapshot that you wanto to bck is the first job in the sequence, you are unlucky ...
This easy to solve using Tom's advice, and it's the same I did at some customers: allow a proxy to run two cuncurrent jobs, and if a VM get stuck in committing a snapshot, the other pipe will run another job meanwhile.

You can also limit the load on the repository, to avoid congestion on it.

Luca.
Luca Dell'Oca
Principal EMEA Cloud Architect @ Veeam Software

@dellock6
https://www.virtualtothecore.com/
vExpert 2011 -> 2019
Veeam VMCE #1

Post Reply

Who is online

Users browsing this forum: Bing [Bot], cdsuk, DGrinev, hjanssen, s.middlebrook and 52 guests