Resource icon

[HOWTO] FreeNAS 11, RancherOS (Docker), and Portainer

Zwck

Patron
Joined
Oct 27, 2016
Messages
371
Since the folders have been created with the yml file, i am guessing the nfs3 client has been successfully installed. So can you try to mount the shares by hand just to see if you get an error message.

from the shell in rancheros do something like this

mount -t nfs 192.168.0.21:/mnt/MyVolume/Media /mnt/media
 
Last edited:

silverback

Contributor
Joined
Jun 26, 2016
Messages
134
as far as the yaml syntax goes its correct, and sudo ros config validate -i nfs.yml was fine.

I dont knwo if maybe by freenas NFS shares are messed up? I have never really used NFS shares so maybe thats the problem. Also, when I am in Filebot-Node, it doesn't even access /mnt/.
Finally, in /mnt/ there is the media and config folder so its created the mount points, just nothing in there.

Hi,
Thanks to all the contributors to this thread.

I don't know if this is relevant or not, but for me when creating mounted volumes from a dataset. I had to make an individual share for each sub dataset in the main dataset.

Struggled with this for a bit but got it to work this way.
 

Muddro

Explorer
Joined
Oct 6, 2014
Messages
59
Hi,
Thanks to all the contributors to this thread.

I don't know if this is relevant or not, but for me when creating mounted volumes from a dataset. I had to make an individual share for each sub dataset in the main dataset.

Struggled with this for a bit but got it to work this way.
Ill give that a try. So if my volume is called MyVolume, with a MyVolume dataset, and subdata set of Media, docker, iohyve and jails. You made one for MyVolume and Media, or just Media? And what type of permissions did you use?
 

silverback

Contributor
Joined
Jun 26, 2016
Messages
134
Ill give that a try. So if my volume is called MyVolume, with a MyVolume dataset, and subdata set of Media, docker, iohyve and jails. You made one for MyVolume and Media, or just Media? And what type of permissions did you use?
Code:
#/var/lib/rancher/conf/cloud-config.d/nfs.yml
write_files:
- path: /etc/rc.local
	permissions: "0755"
	content: |
	 #!/bin/bash
	 [ ! -e /usr/bin/docker ] && ln -s /usr/bin/docker.dist /usr/bin/docker

rancher:
services:
	nfs:
	 image: d3fk/nfs-client
	 labels:
		io.rancher.os.after: console, preload-user-images
		io.rancher.os.scope: system
	 net: host
	 privileged: true
	 restart: always
	 volumes:
		- /usr/bin/iptables:/sbin/iptables:ro
		- /mnt/config:/mnt/MyVolume/docker:shared
		- /mnt/media:/mnt/MyVolume/Media:shared
	 environment:
		SERVER: 192.168.1.21
		SHARE: /mnt/MyVolume/docker
		MOUNTPOINT: /mnt/config

#cloud-config
mounts:
- ["192.168.1.21:/mnt/MyVolume/docker", "/mnt/config", "nfs", ""]
- ["192.168.1.21:/mnt/MyVolume/Media", "/mnt/media", "nfs", ""]


Well, I was talking about empty sub datasets when i tried to share my media dataset. When i tried to share my entire media dataset the sub directories would appear in /mnt/media on the rancher host but they would be empty. Unfortunately this does not seem to be the problem that you are having.


As far as permissions go, I used the directions of the op being docker:docker user and group and used the recursive permission check box.


Before I started any containers I put a test file in what would be your /mnt/MyVolume/docker share so that i could see that it propagated to the rancher host at /mnt/config.


If you wanna have a look at the .yml that I made some changes to, also as Zwck suggested posting a screenshot of your share configuration would be helpful.
 

Zwck

Patron
Joined
Oct 27, 2016
Messages
371

- ["192.168.1.21:/mnt/MyVolume/docker", "/mnt/config", "nfs", ""]


this line is not necessary as you mount it with the lines before
 

chbla

