Host-based backup of VMware vSphere VMs.
lobo519
Veteran
Posts: 315
Liked: 38 times
Joined: Sep 29, 2010 3:37 pm
Contact:

Chain SureBackup Jobs

Post by lobo519 »

I have a small test ESXi host that I use as my virtual lab for my SureBackup jobs. I can't start all the VM's I want to test at one time and I would like to use application groups. I was planning on creating multiple Surebackup jobs for each application group and then chain them together so they would complete one after another.

To my suprise, unlike backup and replication jobs, the schedule start option 'After this job' is not available.

If I am doing something incorrectly please let me know but I think this would be a great enhancement.

Another thought would be to be able to add multiple application groups within a single job and add the option 'process simultaneously up to # application groups'
foggy
Veeam Software
Posts: 21069
Liked: 2115 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Chain SureBackup Jobs

Post by foggy »

If I understand your case correctly, you can use linked backup jobs instead of application groups and specify the maximum number of VMs that can be started at the same time (the Process simultaneously up to … VMs parameter at the Backup Jobs step of the SureBackup job settings). VMs from the linked job will be started X at a time. For example, by default it is set to start 3 VMs at a time and Veeam B&R creates three streams to run each VM in. After a VM is verified and powered off, the next on is started in the same stream.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Chain SureBackup Jobs

Post by veremin »

Additionally, you might want to implement PowerShell script which would be run via Windows Scheduler and which would firstly check status of the first SureBackup job and based on the returned result would trigger the subsequent SB job.

The following script might be taken as a rough example:

Code: Select all

Add-PSSnapin VeeamPSSnapin
$firstjob = Get-VSBJob -name "Name of your first job"
$secondjob = Get-VSBJob -name " Name of your first job "
If($firstjob.GetLastState() -ne "Working") {Start-VSBJob $secondjob}
Else
{
do 
{
Start-sleep -s 900 
$status = $firstjob.GetLastState()
}while ($status -eq "Working")
Start-VSBJob $secondjob
}
In general, this script firstly checks first job status and if the status isn’t equal to “Working” it starts second job.

Otherwise, it keeps checking the status with a specified delay (in the above provided example the delay is 15 minutes = 900 seconds) and when the first job finally stops, it initiates the start of the second one.

Hope this helps.
Thanks.
lobo519
Veteran
Posts: 315
Liked: 38 times
Joined: Sep 29, 2010 3:37 pm
Contact:

Re: Chain SureBackup Jobs

Post by lobo519 »

This might do the job.

thanks!
cstemaly
Enthusiast
Posts: 50
Liked: 6 times
Joined: Aug 17, 2012 12:31 pm
Contact:

[MERGED] Chaining SureBackup jobs with Powershell

Post by cstemaly »

I haven't tried this yet, so please let me know if it "just works" in the way that I want.

I have several SureBackup jobs, and I want them to run one after the other on Sunday (running 6.5 with newest patches).

I know I can call jobs like so:

get-vsbjob -name "Weekly-1" | start-vsbjob
get-vsbjob -name "Weekly-2" | start-vsbjob
get-vsbjob -name "Weekly-3" | start-vsbjob

What I need to know is whether the powershell script will wait for Veeam to finish vsbjob Weekly-1 BEFORE it starts the job called by the next line. I have 8 of these, and there's no way the system could handle all of them at once.

Thanks in advance.
foggy
Veeam Software
Posts: 21069
Liked: 2115 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Chain SureBackup Jobs

Post by foggy »

In addition to the above, there is a chance that this functionality will be included in v7 as a UI option. Thanks.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Chain SureBackup Jobs

Post by veremin »

I need to know is whether the powershell script will wait for Veeam to finish vsbjob Weekly-1 BEFORE it starts the job called by the next line
You’ve been merged to the existing discussion, so take a look at the script provided above.

The bottom line is that you need to implement auditorial part of the script that within specified interval will check status of corresponding VSB job, starting the next one, only if the first is already finished.

Hope this helps.
Thanks.
haslund
VeeaMVP
Posts: 839
Liked: 149 times
Joined: Feb 16, 2012 7:35 am
Full Name: Rasmus Haslund
Location: Denmark
Contact:

[MERGED] Chain SureBackup jobs?

Post by haslund »

Hello,

I have been forced to setup multiple Virtual Labs due to the 10 NIC limitation from VMware.
It seems it is not possible to daisy chain SureBackup jobs, is this correct?
If yes, would you please consider making this possible?
Rasmus Haslund | Twitter: @haslund | Blog: https://rasmushaslund.com
zoltank
Expert
Posts: 229
Liked: 41 times
Joined: Feb 18, 2011 5:01 pm
Contact:

