Create 3PAR snapshot only "backup" job with powershell

PowerShell script exchange

Create 3PAR snapshot only "backup" job with powershell

Veeam Logoby signal » Wed May 09, 2018 10:41 am

I'm trying to create 3PAR snapshot jobs using powershell, but they are not working as expected.

The jobs are created, but when run there are no storage snapshots created. If I edit a job in the GUI it will start working, even though I have not edited any settings.

The code used to create a job is something like this:
Code: Select all
$SnapRepo = Get-VBRBackupRepository -Name "HPE 3PAR Snapshot"
$vCluster = Find-VBRViEntity -Name "cluster1"
$DatastoreClusters = Find-VBRViDatastoreCluster -Server $vCluster
foreach ($DatastoreCluster in $DatastoreClusters) {
  $SnapJob = Add-VBRViBackupJob -Entity $DatastoreCluster -Name "Snap Job" -BackupRepository $SnapRepo
  $SnapJob | Set-VBRJobSchedule -Daily -At "10:00" -DailyKind Everyday
  $SnapJob | Set-VBRJobAdvancedViOptions -VmAttributeName "Notes" -SetResultsToVmAttribute $true -VMToolsQuiesce $true
  $SnapJob | Set-VBRJobAdvancedNotificationOptions -SnmpNotification $false -EmailNotification $true -EmailNotificationAddress "someone@corp.tld"
  $SnapJobOpts = Get-VBRJobOptions -Job $SnapJob
  $SnapJobOpts.BackupStorageOptions.RetainCycles = 7
  $SnapJobOpts.ViSourceOptions.BackupTemplates = $false
  $SnapJobOpts.ViSourceOptions.BackupTemplatesOnce = $false
  $SnapJob | Set-VBRJobOptions -Options $SnapJobOpts
  $SnapJob | Enable-VBRJobSchedule
}#foreach


This code has not been copied, but rewritten as it is being developed in a closed network. Any typo errors are just mistypes. The jobs are created and look like they are working fine, only no store snapshots are created.

EDIT One more thing to note:
When I compare the options (Get-VBRJobOptions) for a job created using powershell and one where I have edited it in the GUI I see some extra value son the one edited in the GUI:
Code: Select all
SanStorageRepositoryOptions         : SanStorageRepositoryOptions
SourceProxyAutoDetect               : True
TargetProxyAutoDetect               : True
CheckRetention                      : True
SanSnapshotTransferEnabled          : False
SanSnapshotTransferRetention        : 14
SanSnapshotBackupBackupSource       : False
SanSnapshotReplicaTransferEnabled   : False
SanSnapshotReplicaTransferRetention : 14
SanSnapshotReplicaBackupSource      : False
NibleSnapshotTransferEnabled        : False
NibleSnapshotTransferRetention      : 14
NibleSnapshotTransferAsBackupSource : False
HpPersistentPeerEnabled             : False
HpPersistentPeerBackupSource        : False
BackupIsAttached                    : False


Is the solution to try and add these manually on the options object, or are there commands that may set these to get the job working as intended?
signal
Enthusiast
 
Posts: 46
Liked: 3 times
Joined: Thu Oct 06, 2016 1:19 pm

Re: Create 3PAR snapshot only "backup" job with powershell

Veeam Logoby signal » Wed May 16, 2018 10:54 am

I've not come any closer to a solution on this, and would appreciate any feedback.
signal
Enthusiast
 
Posts: 46
Liked: 3 times
Joined: Thu Oct 06, 2016 1:19 pm


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 3 guests