Docker, RancherOS, and zvol

sinjinn

Cadet
Joined
Aug 19, 2018
Messages
3
Hi,
I am looking for a bit of advice or guidance.

I recently installed FreeNAS-11.2 Beta and was playing around with docker containers. I was able to get the Nextcloud docker image running and stored persistent data to a mounted volume created inside rancher. Everything worked perfectly.

I want to have my persistent data be on a dataset though and not inside the RancherVM, so I NFS mounted a dataset from inside rancher and pointed my Nextcloud docker image (via bind) directly to the mounted share. This 'almost' worked, since the Nextcloud docker image could write to the share (saw all the files appear on the share), but could not chown any of the permissions (docker logs showed slew of permission chown permission failures).

I researched a bit more and saw that I could attach a Disk Device to the RancherVM. I created a zvol, and attached the disk device. I now have a /dev/sdb showing up in rancher. I believe I can now mount this in rancher and expose it as a volume that I can use as a mount point in the Nextcloud docker image.

I read through the documentation and I have been searching for a while though and cannot determine if I'm going about this in the correct way. I don't see much info on zvols being used in this way so I'm a little concerned I'm not going down the proper path.

I have seen examples for Plex, but they use NFS mounted shares. On a side note, I'm assuming that I'm having permission issues because the Nextcloud docker image can write (I see all the Nextcloud files show up in the NFS share on boot), but cannot change ownership of files (seems like it is attempting to do that and I get a slew of permission errors).

If I am going about this in a correct way (zvol); I'm assuming that I need to format and create a filesystem on the new 'disk' inside rancher, since rancher doesn't really know what that is aside from a disk device.

If NFS is the way to go, are there any thoughts on what I can do so that the docker image has permission to chmod on the nfs share? I tried a variety of settings with the share, but just couldn't get it.

Thank you in advance for any advice or pointers you can provide.
 

sinjinn

Cadet
Joined
Aug 19, 2018
Messages
3
I haven't, but might give it another go this weekend. I'll probably format the zvol and try what I was thinking before.
 

sinjinn

Cadet
Joined
Aug 19, 2018
Messages
3
Just an update... Just put ext4 on the zvol and mounted it in rancher. The Nextcloud docker container is now using the zvol and it works well. I love the flexibility of being able to do all this within FreeNAS.
 

Frikkie

Dabbler
Joined
Mar 10, 2019
Messages
41
Just an update... Just put ext4 on the zvol and mounted it in rancher. The Nextcloud docker container is now using the zvol and it works well. I love the flexibility of being able to do all this within FreeNAS.
Hi, sinjinn. I am currently trying to setup a local steam cache server and am running into issues with mounting. Would you care to elaborate in detail how you achieved the mount and format?
At the moment I am trying to mount a zvol from my FreeNAS host, which is adding added as a device for the rancherOS docker host.
Thanks in advance!
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
You're probably going to find that the performance and reliability of that method is no good.

Since the docker host is RancherOS, you could use the rancher server option of installing the rancher-nfs driver and then doing your NFS mount that way.
 
Top