[MERGED] Chaining SureBackup jobs?

Post by zoltank »

Do you know when we'll be able to start chaining SureBackup jobs?
Vitaliy S.
VP, Product Management
Posts: 27055
Liked: 2710 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Chain SureBackup Jobs

Post by Vitaliy S. »

If you want to chain your SureBackup jobs after backup/replication jobs, then you could you use this option.
zoltank
Expert
Posts: 229
Liked: 41 times
Joined: Feb 18, 2011 5:01 pm
Contact:

Re: Chain SureBackup Jobs

Post by zoltank »

That doesn't work for SureBackup jobs.

You can have a backup job linked to start after a backup job.
You can have a SureBackup job linked to start after a backup job.
You cannot have a SureBackup job linked to start after a SureBackup job.

In fact, it doesn't look like you can have anything linked to start after a SureBackup job.
Vitaliy S.
VP, Product Management
Posts: 27055
Liked: 2710 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Chain SureBackup Jobs

Post by Vitaliy S. »

Yes, that's right. In this case PowerShell script should be a solution for this. On a side note, can you please tell me a bit more about your use case for chaining SB jobs?
zoltank
Expert
Posts: 229
Liked: 41 times
Joined: Feb 18, 2011 5:01 pm
Contact:

Re: Chain SureBackup Jobs

Post by zoltank »

