none
Use DPM to backup Weekly Veeam job to tape RRS feed

  • Question

  • We've just started using Veeam to backup our VM's.  I'd like to include the most recent Veeam .vbk file in our weekly dpm backup to tape.  I don't think there's any way in to specify a single file to be backed up, so I'm trying to come up with a process that does what I need.  

    Currently, I'm looking at creating a powershell script to run after the veeam job completes that will:

    Move the VBK file to another directory

    Trigger a DPM backup for the protection group which targets that directory

    Move the vbk file back to the original directory after the DPM backup is complete.

    Is there a better way to do this?  And if not, can anyone suggest how I might be able to kick off the dpm job and monitor it's status so I can move the file back when the dpm job is done?

    Tuesday, July 16, 2013 4:50 PM

Answers

  • Hi,

    You can use pre and post backup scripts to accomplish that:

    Using pre-backup and post-backup scripts
    http://technet.microsoft.com/en-us/library/jj244602.aspx



    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Mike J. [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, July 16, 2013 5:45 PM
    Moderator

All replies

  • Hi,

    You can use pre and post backup scripts to accomplish that:

    Using pre-backup and post-backup scripts
    http://technet.microsoft.com/en-us/library/jj244602.aspx



    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread. Regards, Mike J. [MSFT] This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, July 16, 2013 5:45 PM
    Moderator
  • Hmm... I hadn't considered it, but using pre/post backup scripts on the dpm side might make more sense than a post backup script on the veeam side.  Thanks!
    Tuesday, July 16, 2013 6:33 PM
  • Okay, here's what I ended up doing, in case it's helpful to someone else in the future.

    I created a pre-job script and Post job script attached to the dpm backup. 

    I think I lost a bit of functionality by not using the Veeam PS Snap in, such as checking whether the backup was successful before copying the file, but that shouldn't be an issue very often.  Once I realized the PS Snap-In wasn't installed on the repository server, I found that the veeam setup file won't install the snap-in unless you're installing the full veeam b&r console.  There may be another way to get it, but I didn't bother digging too much.  

    DPMPreScript.ps1

    # This Pre-script runs before DPM backs up anything on the D: drive.
    # The script moves the most recent full backup (.vbk) file from Veeam to a separate folder backed up by dpm.
    # After the DPM job is complete, a separate script (dpmpostscript.ps1) is executed to move the file back to the Veeam Backup Folder
    
    # VeeamBackupFolder Should be the the directory containing the output files (.vbk, .vib, .vrb) from the Veeam backup job
    # DPMProtectedFolder should be the directory being backed up by a DPM Protection Group
    
    $VeeamBackupFolder = "D:\Backups\Main VM Backup\"
    $DPMProtectedFolder = "D:\Backups\ToDPM\"
    $FullBackupFile = "*.vbk"
    $FileExists = (Test-Path $VeeamBackupFolder\$FullBackupFile -Pathtype Leaf)
    
    If ($FileExists)
    {
        $VeeamBackupFile = get-childitem $Veeambackupfolder *.vbk | Sort-Object {$_.LastWriteTime} -Descending | select-object -First 1
        move-item $VeeamBackupFolder\$VeeamBackupFile $DPMProtectedFolder
    }
    ElseIf (!($FileExists))
    {
        Write-Host "No full backup (.vbk) files found in " $VeeamBackupFolder
    }


    DPMPostScript.ps1

    # This Post-Job script runs after DPM backs up anything on the D: drive.
    # The script reverts the file(s) moved by the Pre-Job Script back to their original location, the Veeam backup folder. 
    # VeeamBackupFolder Should be the the directory containing the output files (.vbk, .vib, .vrb) from the Veeam backup job
    # DPMProtectedFolder should be the directory being backed up by a DPM Protection Group
    $VeeamBackupFolder = "D:\Backups\Main VM Backup\"
    $DPMProtectedFolder = "D:\Backups\ToDPM\"
    $FullBackupFile = "*.vbk"
    $FileExists = (Test-Path $DPMProtectedFolder\$FullBackupFile -Pathtype Leaf)
    If ($FileExists)
    {
        move-item $DPMProtectedFolder\$FullBackupFile $VeeamBackupFolder
    }
    ElseIf (!($FileExists))
    {
        Write-Host "No full backup (.vbk) files found in " $DPMProtectedFolder
    }


    To set DPM to run these scripts, I had to modify "c:\Program Files\Microsoft Data Protection Manager\DPM\Scripting\ScriptingConfig.xml" on the Veeam repository server.  The file already exists, I just had to add the "DatasourceScriptConfig" section.

    ScriptingConfig.xml

    <?xml version="1.0" encoding="utf-8"?>
    <ScriptConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
     xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
     xmlns="http://schemas.microsoft.com/2003/dls/ScriptingConfig.xsd">
     <DatasourceScriptConfig DataSourceName="D:">
         <PreBackupScript>"C:\Scripts\DPMPreScript.ps1"</PreBackupScript>
         <PostBackupScript>"C:\Scripts\DPMPostScript.ps1"</PostBackupScript>
         <TimeOut>30</TimeOut>
       </DatasourceScriptConfig>
    </ScriptConfiguration>



    • Edited by NeighborGeek Thursday, July 18, 2013 3:48 PM Corrected Formatting
    Thursday, July 18, 2013 3:46 PM
  • Hmm... the scripts work perfectly when I run them manually, but when the DPM job kicks off, it fails because of a pre-script time out.  Do I have somethign wrong in the scriptingconfig.xml ? 

    Edit: It looks like powershell scripts must not be supported.  I've created new files c:\scripts\startprescript.cmd and startpostscript.cmd then changed scriptingconfig.xml to point to these.

    The contents of the cmd files are just a command line to launch the matching powershell script:

    Powershell.exe -executionpolicy remotesigned -noninteractive -noprofile -file C:\Scripts\DPMPreScript.ps1

    • Edited by NeighborGeek Monday, July 22, 2013 6:35 PM Added info
    Monday, July 22, 2013 1:49 PM
  • New version of Veeam Backup & Replication (v7), coming in August or September, will support tape. You can find more info about the new feature on their official web-site or at Veeam Community Forums. 
    Thursday, August 1, 2013 7:49 AM
  • Gai-jin,

    The new version of Veeam Backup & Replication was released today and it now supports tape. You can learn about all of the other features and enhancements here - What's new in v7. Please let us know how you like the new version.


    #1 VM backup for VMware and Hyper-V


    • Edited by Maksim K Thursday, August 15, 2013 5:12 PM
    Thursday, August 15, 2013 5:11 PM
  • Veeam's tape support is unfortunately not of use in our situation.  Glad the feature exists, but it's not a fit for us. 
    Wednesday, February 19, 2014 3:24 PM
  • Gai-jin, could you please elaborate on your situation a bit, why do you assume Veeam B&R tape functionality cannot be used in your scenario?
    Friday, February 21, 2014 3:46 PM
  • Our tape library is connected to the DPM server via SCSI.  Veeam lives in a VM on another box.  Short of moving veeam to the dpm server and trying to schedule the two different programs usage of the tape drive around each other, Veeam can't talk to the tape library.  It's easier to just have DPM backup the output from veeam to tape.
    Friday, February 21, 2014 3:57 PM