Add a Nas (QNAP TS-231) as a Storage Node (Fog v1.4)
Iarwayn last edited by Iarwayn
This tutorial is above all the fruit of the efforts made by all the helpers (special thanks @george1421 and @chris-dees).
I will now explain how to add a Qnap TS-231 Nas as a node storage in a 1.4 Fog system.
Step 1: Prepare the Nas
First we will activate some necessary features:
Activate the NFS service
and the FTP service
We will now create a user who will be known in the two systems, the Nas and the fog (I’ll talk about it later).
Let’s call him foguser with the password … password (for this tutorial, I will not be creative ^_^). His password will be the same in the nas and in the fog system.
Now let’s create the shared folders (this part is totally inspired by the Synology tutorial made by @george1421)
We will create 3 folders: images, snapins and tftpboot as in the pic under
Now as we edit the access rights for the images and snapins folders, we will mark them as to be Read and Write with the foguser
The access rights for the tftpboot will be read only
As the service is activated, we can manage the NFS rights for each folders. Expand the Select permission type menu to choose NFS host access and do as in the following pic for the three Folders:
Then activate the TFTP server and input the right Root like the pic after (sorry for the french in the pic):
Last thing to do (and I think it’s exclusive to the QNAP Nas) is to activate the advanced authorizations like in the pic after because in some case, if not activated, you will have access right problems to the /images/dev folder stored in the qnap and you will have in consequence a message at the end of the capture operation a “Updating database failed” message (thanks to the “Troubleshoot FTP” page in the wiki.fogproject.org).
This may take a while.
That’s it for the Nas part (that was the longest).
Step 2: Testing the NFS shares (This step is entirely a copy/paste from the Synology NAS as FOG Storage node tutorial by @george1421, hope he won’t mind ^_^)
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:
Log into the FOG server as root
Key in the following from the linux command prompt to test the /images share
mount -t nfs <nas_ip>:/share/images /mnt
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 <nas_ip>:/share/images/dev /mnt
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 <nas_ip>:/share/snapins /mnt
cp -R /opt/fog/snapins/ssl/* /mnt/ssl
Next we will copy the PXE boot files from the FOG server to the NAS
mount -t nfs <nas_ip>:/share/tftpboot /mnt
cp -R /tftpboot/* /mnt
The difficult part for me was to find the right NFS path with that kind of Nas. Some other Qnap tutorials are talking about different NFS path (I was very disappointed at this time 'cause I’ve never questioned the path I’ve seen in other tutorials but that was the key) and I’ve found the right way to put it in the settings by chance in a Qnap forum about a totally different problem.
So to me more consise, as you can see, the right snapin path was /share/images.
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.
Step 3: Configure the fog server
In the fog server, we go to the Storage management and choose Add a storage group and create the storage group named simply NAS(because I surely will add another Nas in the future so a group is the best way to organise that).
In a second time we choose the Add storage node menu and as our Nas’s IP address is 172.16.0.249, we enter the following informations
In the Management Username and Management Password be attentive to enter the same user/password as created in the Nas. In our tutorial foguser with the password password.
Apply all that and that’s it! You have done the job!
When you create a new image, create it in the Nas node group (of course!) and just test a capture/deploy to be sure.
----End of the tutorial----
I hope that was clear and I apologize for some grammatical mistakes I may have made (yes I’m french).
Thanks again to those who helped me and thank to all those who have created and make the Fog system marvelous. You make me a great gift every working day: Time! So a big thank to you all guys.
Have a nice day.