PowerShell script exchange
Post Reply
matteu
Veeam Legend
Posts: 824
Liked: 128 times
Joined: May 11, 2018 8:42 am
Contact:

Add linux NFS share repository

Post by matteu »

Hello,

I'm trying to add share from Ubuntu 20.04 LTS with powershell and it's not working.
With GUI it's working when I just specify the folder path and let all other option by default.

My command is :

Code: Select all

$param = @{
        Name               = "Repo_NFS01"
        Server             = "vbrpxy02"
        Description        = "Repository NFS Toulouse"
        Type               = "NFS"
        Folder             = "vbrpxy02:/mnt/veeam"
        MaxConcurrentJobs             = 4
        UsePerVMFile          = $true
    }

Add-VBRBackupRepository @param
Error is : Failed to open NFS session for host vrboxy02: the server or the gateway may not be available.

Am I using the good settings ?
david.domask
Veeam Software
Posts: 2367
Liked: 560 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Add linux NFS share repository

Post by david.domask »

Hi @matteu,

I think you need to check a few things.

1. Is vbrpxy02 the actual host of the NFS share or it's the server you want to use as the gateway?
2. Can you confirm that you have an entry in your /etc/exports file on the Ubuntu server which allows the host vbrprx02 to access the share?
3. If vbrprxy02 is NOT the host of the NFS share, you need to change folder to be HOSTNAMEorIP:/path/to/share

I just threw together a quick NFS share using your method and correct parameters and it flew without incident. Example code and setup:

NFS Share host: IPADDR
Gateway Server: ddom-log-box
NFS Share path: /media/backupuser/nfsshare

Code: Select all

PS F:\perjobbackups\vss-test> $param = @{
>>         Name               = "test-repo"
>>         Server             = "ddom-log-box"
>>         Description        = "testNFS"
>>         Type               = "NFS"
>>         Folder             = "IPADDR:/media/backupuser/nfsshare"
>>         MaxConcurrentJobs             = 4
>>         UsePerVMFile          = $true
>>     }
PS F:\perjobbackups\vss-test> Add-VBRBackupRepository @param

Name                      Type         Host            FriendlyPath    Description
----                      ----         ----            ------------    -----------
test-repo                 Nfs          ddom-log-box... nfs41://IPA.... test

Code: Select all

Last login: Wed Jan 25 10:48:11 2023 from someip
backupuser@ddom-backmeup:~$ ls /media/backupuser/nfsshare/nfs-test/
ddom-tinyvm.vm-148644D2023-01-25T135544_ECA3.vbk  nfs-test.vbm
backupuser@ddom-backmeup:~$ 
David Domask | Product Management: Principal Analyst
matteu
Veeam Legend
Posts: 824
Liked: 128 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Add linux NFS share repository

Post by matteu »

Hello,

Thanks for the answer.

1.vbrpxy02 is my host nfs share. It's in a lab environment to be able to automate specifics action with VBR.
2.I have my VBR IP server on it (I also try with my entire subnet because VBR server and vbrpxy02 are on the same). Then, if I don't have, I would not be able to add it with GUI ^^

It's really strange it doesn't work in my case with powershell but it does with GUI.

For the GUI I do this and I can finish the wizard and my repository is added.
Image

For the PS version, you have it on my first post.

PS : OK, I understand my error with your help...

Server should not be used in my case because I don't want to specify a gateway.

Code: Select all

$param = @{
        Name               = "Repo_NFS01"
        Description        = "Repository NFS Toulouse"
        Type               = "NFS"
        Folder             = "vbrpxy02:/mnt/veeam"
        MaxConcurrentJobs             = 4
        UsePerVMFile          = $true
    }

Add-VBRBackupRepository @param
works perfectly fine !
david.domask
Veeam Software
Posts: 2367
Liked: 560 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Add linux NFS share repository

Post by david.domask »

Hrm, thanks for the clarification; I actually cannot even add it via the UI, and when I try to manually mount it on my Ubuntu server as root, I get permission denied also.

Can I ask though, what is the idea behind using the same server to host the NFS share and also as a gateway for the share? Why not just add it as a Linux server?

