• Recent
    • Unsolved
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Synology NAS as FOG Storage node

    Scheduled Pinned Locked Moved
    Tutorials
    10
    31
    18.5k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • george1421G
      george1421 Moderator
      last edited by george1421

      NOTE: Changes in FOG's code since this article was written have made it harder to use NAS' as storage node with FOG. If you use a NAS with FOG 1.5.x and beyond the FOG replicator will continue to cycle and recopy files over and over again.

      Part 1 NAS Setup

      So far I’ve setup what should work from the synology NAS side of the fog storage node. This has NOT been proven to work just yet. So far the synology nas has been configured to what “should work”. On my test NAS I’m using DSM 6.0.

      The following is just my short hand notes that will be used to create the actual tutorial. I’m out of time tonight to complete the docs for this.

      The first thing we need to do is setup our NAS with the required network shares. To do this you need access to the Synology NAS’s web console. Log into the web console as admin and do the following.

      1. Control Panel->Shared Folder
        Create new share
        Name: images
        Location: volume 1
        Checked Hide this shared folder in My Network Places
        Checked Hide sub-folders and files from users without permissions
        Press OK
        NFS Permission (tab)
        Create new Permission
        Hostname or IP: *
        Privilege: Read/Write
        Squash: No mapping
        Security: sys
        Checked Enable asynchronous
        Checked Allow users to access mounted subfolders

      2. Control Panel->Shared Folder
        Create new share
        Name: snapins
        Location: volume 1
        Checked Hide this shared folder in My Network Places
        Checked Hide sub-folders and files from users without permissions
        Press OK
        NFS Permision (tab)
        Create new Permission
        Hostname or IP: *
        Privilege: Read/Write
        Squash: No mapping
        Security: sys
        Checked Enable asynchronous

      3. Control Panel->Shared Folder
        Create new Share
        Name: tftpboot
        Location: volume 1
        Checked Hide this shared folder in My Network Places
        Checked Hide sub-folders and files from users without permissions
        Press OK
        NFS Permission (tab)
        Create new Permission (we only need this nfs shared for setting up the storage node)
        Hostname or IP: *
        Privilege: Read/Write
        Squash: No mapping
        Security: sys
        Checked Enable asynchronous

      4. Control Panel->File Services
        Select Win/Mac/NFS (tab)
        Checked Enable NFS

      5. Control Panel->File Services
        Select FTP (tab)
        Checked Enable FTP service (no encryption)
        Checked Use the default port range

      6. Control Panel->File Services
        Select TFTP (tab)
        Checked Enable TFTP service
        TFTP root folder: tftpboot (this is the share name we created above)

      7. Control Panel->User
        Select User (tab)
        Create user foguser
        Name: foguser
        Description: FOG User
        Password: fogremote1 (pick your own secure password)
        Conform Password: fogremote1
        Checked Disallow the user to change account password
        Press Next
        Join to group: users
        Press Next
        images: RW
        snapins: RW
        tftpboot: RO
        Press Next
        (Assign quota as needed)
        Press Next
        Assign application permissions: None
        Press Next
        Speed limiting: None
        Press Next
        Press Apply

      8. Control Panel->User
        Select the Advanced (tab)
        (scroll way at bottom)
        Under User Home
        Checked Enable user home service
        Press Apply

      That completes the setup of the Synology NAS.

      In the next part we’ll test the network shares we setup above and create the remaining flag files and directory structure needed to transform the Synology NAS into a FOG storage node.

      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

      1 Reply Last reply Reply Quote 5
      • george1421G
        george1421 Moderator
        last edited by

        (post placeholder)

        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

        1 Reply Last reply Reply Quote 0
        • george1421G
          george1421 Moderator
          last edited by

          (post placeholder)

          Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

          1 Reply Last reply Reply Quote 0
          • george1421G
            george1421 Moderator
            last edited by george1421

            Part 3 FOG Storage Node Configuration

            In this part we will complete the configuration to connect the Synology NAS to the FOG server. The remainder of the setup is done in the FOG management GUI

            1. Log into the FOG Management GUI
            2. Select the Storage Management icon on the FOG tool tray
            3. Select Add Storage Node link from the menu on the left
            4. Fill out the New Storage node as follows:
              Storage Node Name: SynoNAS01 (it can be any name you choose)
              Storage Node Description: Synology NAS storage node
              IP Address: <syno_nas_ip>
              Web root: /fog (not used because NAS isn't real fog server)
              Max Clients: 10 (set to a value reasonable for your NAS size)
              Is Master Node: Unchecked (see note 1)
              Replication Bandwidth (Kbps): (leave blank to use full bandwidth see note 2)
              Storage Group: Default (select the approprate storage group for your needs)
              Image Path: /volume1/images/
              FTP Path: /images/
              Snapin Path: /volume1/snapins/
              SSL Path: /volume1/snapins/ssl/
              Bitrate: (leave blank)
              Interface: eth0 (doesn’t matter since NAS is not FOG server so we can’t multicast from it)
              Is Enabled: Checked
              Is Graph Enabled: Unchecked (NAS is not a FOG server so its unable to report usage)
              Management Username: foguser
              Management Password: fogremote1
            5. Press the Add button to create the new storage node definition
            6. Log into the FOG server linux console
            7. Wait about 60 seconds then key in:
              tail /opt/fog/log/fogreplicator.log
              The output should appear similar to:
            [02-01-17 8:48:53 pm]  * Started sync for Image <Image Common Name>
            [02-01-17 8:48:53 pm]  * Found Image to transfer to 1 node
            [02-01-17 8:48:53 pm]  | Image Name: <ImageName>
            [02-01-17 8:48:55 pm]  * Starting Sync Actions
            [02-01-17 8:48:55 pm]  | CMD:
                                    lftp -e 'set ftp:list-options -a;set net:max-retries 10;set net:timeout 30;  mirror -c -R --ignore-time -vvv 
            --exclude "dev/" --exclude "ssl/" --exclude "CA" --delete-first '/images/<ImageName>' \''/images/<ImageName>'\';
             exit' -u foguser,[Protected] <syno_nas_ip>
            

            This is a good thing. This tells us the FOG Replicator has seen the new storage node and has started copying over the files to the storage node using the ftp protocol
            😎 You can see what files have been moved by keying in:
            cat /opt/fog/log/fogreplicator.log.transfer.SynologyNAS.log
            The output should look similar to this:

            Transferring file `d1.fixed_size_partitions'
            Transferring file `d1.mbr'
            Transferring file `d1.minimum.partitions'
            Transferring file `d1.original.fstypes'
            Transferring file `d1.original.swapuuids'
            Transferring file `d1.partitions'
            ...
            

            If you made it to this point, just sit back and wait for the replicator service to copy over your images and snapins to the NAS device.

            Hint: if your files are not copying as noted above, check the fog logs on the FOG Master server as well as the logs on the Synology NAS in the log tool for error messages. I did have the foguser password set incorrectly in the NAS and the synology NAS displayed the bad login attempt via FTP in my case.

            Note 1: It was reported that you could set this Storage Node as the Master Node. In this way the FOG server would only be a management server, with all of the files being captured and deployed stored on the NAS. I'm a bit surprised that it worked, and I have not tested this configuration. YMMV ref: https://forums.fogproject.org/topic/9422/setup-synology-diskstation-as-main-storage-for-fog-sever/11
            Note 2: <insert something about off site replication speed and bandwidth protection>

            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

            1 Reply Last reply Reply Quote 0
            • george1421G
              george1421 Moderator
              last edited by george1421

              Part 2: Testing the NFS shares

              In this part we will connect to the Synology NAS from the FOG server to ensure our NFS shares are setup correctly, with the proper permission, and can communicate with a linux remote device.

              On fog server do the following:

              1. Log into the FOG server as root
              2. Key in the following from the linux command prompt to test the /images share
              mount -t nfs <syno_nas_ip>:/volume1/images /mnt
              mkdir /mnt/dev
              touch /mnt/.mntcheck
              umount /mnt
              
              1. Key in the following to test the /images/dev share (note: this is a bit slight of hand here since we didn’t specifically share the /images/dev path. This function works because we selected “Allow users to access mounted subfolders” in Step 1 of Part 1.
              mount -t nfs <syno_nas_ip>:/volume1/images/dev /mnt
              touch /mnt/.mntcheck
              umount /mnt
              
              1. Next we will connect to the snapins share and create the ssl directory and copy the ssl keys from the FOG server to the Synology NAS
              mount -t nfs <syno_nas_ip>:/volume1/snapins /mnt
              mkdir /mnt/ssl
              cp -R /opt/fog/ssl/* /mnt/ssl
              umount /mnt
              
              1. Next we will copy the PXE boot files from the FOG server to the NAS
              mount -t nfs <syno_nas_ip>:/volume1/tftpboot /mnt
              cp -R /tftpboot/* /mnt
              umount /mnt
              

              That completes the NAS setup quality check. To recap here. We confirmed that the shares are shared correctly with the proper permission to allow an external linux system to create files on the NAS. We’ve also created the required .mntcheck files the imaging code uses to identify its shares. And lastly we copied several required support files from the FOG server to the NAS. Just be aware that if you update the FOG server to a newer release, you will probably need to refresh the files in the /tftpboot share on the NAS to keep them insync with the FOG server.

              Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

              1 Reply Last reply Reply Quote 0
              • G
                Grizzly
                last edited by

                Thanks for the great tutorial. I used it to get the NAS setup for our 1.3 FOG server. A couple things I ran into just to let you know:

                1. This should be a common thing but I needed to make sure that the NAS was my default storage node. I screwed this up the first time through.

                2. I was able to capture an image but I wasn’t able to deploy. I needed to have a .mntcheck in both /images and /images/dev. In the steps above this is only created in the /images/dev portion.

                Just thought I’d give you a heads up but so far it looks like the rest of the steps worked flawlessly and it is much appreciated.

                george1421G 1 Reply Last reply Reply Quote 0
                • george1421G
                  george1421 Moderator @Grizzly
                  last edited by george1421

                  @Grizzly On point 2 you are correct. I was a victim of a late night and a lazy finger. I’ll correct the post.

                  In the case of your #1. Just so I’m clear, you are storing all of your images on the NAS to run a skinny FOG server?

                  Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                  G 1 Reply Last reply Reply Quote 0
                  • G
                    Grizzly @george1421
                    last edited by

                    @george1421 Correct. I have 1.3 installed on a VM and all the images are stored on the NAS for capture and deployment.

                    george1421G 1 Reply Last reply Reply Quote 0
                    • george1421G
                      george1421 Moderator @Grizzly
                      last edited by

                      @Grizzly Ok you are running an alternate configuration, which is OK. Its just not officially support (but works just the same).

                      I do plan on adding to this tutorial. Right now from the FOG home page, FOG can’t pickup any disk sizes from the synology NAS (because the Synology NAS is not a real FOG server). There is a way to let the master FOG server to think the NAS is another FOG server. I just need to work out the process. So I should be able to integrate FOG and the synology nas a bit more.

                      Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                      G 1 Reply Last reply Reply Quote 0
                      • G
                        Grizzly @george1421
                        last edited by

                        @george1421 Yeah I was originally looking at how to install FOG on the Synology NAS as a Storage Node but couldn’t seem to find a way to do that yet. This way is a bit hacky but it is working without issue thus far!

                        1 Reply Last reply Reply Quote 1
                        • V
                          VincentJ Moderator
                          last edited by

                          If you setup NFS and FTP then it should work perfectly.

                          I use Synology and FreeNAS’ as storage nodes. My Fog Server doesn’t even serve images.

                          george1421G 1 Reply Last reply Reply Quote 0
                          • george1421G
                            george1421 Moderator @VincentJ
                            last edited by george1421

                            @VincentJ Just for clarity the issue I’m working on is the dashboard reporting only works correctly if the storage node is a “real” fog server. If that isn’t a problem then a NAS will work perfectly.

                            The only caveat to using a NAS as your primary storage is that multicast deployments will not work at all. If you only do unicast imaging then again, there is no problem using a NAS in this manner.

                            Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                            1 Reply Last reply Reply Quote 0
                            • B
                              brusa.matteo
                              last edited by

                              hello, I’m trying to use this…and when the sync starts the error I receive is: mirror: Access failed: 550 No such file or directory. (/volume9/fog_images/test01) test01 is the test images I’ve created…
                              all the other point ar ok as the guide…

                              1 Reply Last reply Reply Quote 0
                              • B
                                brusa.matteo
                                last edited by brusa.matteo

                                Hello, so…
                                the sync between the default repository and the synology works.
                                Now I’ve moved the synology storage on another storage group, because I want to use only it since the default (fog server) has not enough space for my pourpose…
                                The snapins creation and distribution works fine (i can create snapins only on the synology and deploy them from the synology)
                                But…trying to capture an image (setted to stay on the synology storage) I receive an error:

                                mounting x.x.x.x:/fog_images/dev on /images failed: Permission denied

                                have you any suggestions?

                                george1421G 1 Reply Last reply Reply Quote 0
                                • george1421G
                                  george1421 Moderator @brusa.matteo
                                  last edited by george1421

                                  @brusa.matteo Hmm I didn’t see your post from a few days ago, sorry.

                                  You are getting a permission denied message. This sounds like you don’t have the nfs permissions setup correctly on your NAS.

                                  Specifically in this section

                                  NFS Permission (tab)
                                  Create new Permission
                                  Hostname or IP: *
                                  Privilege: Read/Write
                                  Squash: No mapping
                                  Security: sys
                                  Checked Enable asynchronous
                                  Checked Allow users to access mounted subfolders

                                  Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                                  B 1 Reply Last reply Reply Quote 0
                                  • B
                                    brusa.matteo @george1421
                                    last edited by

                                    @george1421 thanks for your reply…
                                    it was my fault: I had entered the wrong path in the configuration…
                                    working late at night is not a good idea!!
                                    thaks a lot!

                                    1 Reply Last reply Reply Quote 1
                                    • K
                                      KKTwenty101
                                      last edited by

                                      @george1421 I “cheesed” the dashboard in our FOG by mounting the image folder on the FOG server as NFS from my synology NAS (rather than add another storage node). Using an 815+ here and have been for a while.

                                      george1421G 1 Reply Last reply Reply Quote 0
                                      • george1421G
                                        george1421 Moderator @KKTwenty101
                                        last edited by george1421

                                        @KKTwenty101 said in Synology NAS as FOG Storage node:

                                        @george1421 I “cheesed” the dashboard in our FOG by mounting the image folder on the FOG server as NFS from my synology NAS (rather than add another storage node). Using an 815+ here and have been for a while.

                                        ^^Please explain this^^

                                        If I understand correctly you have an nfs share on your nas, and you mounted that nfs share over the /images directory on your fog server. And the fog server is sharing out the /images directory on your fog server??

                                        Please help us build the FOG community with everyone involved. It's not just about coding - way more we need people to test things, update documentation and most importantly work on uniting the community of people enjoying and working on FOG!

                                        K 1 Reply Last reply Reply Quote 0
                                        • K
                                          KKTwenty101 @george1421
                                          last edited by

                                          @george1421 yes. That way the fog server considers /images local so the “defaultmember” pie chart works just fine.

                                          1 Reply Last reply Reply Quote 0
                                          • A
                                            Alex78
                                            last edited by Alex78

                                            @george1421 Hello, i did all the things you say, but i stay with this error, and i don’t know what this means:
                                            0_1530264310568_ok.PNG

                                            Did someone known this problem ?

                                            george1421G 1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 1 / 2
                                            • First post
                                              Last post

                                            155

                                            Online

                                            12.0k

                                            Users

                                            17.3k

                                            Topics

                                            155.2k

                                            Posts
                                            Copyright © 2012-2024 FOG Project