Creating Hyper-V Backup Job

This example shows how to create a Hyper-V backup job for a CRM database server, then add another CRM database server to this job and set the additional options.

You will need to perform the following steps:

  1. Create the backup job by running Add-VBRHvBackupJob. You will need to get the VM that you will add to the job and the backup repository to store its backups. Use Find-VBRHvEntity and Get-VBRBackupRepository.
  2. If you want to add another VM to the created job, get the job with Get-VBRJob and run Add-VBRHvJobObject.
  3. Configure a schedule with Set-VBRJobSchedule and apply it to the job. Remember to enable the schedule with Enable-VBRJobSchedule.
  4. Add advanced job options: schedule a synthetic and an active full backup with Set-VBRJobAdvancedBackupOptions.

# Create a backup job:

$crm = Find-VBRHvEntity -Name "CRMdb_01"

$repository = Get-VBRBackupRepository -Name 172.16.03.119

Add-VBRHvBackupJob -Name "CRM Backup" -Entity $crm -BackupRepository $repository

 

# Add another VM to the job:

$crmjob = Get-VBRJob -Name "CRM Backup"

Find-VBRHvEntity -Name "CRMdb_02" | Add-VBRHvJobObject -Job $crmjob

 

# Configure job schedule and enable it:

Get-VBRJob -Name "CRM Backup" | Set-VBRJobSchedule -Daily -At "21:00" -DailyKind Weekdays | Enable-VBRJobSchedule

 

# Set synthetic full and active full schedule:

Get-VBRJob -Name "CRM Backup" | Set-VBRJobAdvancedBackupOptions -TransformFullToSyntethic -TransformIncrementsToSyntethic -TransformToSyntethicDays Sunday -EnableFullBackup-FullBackupScheduleKind Monthly -DayNumberInMonth Last -FullBackupDays Sunday