Explorer
Joined
Nov 8, 2016
Messages
62
Can anyone tell me what to do if there is no cd0 in grub (as shown with 'ls')?
I did exactly the same steps
 

Zwck

Patron
Joined
Oct 27, 2016
Messages
371
Can anyone help with this please?
i am confused. i suppose you are after the step when you type in
sudo iohyve console rancheros

and define cd0 no ls needed just copy and paste

grub> set root=(cd0,msdos1)
grub> linux /boot/vm<TAB> ro rancher.password=rancher
grub> initrd /boot/initrd<TAB>
grub> boot

I personally had problems with the console sometimes, as it did not correctly recognized what i was typing, other than that the instructions are quite straight forward
 

chbla

Explorer
Joined
Nov 8, 2016
Messages
62
i am confused. i suppose you are after the step when you type in
sudo iohyve console rancheros

and define cd0 no ls needed just copy and paste

grub> set root=(cd0,msdos1)
grub> linux /boot/vm<TAB> ro rancher.password=rancher
grub> initrd /boot/initrd<TAB>
grub> boot

I personally had problems with the console sometimes, as it did not correctly recognized what i was typing, other than that the instructions are quite straight forward

Thanks for the reply I'm basically at the steps:
iohyve install RancherOS rancheros.iso
then log in to the console on another shell

'ls' lists the devices afaik, and it displays only: (hd0) (host)
if I then try linux /boot<tab> it does not find anything, if I hit enter to test it, it says:
error: disk 'cd0,msdos1' not found.

what am I doing wrong?
 

Zwck

Patron
Joined
Oct 27, 2016
Messages
371
what am I doing wrong?

I cannot tell you what you do wrong, but after you " sudo iohyve console rancheros" you should just be greeted with a grub> shell, if thats the case you need to define the cd0 first with > set root=(cd0,msdos1)

I installed the RancherOS at least 70 times by now, and i never had an issue with what you described. I also wrote some notes for me, just to have a reference https://blog.zwck.de/setting-up-rancheros-in-freenas-9-10-3-rc1/ maybe there is something you missed.

The only thing i can think of is that you loaded a differnt rancheros version, at somepoint the changed the internal bootloader so i always use 0.6.1 (which updates automatically to the LTS version) https://github.com/rancher/os/releases/download/v0.6.1/rancheros.iso
 

chbla

Explorer
Joined
Nov 8, 2016
Messages
62
That's what I do. Can you maybe tell me what the 'ls' command in grub lists for you?

If I do: set root=(cd0,msdos1)
and then do linux /boot/vm and press tab, there is nothing

Edit: When I used the 0.6.1 iso image, it worked :/
Thanks for the hint!
 
Last edited:

Zwck

Patron
Joined
Oct 27, 2016
Messages
371
oh so you got it going! awesome, have fun !

I hope the internal VM GUI of freenas 11 will receive an update soon so it supports just click and play vms (rancheros)
 
Last edited:

nfdevil

Dabbler
Joined
May 5, 2014
Messages
15
sudo iohyve console rancheros

Look, a bootloader! Enter the commands below to get it to actually boot into the installer. Use the TAB key where I say so it will auto-fill in case the version of the installer you downloaded is newer than mine. (Make note of these commands somewhere! You will need them later.)

Code:
grub> set root=(cd0,msdos1)
grub> linux /boot/vm<TAB> ro rancher.password=rancher
grub> initrd /boot/initrd<TAB>
grub> boot


It's alive! Login with the username and password rancher/rancher. Run the below command to edit cloud-config.yml so we can put your SSH key in. Oh yeah, generate a ssh keypair to use for access. On windows I used puTTY to generate my keypair.
[rancher@rancher ~]$ vi cloud-config.yml

I'm not getting the 'grub> ' when using the command sudo iohyve console rancheros in a new session after letting the install run in another session.
I'm getting 'OK ' instead after pressing ENTER.
Here I can't send the commands you are giving and can't use the TAB-autofill .

Any idea what could be wrong?
 

Zwck

