Setup Synology Diskstation as main storage for Fog Sever
-
Ubuntu 14 Server
- FOG Version: 1.3.3
- OS: Ubuntu
Client
- Service Version:
- OS:
Description
I am trying to setup a fog server on a Ubuntu server with a 128 GB SSD. I am able to get this setup and working. I have dnsmasq setup and working. I can register and capture/deploy images to clients.
Now I want to setup our Synology Diskstation, which has 7.24 TB on ext4, so that I can store all of my images there. I am able to perform : sudo mount %.%.%.%:/volume1/fogImages /images
and the dashboard of the FOG server show the 7TB of space availible, however, when I try to capture an image from a client, I keep getting this errorcould not mount images folder (/bin/fog.upload)
reason: mount: mount IP:/images on /images failed: permission denied -
@george1421 So to update, I actually tore down and reinstalled Ubuntu 14 server and reinstalled fog 1.3.3
From there, I verified my Synology files
from there I used ssh and putty to remote in to my synology and ran the touch /images/.mntcheck and touch /images/dev/.mntcheck
still in the Synology terminal, I ran sudo chmod 777 -R /volume1/imagesNext, I logged in to my fresh clean fog server, setup the dnsmasq since we have our own DHCP,
Here is my /etc/exports:
and here is my /etc/fstab
So after doing pretty much nothing on the fog server, just setting up dnsmasq, I went to a windows machine I have on the network and logged into the fog/management website, created a new storage node:
I then took the username and password from fog settings -> tftp settings and I used this username and password for the new storage group and the user I created on the synology drive.
I have registered and captured an image successfully and the image is being stored on our synology NAS (set to RAID 0 - ext4). I have not tested snapins yet but that is another day.
I am going to call it solved. Thank you so much for your help, I was really turned around there on the storage node settings.
-
I don’t know what Synology is using for permissions on the device.
The issue, as I see it, is synology is meant to be it’s own “storage node”, not the mounted node on your fog server.
This means, you probably have an NFS share setup on your synology nas and that NFS is mounted to the FOG server to /images? WHile this will work to show you available disk space, you can’t mount an NFS mount twice. It just won’t work.
-
@Tom-Elliott Yes. NFS share on synology nas. So if I can’t mount the NFS share from the Synology, is there a better way to be able to use the storage on the NAS?
Would it be better to connect the NAS via USB to my Fog Server?
-
@chris-dees
You can NFS mount the Synology NAS, just not in the fashion you have created it.In Synology, you will need to create an FTP share as well (so you can upload images).
I’d recommend opening FOG and creating a new storage node.
On this storage node, you’ll enter your NAS’ ip addres, storage location and ftp location (yes they are typically different). Enter the user and password you created as well.
Make sure the nas location has a point for dev folder (
mkdir path/to/share/dev
) and make sure both the base and dev locations have the .mntcheck file (touch path/to/share/{dev/,}.mntcheck
) -
@Tom-Elliott while I have learned alot from the past couple of weeks, I am still new to linux.
I can PUTTY into the Synology. Are you saying, connect to the NAS (using ssh/putty), download and run the fog install from the Synology, choose storage mode and then, if the Synology is on 192.168.1.246 and my fog server is on 245,
enter NAS ip: 192.168.1.246
storage location: /images
FTP location: ??? /images
User: FOG
Pass: somePasswordtouch both /images and /images/dev .mntcheck
-
@Tom-Elliott Ok, so i removed all the mounted folders from my fog server, and I added a new storage node in FOG, I put in the IP of our NAS, i didn’t see anything listed as storage location but I did create an FTP share that I successfully connected to using filezilla with the user name and password in the storage node.
Is this all I need to do to get it to work?
-
I don’t know your NAS, but I would doubt the storage location is /images. Most commonly storage locations on NAS are at:
/volume1/imagesAnd ftp would be at:
/images/I’d recommend also making a separate location for snapins under:
/volume1/snapinsAs it’s unlikely Synology has these directories otherwise.
Again, i don’t know your layout, I can only tell you what others have run into before.
-
@Tom-Elliott I made some changes per your advise and I got past the mounting file system and now it is erroring out on the .mntcheck. I did the touch commands and I can see the files on the NAS but they are 0 bytes. should i copy the mntcheck files from the fog server or is there a different way of creating them?
I get
could not verify mount point, check if .mntcheck exists (/bin/fog.upload) -
@Tom-Elliott
I got a little farther. I was able to get the .mntcheck fixed but I am getting a permission error:failed to set permissions (prepareUploadLocation)
args Passd: /images/1866da47c92dI get a little further and then another error. any ideas on how to fix this one. The user account on the nas has read and write permission.
-
@chris.dees While this doesn’t directly relate to the Synology NAS, I did write a proof of concept to turn a windows server into a FOG storage node. https://forums.fogproject.org/topic/6941/windows-server-as-fog-storage-node-proof-of-concept-blog
What is worth noting is the directory structure and the specific nfs share permissions.
-
@george1421 So to update, I actually tore down and reinstalled Ubuntu 14 server and reinstalled fog 1.3.3
From there, I verified my Synology files
from there I used ssh and putty to remote in to my synology and ran the touch /images/.mntcheck and touch /images/dev/.mntcheck
still in the Synology terminal, I ran sudo chmod 777 -R /volume1/imagesNext, I logged in to my fresh clean fog server, setup the dnsmasq since we have our own DHCP,
Here is my /etc/exports:
and here is my /etc/fstab
So after doing pretty much nothing on the fog server, just setting up dnsmasq, I went to a windows machine I have on the network and logged into the fog/management website, created a new storage node:
I then took the username and password from fog settings -> tftp settings and I used this username and password for the new storage group and the user I created on the synology drive.
I have registered and captured an image successfully and the image is being stored on our synology NAS (set to RAID 0 - ext4). I have not tested snapins yet but that is another day.
I am going to call it solved. Thank you so much for your help, I was really turned around there on the storage node settings.
-
@chris.dees Sweet. I’m glad you got it worked out.
Just for reference I started a tutorial on setting up the synology as a FOG storage node to get this documented once and for all. https://forums.fogproject.org/topic/9430/synology-nas-as-fog-storage-node I might “borrow” bits from your post to make a cohesive how to, if you don’t mind.
-
@chris.dees Looking at your FOG configuration, be sure that there is only one master node in your storage group.
In your case you are using the synology nas as a master node, and not storing anything on the FOG server itself. This is an interesting configuration, which I’m a bit surprised that it actually worked. Good job!!
-
@george1421 Thank you. It seems to be working for the moment. When I get to work tomorrow, I can document all the settings. The one thing that I don’t like is the NAS storage node does not show on the dashboard but I can capture and image and deploy an image and it seems to be working well.
-
@chris.dees The reason it doesn’t show on the main dashboard is because we don’t have “control” over the nas presentation.
If you could create an app that provides the requisite files, this “could” work, but I don’t know where to begin on such a thing (as I don’t have one of these bad-ass – yes i like them i just can’t afford them lol things anyway).
The main thing is that it works and does what you need in terms of imaging though.
-
@Tom-Elliott I figured. We are using the Synology DS916+ on amazon for about $599.99. We are putting 4 4TB WD Red drives in it built on a RAID 0 (this is going to be our storage array so we are focusing on speed and not data redundancy since the images will be replicated from our main fog server)array on ext4. It also comes with 2 NICs so we teamed them together so we have a 2Gbps connection on the network.
-
@chris.dees Hey, I was just looking at your solution again, and I see something I’m not sure is working right.
You have mounted your NAS shares by NFS over /images, and yet on the FOG server you are exporting /images. AFAIK, you can’t reshare an NFS mounted directory.
-
@george1421 I believe you can share NFS itself, you can’t share a NFS share.
Basically two separate hosts can mount the same share.
If one one host you are trying to share the mounted share, however, you would hit issues.
-
@george1421 this can be seen when imaging two hosts at the same time via unicast.
-
@Tom-Elliott said in Setup Synology Diskstation as main storage for Fog Sever:
@george1421 this can be seen when imaging two hosts at the same time via unicast.
I guess I’ll have to take your word on this because I looked at the config files again and it looks like he is mounting 172.31.161.246:/volume1/images over /images in the fstab on the FOG server and then sharing out /images on the fog server in the /etc/exports file. The last time I tried that
showmount -e 127.0.0.1
showed no shares. But that was a while a go. I was trying to work on a way to create a skinny fog server VM with all files stored on an external NAS. That didn’t work so well.