PowerShell script exchange
Post Reply
pirx
Veeam Legend
Posts: 568
Liked: 72 times
Joined: Dec 20, 2015 6:24 pm
Contact:

get mountserver for all SOBR extents

Post by pirx »

I can get the MountHostId with "(Get-VBRBackupRepository -ScaleOut -Name $repo | Get-VBRRepositoryExtent).Repository.MountHostId". But how can I translate the MountHostId to the server name?

Code: Select all

Guid                                
----                                
0dbdf8df-f700-4f42-88f9-0c4ede2b2ce7
446a1c3e-b992-4657-abcb-ecc92b0fc48d
496d185f-f528-47ef-ad5c-c1a0a9a4cb5f
8bcf77ba-b23d-4e2e-8478-809a8cd9dae9
b1632c21-8dbf-4377-bc95-688a30084499
c3178724-8222-456e-bbf4-13539455cb94
efed6748-e646-4775-9dbb-c8a61bb2a755

As our proxy server are our mount server too, I searched there for the MountHostId, but there is no match.

Code: Select all

(Get-VBRViProxy).Id | Sort-Object -Unique

Guid                                
----                                
085652ea-aa91-4e30-b6fa-3a9c003050fd
163636c7-f498-4e54-b42e-5edff1a1c114
18b661c1-d9dc-4233-90a0-7e7b10dc2d09
326b8e9a-a7cd-4b0f-bf49-8061b79cb740
348f5644-6420-4447-96cf-d8bb83972fd2
3deea5dd-19d5-4d61-aa07-2c873c9d448c
66ac226b-3d65-4130-b30e-3d3e0ec675ee
7f4535e0-77c9-4e72-8794-6752b7078ba5
85ef412b-4779-4b58-a81d-40bc06fe7dd2
9a0d920d-b923-457c-9cec-7c18257f6c74
a8eea94d-188e-447a-b8fd-7bb447993701
bbb3c82a-dac3-4c25-b636-3e17add6e878
cae4f70e-ee14-4380-bdc5-e73f2e11b96c
f0f10765-4737-43a7-b991-973254715368
f16c3188-c0c7-4afa-9637-245a1a0041ac
fd91667c-9a85-4e1f-95c7-6fd08f4b21b7
oleg.feoktistov
Veeam Software
Posts: 1912
Liked: 635 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: get mountserver for all SOBR extents

Post by oleg.feoktistov » 2 people like this post

Hi,

MountHostId corresponds to a managed server id. Since backup proxies are built on top of managed servers and are new entities, they have separate ids. If you want to find server name by MountHostId, use Get-VBRServer:

Code: Select all

$extents = Get-VBRBackupRepository -Scaleout | Get-VBRRepositoryExtent
foreach ($extent in $extents) {
   Get-VBRServer | where {$_.Id -eq $extent.Repository.MountHostId}
} 
The same approach applies to proxies, but it's HostId property you should be retrieving from proxy object:

Code: Select all

$proxies = Get-VBRViProxy
foreach ($proxy in $proxies) {
  Get-VBRServer | where {$_.Id -eq $proxy.HostId}
}
Best regards,
Oleg
pirx
Veeam Legend
Posts: 568
Liked: 72 times
Joined: Dec 20, 2015 6:24 pm
Contact:

Re: get mountserver for all SOBR extents

Post by pirx »

Thanks, it's working now!
pirx
Veeam Legend
Posts: 568
Liked: 72 times
Joined: Dec 20, 2015 6:24 pm
Contact:

Re: get mountserver for all SOBR extents

Post by pirx »

I've a follow up. I now want to change the mount servers on a number of SOBR extents. Set-VBRBackupRepository -MountServer xxxx seems not to work as the extents are part of a SOBR and a Set-VBRServer command does not exist.
oleg.feoktistov
Veeam Software
Posts: 1912
Liked: 635 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: get mountserver for all SOBR extents

Post by oleg.feoktistov »

Since SOBR is a virtual container, extents continue to be repositories. They just hold the corresponding type nested on the backend,
so you can access it one layer down. The script below should do:

Code: Select all

$sobr = Get-VBRBackupRepository -Scaleout
$extent = Get-VBRRepositoryExtent -Repository $sobr
$server = Get-VBRServer -Name 'mounthost'
Set-VBRBackupRepository -Repository $extent.Repository -MountServer $server 
Thanks!
pirx
Veeam Legend
Posts: 568
Liked: 72 times
Joined: Dec 20, 2015 6:24 pm
Contact:

Re: get mountserver for all SOBR extents

Post by pirx »

Thanks, that was basically my fist attempt, but I was just using "Set-VBRBackupRepository -Repository $extent -MountServer $server" and not $extent.Repository.
oleg.feoktistov
Veeam Software
Posts: 1912
Liked: 635 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: get mountserver for all SOBR extents

Post by oleg.feoktistov »

You were very close :D
Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests