Modify some options of a VMware Backup Proxy object

PowerShell script exchange

Modify some options of a VMware Backup Proxy object

Veeam Logoby spp » Mon Feb 13, 2012 10:48 am

Hello,

In Veeam Backup&Replication v6, I try to programmatically change some options of a VMware Backup Proxy object.
Specifically, when now my proxy object displays "Network" as transport mode, with "Failover to network mode" unchecked, I try to say to VBR v6 that my transport mode should be "Virtual Appliance" with "Failover to network mode" option checked.

I found that VMware Proxy objects have a "SetOptions(Veeam.Backup.Core.CDomViProxyOptions)" function with a "Veeam.Backup.Core.CDomViProxyOptions" object as argument, but the VMware Proxy object has no "GetOptions()" method to retrieve those options as an object.

In other words:

I have a VMware Proxy server object displaying these attributes:

Code: Select all
PS C:\Users\Administrateur> $proxy = Get-VBRViProxy
PS C:\Users\Administrateur> $proxy.Info

Id          : 18b661c1-d9dc-4233-90a0-7e7b10dc2d09
Name        : VMware Backup Proxy
Description : Created by Veeam Backup & Replication
IsDisabled  : False
Type        : Vi
HostId      : 6745a759-2205-4cd2-b172-8ec8f7e60ef8
Options     : <ViProxyOptions><TransportMode>Nbd</TransportMode><FailoverToNetwork>False</FailoverToNetwork><UseSsl>False</UseSsl><IsAutoDetectDisks>False</IsAutoDetectDisks><MaxTasksCount>1</MaxTasksCount></ViProxyOptions>

PS C:\Users\Administrateur>




I wish to modify those attributes to display something like that in "Options":

Code: Select all
PS C:\Users\Administrateur> $proxy = Get-VBRViProxy
PS C:\Users\Administrateur> $proxy.Info

Id          : 18b661c1-d9dc-4233-90a0-7e7b10dc2d09
Name        : VMware Backup Proxy
Description : Created by Veeam Backup & Replication
IsDisabled  : False
Type        : Vi
HostId      : 6745a759-2205-4cd2-b172-8ec8f7e60ef8
Options     : <ViProxyOptions><TransportMode>HotAdd</TransportMode><FailoverToNetwork>True</FailoverToNetwork><UseSsl>False</UseSsl><IsAutoDetectDisks>False</IsAutoDetectDisks><MaxTasksCount>1</MaxTasksCount></ViProxyOptions>

PS C:\Users\Administrateur>




What can I do to have this work?

Thanks in advance for your answers.

Sorin
spp
Novice
 
Posts: 8
Liked: never
Joined: Fri Dec 16, 2011 10:18 am
Full Name: Sorin Pop

Re: Modify some options of a VMware Backup Proxy object

Veeam Logoby ThomasMc » Mon Feb 13, 2012 11:28 am

Like this :)

Code: Select all
Add-PsSnapin -Name "VeeamPSSnapIn" -ErrorAction SilentlyContinue

$proxy = Get-VBRViProxy -Name "ProxyName"
#Modes 'Auto', 'San', 'Hotadd', 'Nbd'
$proxy.Options.TransportMode = "Hotadd"
$proxy.Options.FailoverToNetwork = $true
$proxy.SaveOptions()
ThomasMc
Expert
 
Posts: 293
Liked: 17 times
Joined: Wed Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell

Re: Modify some options of a VMware Backup Proxy object

Veeam Logoby spp » Mon Feb 13, 2012 2:14 pm

Hey,

It works fine, thank you Thomas.

Sorin.
spp
Novice
 
Posts: 8
Liked: never
Joined: Fri Dec 16, 2011 10:18 am
Full Name: Sorin Pop


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 8 guests