I'm surprised if you can add it in the UI this way, and I imagine the /etc/fstab entries must be not great for such a setup, so maybe you can explain why you want to do it like this as opposed to adding the server as a Linux server? You should get the same or better performance without having to deal with nfs mounting at all.
David Domask | Product Management: Principal Analyst
matteu
Veeam Legend
Posts: 824
Liked: 128 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Add linux NFS share repository

Post by matteu »

There is no really any "need" here.
It's just to setup "NFS" repository but you're right in production I will have a gateway.
It's working if I test like this :

Code: Select all

$param = @{
        Name               = "Repo_NFS01"
        server = "WIN-JN4HA4STF01"
        Description        = "Repository NFS Toulouse"
        Type               = "NFS"
        Folder             = "vbrpxy02:/mnt/veeam"
        MaxConcurrentJobs             = 4
        UsePerVMFile          = $true
 }

Add-VBRBackupRepository @param
david.domask
Veeam Software
Posts: 2367
Liked: 560 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Add linux NFS share repository

Post by david.domask »

Ah wait, I think I see why the UI worked for you -- when you set -Server flag, this sets the server as a gateway, but in your screenshot you have the gateway selection to automatic.

So I suppose that in the UI, another server was used for access.

But I think see if you can just run a mount command on your Ubuntu Server itself and I suppose you'll see it will also fail like it did on mine.

Do you need the NFS Server Host to also be the gateway? If not, leave the Server flag off and it should go.
David Domask | Product Management: Principal Analyst
matteu
Veeam Legend
Posts: 824
Liked: 128 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Add linux NFS share repository

Post by matteu »

What I mean is it's perfectly working for both cases here with powershell :

With gateway

Code: Select all

$param = @{
        Name               = "Repo_NFS01"
        server = "WIN-JN4HA4STF01"
        Description        = "Repository NFS Toulouse"
        Type               = "NFS"
        Folder             = "vbrpxy02:/mnt/veeam"
        MaxConcurrentJobs             = 4
        UsePerVMFile          = $true
 }

Add-VBRBackupRepository @param
Without gateway

Code: Select all

$param = @{
        Name               = "Repo_NFS01"
        Description        = "Repository NFS Toulouse"
        Type               = "NFS"
        Folder             = "vbrpxy02:/mnt/veeam"
        MaxConcurrentJobs             = 4
        UsePerVMFile          = $true
 }

Add-VBRBackupRepository @param
david.domask
Veeam Software
Posts: 2367
Liked: 560 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: Add linux NFS share repository

Post by david.domask »

Hrm, but I guess where I'm confused is that originally you were trying to use the Ubuntu Server itself, and you mentioned there were challenges when using that. That is what specifically I wanted you to try in the UI; instead of Automatic, set the Ubuntu Server as a gateway to itself, I suppose in UI it will fail.

Then on the Ubuntu Server itself, try to manually mount the NFS share somewhere, I suppose it will also fail.

Your examples there work because you're not using the Ubuntu NFS host as a gateway for itself (I suppose you need to do some magic in bash to make it work), you used another gateway server. Your second example should have the Gateway selection as Automatic, so Veeam was able to find another server that was able to access it.
David Domask | Product Management: Principal Analyst
matteu
Veeam Legend
Posts: 824
Liked: 128 times
Joined: May 11, 2018 8:42 am
Contact:

Re: Add linux NFS share repository

Post by matteu »

I'm rebuilding my Veeam environment.
Once it will be done, I will test it again and post the result of the tests :)
ers_kentwick
Influencer
Posts: 19
Liked: 3 times
Joined: Jul 26, 2016 9:15 pm
Full Name: Kent Wick
Contact:

Re: Add linux NFS share repository

Post by ers_kentwick » 1 person likes this post

Check your NFS export settings. The following works just fine for us (V11) with SLES 12.
/home/vm_stage pvem*(rw,no_root_squash,sync,no_subtree_check)

The "no_root_squash" is important. If it isn't there then the NFS export isn't accessible as "root" from your Veeam server (since Veeam is trying to establish the NFS mount as a root user).
Post Reply

Who is online

Users browsing this forum: No registered users and 31 guests