FOG: 1.5.4 -> How to setup NAS - Synology DiskStation as Master Node



  • Follow this tutorial step by step, and you will have everything configured, I spent a lot of hours to understand where my mistakes were and I make this tutorial to help the maximum number of people.

    To begin, let’s configure the NAS - Synology DiskStation:

    First, go to --> Control Panel --> File services --> SMB/AFP/NFS, scroll down:
    0_1530532707570_15Capture.PNG
    -Check “Activer NFS” = “Enable NFS”.
    -Check “Activer la prise en charge de NFSv4.1” = “Enable support for NFSv4.1”.

    Go to --> Control Panel --> File services --> FTP:
    0_1530532896947_17Capture.PNG
    -Check “Activer le service FTP (pas de chiffrage)” = “Enable FTP service (no encryption)”.
    -Check “Utiliser la plage de ports par défaut (55536-55567)” = “Use the default port range (55536-55567)”

    Go to Control Panel --> User --> Select the advanced window:
    0_1530533429741_19Capture.PNG
    -Check “Activer le service d’accueil de l’utilisateur” = “Enable the user’s home service”.

    -Let’s create the folders to share.
    -Go to Control Panel --> shared folders --> create and follow the pictures below:
    0_1530524367151_Capture.PNG
    -Click “Suivant” = “Next”.
    -0_1530524481236_Captu1re.PNG
    -Click “Suivant” = “Next”.
    0_1530524539420_1Capture.PNG
    -Click “Suivant” = “Next”.
    0_1530524586272_2Capture.PNG
    -Click “Appliquer” = “Apply”.
    0_1530539089067_3Capture.PNG
    -Click “Ok”.

    Create two more shared folders with the name “tftpboot” and “snapins”, with the same configuration as the shared folder that we create together "images"

    Go to --> Control Panel --> File services – TFTP:
    0_1530533113659_18Capture.PNG
    -Check “Activer le service TFTP” = “Enable TFTP Service”.
    -Dossier racine TFTP = “TFTP root folder” : tftpboot (choose the tftpboot folder you created).

    After doing that, you have to create a user.
    -Go to Control Panel --> User --> Create and follow the pictures below:
    0_1530531144677_6Capture.PNG
    0_1530531263724_7Capture.PNG
    -Here the username = userFOG and password = FOGuser.
    -Check --> “Ne pas autoriser l’utilisateur à changer le mot de passe du compte” = “Do not allow the user to change the password of the account”.
    -Click “Next”.
    0_1530531554556_8Capture.PNG
    -Check only --> users.
    -Click “Next”.
    0_1530540007952_9Capture.PNG
    -Folder “images” --> Reading/writing.
    -Folder “snapins” --> Reading/writing.
    -Folder “tftpboot” --> Reading/writing.
    -Click “Next”.
    0_1530531850542_10Capture.PNG
    -Click “Next”.
    0_1530531902534_11Capture.PNG
    -Click “Next”.
    0_1530531946111_12Capture.PNG
    -Click “Next”.
    0_1530532020494_13Capture.PNG
    -Click “Apply”.

    Go to Control Panel --> Shared folders --> select the folder “images” you created before --> Right click on folder --> edit --> NFS permissions --> “Créer” = “Create”:
    0_1530533735359_20Capture.PNG
    0_1530533808677_5Capture.PNG
    -Privilege: R/W
    -Squash: no mapping
    -Security: sys
    -Check “Activer le mode asynchrone” = “Enable asynchronous mode”.
    -Check “Permettre à des utilisateurs d’accéder aux sous-dossiers montés” = “Allow users to access mounted subfolders”.
    -Click “Ok”.
    DO THE SAME THINGS ON THE OTHER TWO FOLDERS: “tftpboot” and “snapins”.

    DO NOT ACTIVATE THIS IN FOLDERS:
    0_1530534302248_Capture21.PNG

    NAS is now configured.

    Let’s move on the FOG server. (I host the server fog on ubuntu):

    CREATE THE SAME USER THAT WE CREATED ON THE NAS ON THE FOG SERVER

    Connect to your FOG server and open the terminal and enter these lines:

    sudo -s
    mount -t nfs "Your_NAS_IP":/volume1/images /mnt
    mkdir /mnt/dev
    touch /mnt/.mntcheck
    umount /mnt
    
    mount -t nfs <syno_nas_ip>:/volume1/images/dev /mnt
    touch /mnt/.mntcheck
    umount /mnt
    
    mount -t nfs <syno_nas_ip>:/volume1/snapins /mnt
    mkdir /mnt/ssl
    cp -R /opt/fog/ssl/* /mnt/ssl
    umount /mnt
    
    mount -t nfs <syno_nas_ip>:/volume1/tftpboot /mnt
    cp -R /tftpboot/* /mnt
    umount /mnt
    

    When you have done that, you have nothing to do on the FOG server.

    Go to the FOG Management GUI, select Storage --> Add storage Node:
    0_1530535123716_22Capture.PNG
    0_1530535331683_23Capture.PNG
    -Management Username it’s the user we created before on NAS.
    -Management Password it’s the same password of the user we created on the NAS.
    -Check master node.
    -Storage Group: default.
    -Click on ADD.

    Go to Storage --> All storage nodes --> Click on DefaultMember:
    0_1530535528744_24Capture.PNG
    0_1530535572347_25Capture.PNG
    -Uncheck “Master Node”.
    -Click “Update”.

    Now create a new image and try to capture a image:
    0_1530535723474_26Capture.PNG
    Go to hosts --> List all hosts --> Click on your host:
    0_1530536882404_27Capture.PNG
    0_1530536802781_28Capture.PNG
    -Click “Update”.
    And now capture the image:
    0_1530536848164_30Capture.PNG

    YOU CAN DEPLOY IMAGE TOO :)

    There is already a very good tutorial on this subject, but I wanted to enhance it with images that it is more understandable.
    https://forums.fogproject.org/topic/9430/synology-nas-as-fog-storage-node?page=1



  • indeed it was good in the security of synology. thank you but now I still have a problem for upload. I have my pc that goes to the end but in the web console the task does not stop and during a download error image ./bin/upload

    Thank you


  • Developer

    @jeremyvdv said in FOG: 1.5.4 -> How to setup NAS - Synology DiskStation as Master Node:

    No, it’s not that … and it uploads the files during the creation of the image

    The upload of the image doesn’t happen via FTP but using NFS. So those are two different things. FTP is only used at the very end to move/rename the image.

    From what I see in the last picture it looks like you are using a Synology NAS. In a German forum I just read about someone having the same “Maximum number of tries exceeded” error message and it turned out that his Synology had added a block for his IP address.

    You should be able to find the client IP address in the block list of you Synology NAS. See instructions here: https://mariushosting.com/ip-block-list/



  • No, it’s not that … and it uploads the files during the creation of the image.

    ba93849c-acb4-4250-bb8d-8f7e22458cbf-image.png

    It’s really at the end of the upload that plente.

    And the task does not stop on the web interface


  • Moderator

    @jeremyvdv The IP of the client (that it receives when imaging) is possibly in the NAS FTP blocklist due to too many incorrect login attempts.



  • actually in my configuration storage web interface of fog it was of course root.

    But change that I always have the same error message with my new user

    an idea?


  • Developer

    @jeremyvdv Well then change to a different username: FOG web UI -> Storage -> edit the Storage node settings, scroll down to the bottom and edit username and password.



  • I see on the error that it uses the root account.
    out of synology i can not create a root account.
    that may be the problem.
    But what if that’s it?

    Thank you



  • yes i tried and since winscp i have no problem


  • Developer

    @jeremyvdv Probably the account is locked for too many login attempts using the wrong credentials? Can you manually connect to that via a FTP client like FileZilla (host: 10.1.5.8 …)?



  • here is where I am.
    Not easy to set up this storage

    105d8085-149f-4e8a-831b-33cbf89fa59b-image.png



  • Hello

    and thank you for your help.
    I advanced on the subject by chnging the login in fogsetting.php
    but now I have the message: maximum number of tries exceeded ftp.

    On the nas I have no restriction.


  • Moderator

    @jeremyvdv said in FOG: 1.5.4 -> How to setup NAS - Synology DiskStation as Master Node:

    If I have to change the password in fogftp.class.php

    You do not edit the code in this case. On your NAS you need to setup the FTP service so that the FOS Linux engine can connect to it. You will need to create a user ID and password on your NAS device. Then on the FOG serve web gui, for the storage definition of the NAS, under the management user and password.

    You should test using the ftp client on a windows computer to ensure you can connect to the nas using the managment user ID and PASSWORD and navigate to the /volume1/images2 path and to create and delete a directory in that path. If you can then you have the permissions set correctly on the images2 directory.

    I do have a tutorial that I created for the synology nas too: https://forums.fogproject.org/topic/9430/synology-nas-as-fog-storage-node



  • If I have to change the password in fogftp.class.php
    Thank you for telling me which line exactly because I can not find



  • for information, I have this message at the end of my capture … it happens to create the files on my NAS … but on the end I have this message



  • Hello
    I corrected: my problem by indicating the network of my clients rather than the server on the NFS configuration of synology.

    now i’m experiencing this problem at capture:

    dcbccbb8-5583-41ec-8eb3-dce364636ac1-image.png


  • Moderator

    @jeremyvdv said in FOG: 1.5.4 -> How to setup NAS - Synology DiskStation as Master Node:

    if I start in debug mode. what action do I have to do manually?

    At the FOS Linux command prompt you would key in
    mount -o nolock,proto=tcp,rsize=32768,intr,noatime "$storage" /images where $storage would be the nas server IP address and the file path. For example10.1.5.8:/volume1/imageswould go there. Don't forget the colon after the IP address and before the path. Also make sure that10.1.5.8` is the IP address of your NAS. If that mounts correctly then the problem is elsewhere.



  • if I start in debug mode. what action do I have to do manually?

    Thank you


  • Moderator

    @jeremyvdv said in FOG: 1.5.4 -> How to setup NAS - Synology DiskStation as Master Node:

    mount 10.1.5.8:/volume1/images on / images permission denied

    Where are you seeing this message?

    If I try to connect to the share on the nas with my FOG user it works.

    From what device does it work? FOG server?

    The target computer connects to the NFS share using the credentials of root if the nfs share has squash root parameter. root will not be able to connect to the nfs share, yet a normal user can mount it. If you pxe boot the target computer in debug mode (tick the debug checkbox before scheduling the task) you can run the commands interactively on the target computer for testing.



  • Hello

    I followed your tutorial and thank you for doing this.

    I have my storage which is well added but when I want to capture I have access denied …

    mount 10.1.5.8:/volume1/images on / images permission denied

    If I try to connect to the share on the nas with my FOG user it works.

    Can you help me ?

    Thank you


Log in to reply
 

432
Online

6.4k
Users

13.8k
Topics

130.0k
Posts