Patron
Joined
Oct 27, 2016
Messages
371

nfdevil

Dabbler
Joined
May 5, 2014
Messages
15

I did, the same result:


root@nas:/mnt/storage/media # iohyve rmiso rancheros.iso
Deleting rancheros.iso...
root@nas:/mnt/storage/media # iohyve fetch https://github.com/rancher/os/releases/download/v0.6.1/rancheros.iso
Fetching https://github.com/rancher/os/releases/download/v0.6.1/rancheros.iso...
/iohyve/ISO/rancheros.iso/rancheros.iso 100% of 41 MB 4880 kBps 00m09s
root@nas:/mnt/storage/media # iohyve isolist
Listing ISO's...
rancheros.iso
root@nas:/mnt/storage/media # iohyve list
Guest VMM? Running rcboot? Description
ranch NO NO YES Wed Aug 23 20:19:29 CEST 2017
root@nas:/mnt/storage/media # iohyve install ranch rancheros.iso
Installing ranch...


Second session:


ssh nas
devil@nas's password:
Last login: Fri Aug 25 16:33:40 2017 from 192.168.0.107
FreeBSD 11.1-STABLE (FreeNAS.amd64) #0 bd01b851a(freenas/11-stable): Wed Aug 23 05:51:42 UTC 2017

FreeNAS (c) 2009-2017, The FreeNAS Development Team
All rights reserved.
FreeNAS is released under the modified BSD license.

For more information, documentation, help or support, go here:
http://freenas.org
Welcome to FreeNAS
devil@nas:~ % sudo su
Password:
root@nas:/mnt/storage/media # sudo iohyve console ranch
Starting console on ranch...
~~. to escape console [uses cu(1) for console]
Connected

OK
OK
OK
OK
 

Zwck

Patron
Joined
Oct 27, 2016
Messages
371
I did, the same result:


root@nas:/mnt/storage/media # iohyve rmiso rancheros.iso
Deleting rancheros.iso...
root@nas:/mnt/storage/media # iohyve fetch https://github.com/rancher/os/releases/download/v0.6.1/rancheros.iso
Fetching https://github.com/rancher/os/releases/download/v0.6.1/rancheros.iso...
/iohyve/ISO/rancheros.iso/rancheros.iso 100% of 41 MB 4880 kBps 00m09s
root@nas:/mnt/storage/media # iohyve isolist
Listing ISO's...
rancheros.iso
root@nas:/mnt/storage/media # iohyve list
Guest VMM? Running rcboot? Description
ranch NO NO YES Wed Aug 23 20:19:29 CEST 2017
root@nas:/mnt/storage/media # iohyve install ranch rancheros.iso
Installing ranch...


Second session:


ssh nas
devil@nas's password:
Last login: Fri Aug 25 16:33:40 2017 from 192.168.0.107
FreeBSD 11.1-STABLE (FreeNAS.amd64) #0 bd01b851a(freenas/11-stable): Wed Aug 23 05:51:42 UTC 2017

FreeNAS (c) 2009-2017, The FreeNAS Development Team
All rights reserved.
FreeNAS is released under the modified BSD license.

For more information, documentation, help or support, go here:
http://freenas.org
Welcome to FreeNAS
devil@nas:~ % sudo su
Password:
root@nas:/mnt/storage/media # sudo iohyve console ranch
Starting console on ranch...
~~. to escape console [uses cu(1) for console]
Connected

OK
OK
OK
OK

what happens if you click onto the shell hit enter (or hit escape or ~~.) and type
sudo iohyve console ranch
 
Last edited:

nfdevil

Dabbler
Joined
May 5, 2014
Messages
15
what happens if you click onto the shell hit enter and type
sudo iohyve console ranch
http://imgur.com/a/9tvHH
9tvHH

9tvHH

and then pressing enter doesn't do anything, it's just stuck
 

Zwck

Patron
Joined
Oct 27, 2016
Messages
371

Zwck

Patron
Joined
Oct 27, 2016
Messages
371
Top