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



  • Hello
    so I check the parameters but I still have the same problem.



  • ok I try max client on fog a 0 and on the nas a 10 … I keep you informed.
    Thank you


  • Moderator

    @jeremyvdv Ah, OK I missed in the screen shot the type=down.

    Then what its doing is picking the FOG server as the download node. If you go into the storage configuration and pick the default storage node (the fog server) change the max clients field to 0. Make sure the max clients field on the NAS is set to something higher than 0 (10 is default).



  • I did not change anything at the storage level …

    And I have never tested the download of an image since I have never been able to create until now :-)


  • Moderator

    @jeremyvdv But this part worked before. This is the NFS side. The image was getting to the NAS but it was failing to move to the /images2 directory. That was/is an FTP issue. Now its failing to upload the image, which is an nfs issue.

    Ah, I see it. From my notes I have your nas at IP 10.1.5.8 your storeIP is 10.16.3.129 your fog server. Did you change the storage node configuration? Your nas server needs to be the master in the storage group. Here is the kernel line you collected from the debug session I saved.

    cat /proc/cmdline
    loglevel=4 initrd=init.xz root=/dev/ram0 rw ramdisk_size=275000 web=http://10.16.3.129/fog/ consoleblank=0 rootfstype=ext4 mac=30:8d:99:14:a4:e6 
    ftp=10.1.5.8 storage=10.1.5.8:/volume1/images2/dev/ storageip=10.1.5.8 osid=5 irqpoll hostname=LP0045 chkdsk=0 
    img=test10 imgType=n imgPartitionType=all imgid=5 imgFormat=5 PIGZ_COMP=-10 hostearly=1 pct=5 
    ignorepg=1 isdebug=yes type=up
    

    See how it differs from the picture you posted?



  • Hello George

    Actually it was the path in ftp Path.
    My image capture works. and I thank you very much.
    now I meet the problem attached when downloading the image : - /

    b637d4bb-44f2-4773-9fb9-f758091c0b77-image.png


  • Moderator

    @george1421 After thinking about this I looked at my tutorial on setting up a synology nas as a storage node and my guess in the previous post was correct, the FTP path should just be /images as seen in this post: https://forums.fogproject.org/topic/9430/synology-nas-as-fog-storage-node/28


  • Moderator

    @george1421 After having a chat session with @jeremyvdv which we had to cut short I discovered somethings.

    I asked him to post the output of the kernel parameters from a debug session.

    cat /proc/cmdline
    loglevel=4 initrd=init.xz root=/dev/ram0 rw ramdisk_size=275000 web=http://10.16.3.129/fog/ consoleblank=0 rootfstype=ext4 mac=00:00:00:00:00:00 ftp=10.1.5.8 storage=10.1.5.8:/volume1/images2/dev/ storageip=10.1.5.8 osid=5 irqpoll hostname=LP0045 chkdsk=0 img=test10 imgType=n imgPartitionType=all imgid=5 imgFormat=5 PIGZ_COMP=-10 hostearly=1 pct=5 ignorepg=1 isdebug=yes type=up
    

    Where we can see the storage path for NFS is 10.1.5.8:/volume1/images2/dev but looking on the nas via FTP there is no reference to /volume1/images2 its just /images2, yet there is data in /images2/dev/<mac_address> directory. So NFS is working and FTP is not.

    store_path2.png

    If we looked at what he posted as a screen shot of the nas storage node
    store_path1.png

    We can see that he is clearly calling out /volume1/images2

    When he connected via ftp to the nas the path was /images2/dev/<mac_address> like we see from the top picture here.

    So what I’m thinking is that we leave storage path at /volume1/images2 and set the FTP path to /images2 then it should work. I think NFS is looking at it form the filesystem view where ftp is looking at the path from a logical view. They technically point to the same location, just how they get there is via two different paths.


  • Moderator

    @jeremyvdv If you are ready now, I am. We can switch over to FOG IM (look for the bubble in the upper right corner of this forum) to send the details of teamviewer connection.

    What I will need you to do before we connect to make things go quicker.

    1. Schedule a capture task with a target computer, but before you hit the submit button check the debug check box then submit the task.
    2. pxe boot the target computer.
    3. on the target computer press enter to clear the several screens of text to end up a the FOS Linux command prompt.
    4. key in ip addr show to get the IP address of the target computer.
    5. key in passwd and reset root’s password to something simple like hello (no worries the password will be reset when you next reboot the target computer).
    6. Now from your teamviewer host computer use putty and ssh into the target computer using the IP address you collected in step 4 and the user root with the password you set in step 5.

    That will prep us for a debugging session.



  • yes we can do a team viewer.

    Can you set a date and time if you can?

    IF you can I give you a clear diagram of my install.


  • Moderator

    @jeremyvdv Well I guess we have 2 things.

    1. While this is not a fix, you can save the failed upload by manually moving the folder /volume1/Images2/dev/<mac_address> to /volume1/Images2/<image_name> . Understand this is not a fix only a work around.

    2. Do you have teamviewer capabilities? I would like to see what you are seeing, because its impossible to happen the way you say it does. Understand I am not doubting you, only don’t understand how its possible.



  • it makes me crazy … I still have data from the image created …

    And I can not download … the capture spot turns in a loop …

    7bea4026-26b5-4ada-86cd-f06b887a965c-image.png



  • yes i have disabled the id mode on the stoarge default.

    but I do not know what to do concretely …

    Min image is created well and the tahce resten loop


  • Moderator

    @jeremyvdv Then I don’t understand how this picture was created in this post: https://forums.fogproject.org/topic/12168/fog-1-5-4-how-to-setup-nas-synology-diskstation-as-master-node/26 The path clearly states /images/dev/<mac_address>. I can understand if the FTP Path is different than your Image Path in the host definition, but that is not the case in your picture of the storage node configuration here: https://forums.fogproject.org/topic/12168/fog-1-5-4-how-to-setup-nas-synology-diskstation-as-master-node/28

    Did you by chance on the default node (real fog server) uncheck the box that says Is Master Node ? You can only have one master node in each storage group. You can have more than one storage group, but each storage group can only have one master.



  • Yes that’s right.
    on the nas the files are well in volume1 \ images2 \ dev <mac adress>


  • Moderator

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

    can someone help me?
    ^ thank you

    Are you telling me the that the storage node configuration you have is still creating the error message ftp_put(/images/dev/308...) because the storage node configuration clearly states /volume1/images2 fro the FTP path. This should not happen. Do you happen to have more than the one storage node configuration for this nas? I can’t explain why it says /volume1/images2 yet the error message is still defult?

    When you look on the NAS the files are for sure in /volume1/images2/dev/<mac_address> directory?



  • I can not understand.

    When I capture the image … the files are well stored in the synlogy. But I can not find the way from the fog …



  • can someone help me?
    ^ thank you



  • I’m sorry I do not understand.
    I have this config. with user fogproject password fogproject

    what do you want me to do as configuration?
    Thank you

    64c67c51-60bd-4ceb-b508-40a954b8c75d-image.png


Log in to reply
 

403
Online

6.4k
Users

13.8k
Topics

130.3k
Posts