Vitaliy S. wrote:Yes, that's right. In this case PowerShell script should be a solution for this. On a side note, can you please tell me a bit more about your use case for chaining SB jobs?
Sure. We do a set of backups to a Veeam server located in remote part of the building, and it isn't in a very secure location, therefore we use self encrypting drives and have Veeam encryption also turned on. It doesn't have the fastest disk subsystem either, so it's definitely on the slow side for SureBackup. An application group of a DC and the Exchange 2010 witness server are required to check our Exchange backup job. However, the extra IO requirement for the application group frequently makes SureBackup for VMs in other backup jobs fail since they just can't start in time (and allocating 30 minutes for each VM to start isn't feasible). Our solution is to run a SureBackup job just for Exchange with it's application group, and then a second SureBackup job without the application group for everything else.
Anders
Enthusiast
Posts: 58
Liked: 12 times
Joined: Sep 09, 2010 9:45 am
Full Name: Anders Lorensen
Contact:

[MERGED] : Surebackup Job scheduling options

Post by Anders »

Hi everyone

I have an issue with scheduling Surebackup jobs.

I have 15 jobs that all use the same Lab that I want to run every Monday and Thursday. I want them all to run right after each other.

When 1 job starts and another is not finished, the job ends with an error saying the lab is in use, instead of just waiting for the lab to be available.

I cannot Schedule jobs with the "After job", as Surebackup jobs are not in that list (why is that? I find it strange you cannot run a tape job to copy the job to tape, after the files are testet)

The only solution I can see is to time every job with a worst case scenario, and manually figure out when each job needs to start. This is alot of Work, and will break when someone creates a new VM. Not very smart.

If that is really the only way to do it, consider this a feature request to be able to use "After job" with surebackup jobs, and/or let a job wait for a lab to be ready, instead of just aborting, when it is in use.

Version is V9 RTM.

Thanks,
Anders
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Chain SureBackup Jobs

Post by veremin »

Hi, Andreas,

You can use the script provided above to chain surebackup activity.

Thanks.
zoltank
Expert
Posts: 229
Liked: 41 times
Joined: Feb 18, 2011 5:01 pm
Contact:

Re: Chain SureBackup Jobs

Post by zoltank »

Any chance of this making it into the UI soon? It has been three years now...
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Chain SureBackup Jobs

Post by veremin »

At the moment situation is still the same. So, usage of scripts is still required if you're after chaining SB jobs. Thanks.
zoltank
Expert
Posts: 229
Liked: 41 times
Joined: Feb 18, 2011 5:01 pm
Contact:

Re: Chain SureBackup Jobs

Post by zoltank »

Is it even on the roadmap to include this functionality directly in the UI?
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Chain SureBackup Jobs

Post by veremin »

Unfortunately, we do not share features' roadmap. Thanks.
JoshuaPostSAMC
Expert
Posts: 124
Liked: 22 times
Joined: Jul 30, 2015 7:32 pm
Contact:

Re: Chain SureBackup Jobs

Post by JoshuaPostSAMC »

Add me to the list of users requesting chaining SureBackup jobs in the GUI and not needing an external script.

I have 13 SureBackup jobs that compliment my Backup jobs, but I want to run them when all backups are done, not immediately after each job completes. Running on a weekend is preferred. Each job has several Advanced settings under the linked job to accomodate servers that take longer to boot or have custom ports to check. If I put everything into one job, it is difficult to test and check a subset, but when I have the time window, I want all of them to run, so I want each to follow the previous while still being able to run an ad-hock job for just my SQL servers as needed without having to maintain two jobs with advanced settings, the job of just SQL servers and the job with all of the servers.
JoshuaPostSAMC
Expert
Posts: 124
Liked: 22 times
Joined: Jul 30, 2015 7:32 pm
Contact:

Re: Chain SureBackup Jobs

Post by JoshuaPostSAMC »

It is quite silly that chaning a SureBackup job to run after another SureBackup job completes is still not part of the included functionality.

I was playing around with the powershell script because I have two virtual labs that I want to split the load between and I want to run 6 jobs sequentially on each. As I was testing how to re-write the old script referenced in this thread, I noticed that when I started a SureBackup job in powershell, it was waiting for that job to complete before moving on in the script.
Doing a "get-help start-vsbjob" shows me that there is a -RunAsync that seems like it would overcome this, but running syncronous is what I want. So I might just need to list all jobs associated to a Lab and then send the start commant to that result and maybe it will run them syncronous and not need a complex script to check to see when an earlier job completes?
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Chain SureBackup Jobs

Post by veremin »

I thought I'd rewritten the script already, but it doesn't seem to be the case.

You're right that you don't job status checking portion is unnecessary. If you want to run jobs sequentially, create a variable containing SB job names separated by comma, then, add a cycle within which jobs get executed one by one:

Code: Select all

asnp VeeamPSSnapin
$Names = "First name", "Second name", etc.
foreach ($Name in $Names)
{
    Get-VSBJob -Name $Name | Start-VSBJob
}
Thanks.
JoshuaPostSAMC
Expert
Posts: 124
Liked: 22 times
Joined: Jul 30, 2015 7:32 pm
Contact:

Re: Chain SureBackup Jobs

Post by JoshuaPostSAMC » 1 person likes this post

You don't even have to do a For loop through them. If you use Get-VSBJob to collect the jobs you want, you can issue one Start-VSBJob against it. I'm running two scripts that look for all jobs associated with a single Virtual Lab, excluding a one-off test job, and then starting them at 3 am.

Code: Select all

Add-PsSnapin VeeamPSSnapIn
$VeeamServer = 'BackupServerName'

Connect-VBRServer -server $VeeamServer

$VirtualLab = Get-VSBVirtualLab -name "Veeam Virtual Lab 1"
$SureBackupJobs = Get-VSBJob | where-object {$_.VirtualLabId -eq $VirtualLab.Id} | where {$_.name -notlike 'SureBackup Individual*'}  | sort Name

Start-VSBJob $SureBackupJobs
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Chain SureBackup Jobs

Post by veremin »

You've nailed it, this way or the other the original script has been reduced dramatically. :)
zoltank
Expert
Posts: 229
Liked: 41 times
Joined: Feb 18, 2011 5:01 pm
Contact:

Re: Chain SureBackup Jobs

Post by zoltank »

Any chance we'll be getting this with the new update?
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Chain SureBackup Jobs

Post by veremin »

As far as I'm concerned, no. The provided scripts are still a way to go. Thanks.
JoshuaPostSAMC
Expert
Posts: 124
Liked: 22 times
Joined: Jul 30, 2015 7:32 pm
Contact:

Re: Chain SureBackup Jobs

Post by JoshuaPostSAMC »

Do you mean that you don't consider it important enough to become a feature, or do you mean that you aren't aware of it coming in the next update?
Vitaliy S.
VP, Product Management
Posts: 27055
Liked: 2710 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Chain SureBackup Jobs

Post by Vitaliy S. »

Vladimir meant to say that since there is a workaround and we have other major features pending that would be useful for our existing users, right now we cannot commit to any date when this feature is going to be available in the product.
JoshuaPostSAMC
Expert
Posts: 124
Liked: 22 times
Joined: Jul 30, 2015 7:32 pm
Contact:

Re: Chain SureBackup Jobs

Post by JoshuaPostSAMC »

Hmmm. So almost 4 years later and there still isn't enough development time to include the ability to run a SureBackup job after another SureBackup job completes, just like you already support for Backup jobs?
Vitaliy S.
VP, Product Management
Posts: 27055
Liked: 2710 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Chain SureBackup Jobs

Post by Vitaliy S. »

While I do realize that this functionality might be really important to you and might seem like an easy UI change that would allow chaining, please be aware that this functionality affects other parts/functionality of the Veeam backup server. Every release pending features are prioritized based on the value they bring to the customers and required development/QA times, that's why some of the features are re-scheduled to future releases. Thank you for your understanding.
Post Reply

Who is online

Users browsing this forum: No registered users and 84 guests