PowerShell script exchange
Post Reply
uk1984
Service Provider
Posts: 58
Liked: 4 times
Joined: Dec 04, 2023 10:00 am
Full Name: Udo Kloos
Contact:

un-/assign Gateway server from/to Backup Repositories

Post by uk1984 »

We have many repositories (NFS) and many Gateway servers (SLES15).

And we are looking for a solution where we can un-assign certain Gateway servers basically from all or certain Backup Repositories
and then re-assign them again after some hours.

Reason:
The SLES15 Gateway servers need to be patched at least once a month by our linux team and at the end they will also do
a reboot of the servers. And when the Gateways Servers are still being used by VBR (in jobs) we will get errors which
we want to avoid.
Sadly for the Gateway Servers there is no "global" option to disable them, like it is the case with for the proxies...
(I hope with V13 we will also be able to "disable" certain Gateway server globally)

So we a "maintenance plan" where we did split everthing to 3 days.
Then we can assure that still enough GW servers at a time are present for our workloads.

So normally almost "all" gateway servers are assigned to almost all NFS repositories.

Patchday1:
unassign 2 gw servers, like 2 hours before patching
patching
reassign the pacthed 2 gw servers

Patchday2:
unassign 2 other gw servers, like 2 hours before patching
patching
reassign the pacthed 2 gw servers

Patchday3:
unassign 2 other gw servers, like 2 hours before patching
patching
reassign the pacthed 2 gw servers

Best Regards
david.domask
Veeam Software
Posts: 3071
Liked: 710 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: un-/assign Gateway server from/to Backup Repositories

Post by david.domask »

Hi uk1984,

Use Set-VBRBackupRepository with the -Server parameter.

Populate an array in advance with the desired gateway servers (fetch them using Get-VBRServer), then pass that array to the -Server parameter. You'd simply exclude the server that's undergoing maintenance from the array.

Quick example:

Code: Select all

$server = @()
$server += Get-VBRServer -Name 'Example1'
$server += Get-VBRServer -Name 'Example2'
$repo = Get-VBRBackupRepository -Name "nfs"
Set-VBRBackupRepository -Repository $repo -AutoSelectGateway:$false -Server $server

#removing gateway server Example1 from gateway list

$server = @()
$server += Get-VBRServer -Name 'Example2'
Set-VBRBackupRepository -Repository $repo -AutoSelectGateway:$false -Server $server
David Domask | Product Management: Principal Analyst
uk1984
Service Provider
Posts: 58
Liked: 4 times
Joined: Dec 04, 2023 10:00 am
Full Name: Udo Kloos
Contact:

Re: un-/assign Gateway server from/to Backup Repositories

Post by uk1984 »

Hi David,

from my perspective it would be ideal to do a "fetch" of all defined repositories and GW servers are assigned (set to active).
Then "subtract" certain gw servers for the mainteance/patching.
And afterwards restore to the original state.

But I think there is no option/command to "read out" the current active gw servers from a repository?
Since you only have "set" and no "get"...

Best Regards
Udo
david.domask
Veeam Software
Posts: 3071
Liked: 710 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: un-/assign Gateway server from/to Backup Repositories

Post by david.domask »

Hi Udo,

Understood, and will consider that as a potential future improvement.

For now you can get a list of the of the assigned gateways with the following unsupported method:

Code: Select all

$repo = Get-VBRBackupRepository -Name "*-nfs"
$repo.GetAssignedGateways()


Info               : REPO-DR.lab.intern (Microsoft Windows server)
ParentId           : 00000000-0000-0000-0000-000000000000
Id                 : 835568a0-fefc-49fe-957d-23320640cce3
Uid                : 835568a0fefc49fe957d23320640cce3
Name               : REPO-DR.lab.intern
Reference          :
Description        : Created by VBR-01\Administrator at 3/10/2019 12:57 PM.
IsUnavailable      : False
Type               : Windows
ApiVersion         : Unknown
PhysHostId         : f4c916fb-c94c-436c-afbf-d7890e45a499
ProxyServicesCreds : Veeam.Backup.Common.CCredentials
(Note: There is a Host property that returns gateways, but it only returns first gateway in the list)
David Domask | Product Management: Principal Analyst
Post Reply

Who is online

Users browsing this forum: No registered users and 37 guests