PowerShell script exchange
y1008946
Enthusiast
Posts: 93
Liked: never
Joined: Sep 23, 2013 3:56 pm
Contact:

Map Backup Comman

Post by y1008946 »

Hi, I'm trying to create a backup job which maps the backup to a backup file in the repository.

Is there a powershell command to set the map backup stage of the backup job wizard?

Thanks

y1008946
Enthusiast
Posts: 93
Liked: never
Joined: Sep 23, 2013 3:56 pm
Contact:

Re: Map Backup Comman

Post by y1008946 »

Not able to edit my original request.

Is it possible to set the 'map backup' location of an existing backup job?

Thanks

Vitaliy S.
Product Manager
Posts: 24081
Liked: 1808 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Map Backup Comman

Post by Vitaliy S. »

I don't believe re-mapping is required here. Can you please confirm that repository rescan option doesn't update the number of restore points?

y1008946
Enthusiast
Posts: 93
Liked: never
Joined: Sep 23, 2013 3:56 pm
Contact:

Re: Map Backup Comman

Post by y1008946 »

Hi, just to confirm the steps I have done to test it.

- run a backup job

- run the corresponding backup copy job to send the backup to the offsite server

- rescanned the repository

The dummy backup job doesnt reflect the new restore point though.

Thanks Vitaliy

y1008946
Enthusiast
Posts: 93
Liked: never
Joined: Sep 23, 2013 3:56 pm
Contact:

Re: Map Backup Comman

Post by y1008946 »

Hi Vitaliy, i've spent some time testing and tried it a few times. The steps I have found need to be carried out to update the restore points are:

- remove the vm from application group

- delete the backup from Backups -> Disk

- rescan the repository

- it adds the backup into Backups -> Imported

- in the dummy backup job map the backup to the imported backup

- add the dummy backup in to the application group

The steps do take a while to carry out. I dont know if there is a way to create a powershell script for them?

Thanks

Vitaliy S.
Product Manager
Posts: 24081
Liked: 1808 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Map Backup Comman

Post by Vitaliy S. »

Daniel,

Our QC team has tried to reproduce various scenarios of using backup copy and SureBackup jobs and here is the result.

Please be aware that this method is officially not supported, as you need to verify your backup prior sending them to the offsite location. Here you go the instructions on how to make it work:

1. Install Veeam B&R console on the site used as a target for the backup copy job
2. Create and add backup repository where backup copy job stores its files.
NOTE: repository type cannot be CIFS share.
3. Run a rescan job to populate backup console with backup copy job files.
4. Add ESXi host you want to start SureBackup jobs on
5. Create SB virtual lab
6. Create application group by adding VMs from the rescanned repository.

PS command example:

Code: Select all

Add-VSBViApplicationGroup –Name “AG” –RestorePoint (Get-VBRRestorePoint -Name <VM_Name>)
7. Create SureBackup job with this application group via GUI.
8. Prior starting the SB job, run a rescan job on demand using this cmdlet:

Code: Select all

Sync-VBRBackupRepository -Repository (Get-VBRBackupRepository -Name <Repository_name>)
9. Start SureBackup job.
NOTE: Make sure backup copy job is idle state, otherwise your SB job will fail.

P.S. Kudos to Nikita for these guidelines.

y1008946
Enthusiast
Posts: 93
Liked: never
Joined: Sep 23, 2013 3:56 pm
Contact:

Re: Map Backup Comman

Post by y1008946 »

Hi, thanks for this its great.

It hasnt worked for me though unfortunately.

I have tried quite a few times and what I have found is that the imported backups do update in the repository.

But when running the surebackup job the restore points dont update...

So for example:

- I create a backup of a VM at 10:00 and copy it offsite

- create an application goup and surebackup job in the offsite server

- run the surebackup job and it says the restore point is from 10:00. Surebackup job is a success.

- I create another backup of the same VM at 12:00 and copy it offsite

- rescan the repository in the offsite server. In the imported backups of the offsite server it correctly shows the last two restore points are 12:00 and 10:00.

- I run the surebackup job and it says the restore point is from 10:00.

The only way I have found which works is to remve the surebackup job and the application group, then re-add them :?

Do you not find the same thing?

Thanks very much

Vitaliy S.
Product Manager
Posts: 24081
Liked: 1808 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Map Backup Comman

Post by Vitaliy S. »

Did you create any mapping jobs? If this is the case then you don't need to do that.

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

Re: Map Backup Comman

Post by veremin »

I run the surebackup job and it says the restore point is from 10:00
Also, have you tried to use "Start to" option? Does it make any difference? Thanks.

y1008946
Enthusiast
Posts: 93
Liked: never
Joined: Sep 23, 2013 3:56 pm
Contact:

Re: Map Backup Comman

Post by y1008946 »

Hi, I've tried t again and it seems to be working!

Thanks for all your help it works great!


I think the key was in how to create the application group using powershell.

When I started originally I was using a similar way, the powershell command created the application group but it didnt update the restore points each day. This is the powershell command I had used:

Code: Select all

$ibfOibs = (Get-VBRBackup -Name "DC01 Backup Copy to Offsite").GetLastBackupOibs()
Add-VSBApplicationGroup -Name "Test App Group" -RestorePoint $ibfOibs

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

Re: Map Backup Comman

Post by veremin »

Glad to hear that now everything works fine. Feel free to ask, if any additional help is needed. Thanks.

OmiFreak
Influencer
Posts: 15
Liked: 2 times
Joined: Apr 26, 2011 4:11 pm
Full Name: Bernd Flatz
Contact:

Re: Map Backup Comman

Post by OmiFreak »

Hi,

I also try to use a copy job as source for a SureBackup. I tried the powershell command above but get some errors:

Add-VSBViApplicationGroup –Name “FSR_DEERL” –RestorePoint (Get-VBRRestorePoint -Name emma)


Add-VSBViApplicationGroup : Failed to process RestorePoint 61dd428e-2d2d-4a9c-b4de-73c206180b52. Job type BackupSync
is not supported
At line:1 char:1
+ Add-VSBViApplicationGroup –Name “FSR_DEERL” –RestorePoint (Get-VBRRestorePoint - ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [Add-VSBViApplicationGroup], Exception
+ FullyQualifiedErrorId : AddViApplicationGroupId,Veeam.Backup.PowerShell.Command.AddVSBViApplicationGroup


If I try this command:
$ibfOibs = (Get-VBRBackup -Name "DE-ERL_copy").GetLastBackupOibs()

I get:
Method invocation failed because [Veeam.Backup.Core.CBackup] does not contain a method named 'GetLastBackupOibs'.
At line:1 char:1
+ $ibfOibs = (Get-VBRBackup -Name "DE-ERL_copy").GetLastBackupOibs()
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : MethodNotFound


I replicate the branch office backup to our headquarter and should verify here some things, verify at the original location is not a option.

Regards,
Bernd

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

Re: Map Backup Comman

Post by veremin »

If you're willing to verify backups created by backup copy jobs, kindly, stick to the approach described here. Thanks.

OmiFreak
Influencer
Posts: 15
Liked: 2 times
Joined: Apr 26, 2011 4:11 pm
Full Name: Bernd Flatz
Contact:

Re: Map Backup Comman

Post by OmiFreak »

Thank you for the link but this is the approach from Vitaliy I tried (is also on this site).

I think the problem in my case is that I have only one Veeam Backup Server world-wide.
This server is already at the site I want to make the verify.
The backup is from a branch office where I only have a backup proxy installed.
If I now create the application pool with this powershell command:
Add-VSBViApplicationGroup –Name “AG” –RestorePoint (Get-VBRRestorePoint -Name <VM_Name>)
It tries to add every restore point it finds for this VM, from Tape jobs and from the original backup job, which is managed from this backup server as well.
The SureBackup job tries to use then the normal backup job restore point from the WAN location.

Regards,
Bernd

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

Re: Map Backup Comman

Post by veremin »

Not sure whether it helps, but you can try to create dummy backup jobs, map them on the files created by backup copy jobs, and then create SureBackup jobs, using the dummy ones. Before running surebackup jobs, you might want to disable backup copy ones temporarily.

OmiFreak
Influencer
Posts: 15
Liked: 2 times
Joined: Apr 26, 2011 4:11 pm
Full Name: Bernd Flatz
Contact:

Re: Map Backup Comman

Post by OmiFreak »

Okay I created a dummy backup job with the VM in the branch office and map the job to the backup copy job files in the local repository. I use the dummy backup job as source in the application pool, it looks good because it shows the two VMs in this backup copy job.
But when I start the SureBackup job it fails powering on the VM and in the log file it looks like it still try to use the remote repository in the branch office as source.

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

Re: Map Backup Comman

Post by veremin »

Then, I think that stanby backup console deployed at remote site and used mostly for backup copy job verification sounds like the best idea. Thanks.

DaveVernon
Novice
Posts: 3
Liked: 1 time
Joined: Oct 02, 2015 2:05 pm
Full Name: Dave Vernon
Contact:

Re: Map Backup Comman

Post by DaveVernon » 1 person likes this post

v.Eremin wrote:Not sure whether it helps, but you can try to create dummy backup jobs, map them on the files created by backup copy jobs, and then create SureBackup jobs, using the dummy ones. Before running surebackup jobs, you might want to disable backup copy ones temporarily.
A thousand thank-you's for this! I needed to do a one-of SureBackup to pull some data out of an application that I had to restore from my tape archives. This particular application really needs to run in the SureBackup isolated environment to get the data exported. This suggestions worked perfectly.

cgranitz
Novice
Posts: 3
Liked: never
Joined: Feb 10, 2016 7:55 pm
Full Name: Chris Granitz
Contact:

Re: Map Backup Comman

Post by cgranitz »

I would like to consider using the manual method of running SureBackup jobs against our Backup Copy repository that was posted by Vitaliy S. a while ago, but I have some questions...

Can the Veeam B&R console be installed on a Windows 7 VM running on the ESXi host that is being used to run the SureBackup jobs at the Backup Copy site ?

Our repository at that site is a Windows 2012 R2 server running Windows Storage Spaces on JBOD disks. Would it be better to install the Veeam B&R console on that server instead ?

-- ChrisG

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

Re: Map Backup Comman

Post by veremin »

Are you backing up VMs running Windows Server 2012 (R2) with Deduplication role enabled? If not, it's up to install a backup server on whatever machine you want, as long as it meets system requirements. Thanks.

cgranitz
Novice
Posts: 3
Liked: never
Joined: Feb 10, 2016 7:55 pm
Full Name: Chris Granitz
Contact:

Re: Map Backup Comman

Post by cgranitz »

Yes, I am backing up VMs that are running Windows Server 2012 R2 with the Deduplication role enabled. Does that mean I should install the Veeam B&R console on a Windows 7 VM on the ESXi host that will run the Surebackup jobs at the remote site where the Backup Copy data repository resides ?

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

Re: Map Backup Comman

Post by veremin »

In that case you'd better enable Data Deduplication role on your repository and install a backup console on that server, instead of deploying it on Windows 7 VM. Otherwise, file-level restore operations for those VMs are likely to fail. Thanks.

TheMonk
Influencer
Posts: 24
Liked: never
Joined: Jun 17, 2015 3:03 pm
Full Name: Chris Armitage
Contact:

Re: Map Backup Comman

Post by TheMonk »

Hi there, I used to be able to use the way that is described on the first page of this section. However recently when I try to use a copy job in a surebackup I get the following error:
Error: Operation is not valid due to current state of the object.

Ive checked the backup copy job that produces the copy and the status of that job is idle, so im a bit puzzled? any suggestions?

Vitaliy S.
Product Manager
Posts: 24081
Liked: 1808 times
Joined: Mar 30, 2009 9:13 am
Full Name: Vitaliy Safarov
Contact:

Re: Map Backup Comman

Post by Vitaliy S. »

Can you please tell us what changes were made to the infrastructure? Do you have this issue for all jobs/VMs?

TheMonk
Influencer
Posts: 24
Liked: never
Joined: Jun 17, 2015 3:03 pm
Full Name: Chris Armitage
Contact:

Re: Map Backup Comman

Post by TheMonk »

Vitaliy S. wrote:Can you please tell us what changes were made to the infrastructure? Do you have this issue for all jobs/VMs?
Only thing that has changed is we have moved hosts and new vcenters.

THe time time I get this issues is when trying to run a Surebackup job using a copyjobs backups.

I run the commands mentioned on this post, which re-syncs the jobs, adds the servers to an application group and then when I create and run the surebackup with that application group I get the error.

The backupCopy jobs are in IDLE status.

I know doing surebackups this way isn't supported but obviously was using the workround, mainly because like others I wish to use labs with servers from my various sites for testing purposes etc

Vek17
Service Provider
Posts: 49
Liked: 15 times
Joined: May 29, 2018 8:42 pm
Contact:

[MERGED] Map Backup to Job

Post by Vek17 »

Looking for a way to map a backup to a job via powershell. I haven't come across any mechanism to do this so far, is this something that is possible at all (supported or otherwise).

bnunez
Novice
Posts: 3
Liked: never
Joined: Sep 10, 2018 5:12 pm
Full Name: Brandon Nunez
Contact:

Re: Map Backup to Job

Post by bnunez »

Get-VBRBackup objects have multiple attributes which you can use to relate the data. Namely 'JobName' and 'JobID'.

Code: Select all

$backups = Get-VBRBackup
foreach ($backup in $backups) {
        Get-VBRJob | Where-Object {$_.Name -eq $backup.JobName}
}

Vek17
Service Provider
Posts: 49
Liked: 15 times
Joined: May 29, 2018 8:42 pm
Contact:

Re: Map Backup to Job

Post by Vek17 »

Sure and that is simple enough, but was not what I was looking for. Perhaps I was unclear.

I am looking for a way to map a backup to a job to the same effect one would do in the UI, not a way to correlate which backups are linked to what jobs.

Image

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

Re: Map Backup Comman

Post by veremin »

Your post has been merged into existing discussion, kindly, check the workaround provided above. Thanks.

Vek17
Service Provider
Posts: 49
Liked: 15 times
Joined: May 29, 2018 8:42 pm
Contact:

Re: Map Backup Comman

Post by Vek17 » 2 people like this post

While this thread did not contain any usable workarounds I did end up finding something I can use (Though I need to test more as this is unsupported and can result in breaking changes)

Code: Select all

$SourceBackup.Update($TargetJob)
Where $SouceBackup is the backup you want to map and $TargetJob is the Job that needs to use the backup. Things look good as long as you are using the same directories but get very broken if you swap repos. This will most likely work for the use case I have but I would recommend anyone who may wish to do this to test sufficiently first as this is not a supported solution and will allow you to break things.

Post Reply

Who is online

Users browsing this forum: No registered users and 9 guests