PowerShell script exchange
Post Reply
spp
Novice
Posts: 8
Liked: never
Joined: Dec 16, 2011 10:18 am
Full Name: Sorin Pop
Contact:

Modify some options of a VMware Backup Proxy object

Post by spp »

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
ThomasMc
Veteran
Posts: 293
Liked: 19 times
Joined: Apr 13, 2011 12:45 pm
Full Name: Thomas McConnell
Contact:

Re: Modify some options of a VMware Backup Proxy object

Post by ThomasMc »

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()
spp
Novice
Posts: 8
Liked: never
Joined: Dec 16, 2011 10:18 am
Full Name: Sorin Pop
Contact:

Re: Modify some options of a VMware Backup Proxy object

Post by spp »

Hey,

It works fine, thank you Thomas.

Sorin.
Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests