RESTful knowledge exchange
Post Reply
Dossing
Influencer
Posts: 19
Liked: 2 times
Joined: May 17, 2021 11:40 am
Full Name: Søren Døssing
Location: Denmark
Contact:

Possible to PUT settings to Backup Server?

Post by Dossing »

Hi Veeam experts,

In short my goal is to change the portRangeEnd to a lower number.
I wan't to change this for the Backup Server using RESTful API.

My obstical is the credentialsId which is a required field: https://helpcenter.veeam.com/docs/backu ... &t=request

But the credentialsId for the Backup Server is null or "00000000-0000-0000-0000-000000000000".

I've tried with both the null, an empty string, an empty array, returns = "managedServerModel.CredentialsId : 'Credentials Id' must not be empty.

A " " (space) returns = Error converting value \" \" to type 'System.Nullable`1[System.Guid]'. Path 'credentialsId', line 6, position 25. 'Credentials Id' must not b
e empty.

and the value "00000000-0000-0000-0000-000000000000" returns = "Invalid Windows credentials."


No luck so far, any inputs are welcome.. thanks :?:
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Possible to PUT settings to Backup Server?

Post by oleg.feoktistov »

Hi,

It looks like the PUT request works if you input real credentialsId from VBR console. In my case I sent PUT on backup server with the credentials I use to open VBR console. However, I'm not sure whether those credentials are just being ignored upon request, so I need to check with devs. Will update the thread after.

Thanks,
Oleg
Dossing
Influencer
Posts: 19
Liked: 2 times
Joined: May 17, 2021 11:40 am
Full Name: Søren Døssing
Location: Denmark
Contact:

Re: Possible to PUT settings to Backup Server?

Post by Dossing »

Hi Oleg,

It got me to a new error:

Code: Select all

VERBOSE: PUT https://XXXX:9419/api/v1/backupInfrastructure/managedServers/XXXXXX-2205-4cd2-b172-8ec8f7e60ef8 with -1-byte payload
Invoke-RestMethod : {"errorCode":"UnknownError","message":"Package with type 'DeployerSvc' not found in install task for 'XXXXX'.","resourceId":null}
At C:\Veeam\InstallScripts\put-server.ps1:89 char:1
+ Invoke-RestMethod @PutRequest -Verbose
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
Can you please share a working snippet?
My body :oops: looks like this:

Code: Select all

{
    "id":  "XXXXXXX-2205-4cd2-b172-8ec8f7e60ef8",
    "name":  "XXXXXX",
    "description":  "Backup server",
    "type":  "WindowsHost",
    "credentialsId":  "XXXXXXX-2c4f-40b7-8313-78d99aec8b59",
    "networkSettings":  {
                            "portRangeStart":  "2500",
                            "portRangeEnd":  "2600"
                        }
}
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Possible to PUT settings to Backup Server?

Post by oleg.feoktistov »

Hi,

In my case full specification worked. I guess, info on some components (including DeployerSvc) is also required to connect to a backup server and modify something.
Example:

Code: Select all

{
    "networkSettings": {
        "components": [
            {
                "componentName": "DeployerSvc",
                "port": 6160
            },
            {
                "componentName": "Transport",
                "port": 6162
            },
            {
                "componentName": "Nfs",
                "port": 6161
            },
            {
                "componentName": "RestoreProxy",
                "port": 6170
            },
            {
                "componentName": "WanAccelerator",
                "port": 6164
            },
            {
                "componentName": "Tape",
                "port": 6166
            },
            {
                "componentName": "CloudGate",
                "port": 6168
            },
            {
                "componentName": "AgentConfigureService",
                "port": 9380
            },
            {
                "componentName": "FileSystemVssIntegration",
                "port": 6210
            },
            {
                "componentName": "VssHwSnapshotProvider",
                "port": 6211
            }
        ],
        "portRangeStart": 2500,
        "portRangeEnd": 3300,
        "serverThisSide": false
    },
    "type": "WindowsHost",
    "id": "xxxx",
    "name": "xxxx",
    "description": "Backup server",
    "credentialsId": "xxxx"
}
Thanks,
Oleg
oleg.feoktistov
Veeam Software
Posts: 1918
Liked: 636 times
Joined: Sep 25, 2019 10:32 am
Full Name: Oleg Feoktistov
Contact:

Re: Possible to PUT settings to Backup Server?

Post by oleg.feoktistov »

So, I checked with our devs. CredentialsId sent in case with backup server are really being ignored, so feel free to use this trick. We will just add an exception in v12 allowing to send zeroed guid if manager server is a backup server. Anticipating questions, we cannot just make credentialsId field not required when modifying backup server as required properties check happens before connection. And making it not required, we can break specs for all other managed servers. Thanks!
Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests