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: 52
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: 52
Liked: 3 times
Joined: Thu Oct 06, 2016 1:19 pm

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

Veeam Logoby signal » Thu Jun 07, 2018 11:33 am

Any feedback on this?
signal
Enthusiast
 
Posts: 52
Liked: 3 times
Joined: Thu Oct 06, 2016 1:19 pm

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

Veeam Logoby v.Eremin » Thu Jun 07, 2018 2:14 pm

I don't have 3PAR lab at hand to test your script, but since you already have at least on working job, wouldn't it be easier to clone this via PS and change only those settings that you want, instead of creating a job from the scratch? Thanks.
v.Eremin
Veeam Software
 
Posts: 14704
Liked: 1100 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

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

Veeam Logoby signal » Thu Jun 14, 2018 9:04 am

v.Eremin wrote:I don't have 3PAR lab at hand to test your script, but since you already have at least on working job, wouldn't it be easier to clone this via PS and change only those settings that you want, instead of creating a job from the scratch? Thanks.

I'm creating a deployment script to set up an entire environment. Is there a way to extract a job made in a development environment and create a similar job later?
signal
Enthusiast
 
Posts: 52
Liked: 3 times
Joined: Thu Oct 06, 2016 1:19 pm

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

Veeam Logoby v.Eremin » Thu Jun 14, 2018 2:23 pm

Establish connection to development environment, get the settings of required job, assign them to a variable, pass the variable to local environment and apply the settings stored in the variable to newly-created job. Thanks.
v.Eremin
Veeam Software
 
Posts: 14704
Liked: 1100 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

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

Veeam Logoby signal » Fri Jun 15, 2018 7:37 am

v.Eremin wrote:Establish connection to development environment, get the settings of required job, assign them to a variable, pass the variable to local environment and apply the settings stored in the variable to newly-created job. Thanks.


This is a project to deliver an automatic setup of the backup environment. I only have development and test environments, not the production. It may be reused several times, so I have scripts to configure as much as possible.

In the job options I see the .Options.RootNode.SanStorageRepositoryOptions.SanStorageRepositoryItem has RepoId, InnerXml, InnerText and OuterXml containing an identifying string (8-4-4-4-12 chars each 1-9 + a-f). I'm thinking this identifies which 3PAR system is holding the datastore(s).
Can you check with the developers how this is done in the GUI? If not, is there sone kind of proxy/capture solution I can run between the GUI and the service, like the VMware Project Onyx?
signal
Enthusiast
 
Posts: 52
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 5 guests