Understanding VM's, Docker, Rancher/RancherOS, IPs and Containers

Status
Not open for further replies.

shawndewet

Dabbler
Joined
Feb 28, 2014
Messages
37
(Disclaimer: this is just me penning my thoughts and questions about the installation process, but also as a reference for me to come back to in a year or two or three from now when my server has died (or I have outgrown it and it needs replacement) and I need to go through this again)

I have followed the FreeNAS 11.1 Guide and created a DockerVM, and then eventually got a Crashplan container running successfully to backup data in my FreeNAS zvol.
But I must be honest, and confess that I don't quite understand how all this hangs together.
What is the role of Rancher or RancherOS in this? what is the role of Docker in this? What is the role of the host in rancher?

For example, the FreeNAS guide says that when the DockerVM is started the first time, "it downloads the Rancher disk image file". Then once it is started, you use the terminal to execute the "cu" command to get to the rancher login. Once logged in to rancher, you must "Download and install the rancher server with this command: docker run [other settings here] rancher/server"

But what is the difference between the "Rancher disk image file" that got downloaded when I first started the VM, and this 'rancher/server' image that is now being downloaded? The fact that I just did a Rancher login in order to even run this command tells me Rancher is already installed?

It seems to me that what I am seeing here is the difference between RancherOS, and Rancher Server? Is RancherOS what got installed when I first ran the DockerVM, what the guide refers to as "it downloads the Rancher disk image file"? That is RancherOS(?).

Anyway, so after "rancher/server" is complete, you give it a minute or so to start up, and then you can access it's web UI by navigating your browser to [VM ip address]:8080. Your first task now is to add a host. But don't I already have a host?
Is the host not the DockerVM that got created in my FreeNAS ui? That host which is running RancherOS, and is already hosting the RancherServer container just created by the earlier "docker run [] rancher/server" command?

Evidently not. After creating the host (which itself is created with the following docker command
sudo docker run [other settings] rancher/agent:v1.2.9), it turns out that on it are a number of containers running, one of which is named "dazzling_visvesvaraya", which seems to be the Rancher Server?!?
So it seems this is what happens:
  1. Create a DockerVM using FreeNAS UI. This host installs RancherOS (makes sense...after all, every host needs an OS).
  2. This OS knows about Docker, and so we use "docker run [...] rancher/server" to create and run the rancher (server?) container, which has a UI that we can access via port 8080.
  3. Use this UI to create a host with the "docker run [...] rancher/agent" command.
Now it seems like the rancher/server container from step 2 is now running on this host that just got created in step 3? Honestly I don't get it. Did this host creation MOVE the rancher/server container from the DockerVM onto the created host? Your comments would be appreciated.

Anyway, I created the host, and then I added the 'jlesage/crashplan-pro' container, not knowing how exactly I am going to get this container to "see" the files on my FreeNAS volume that I want it to back up. It turns out that I first needed to add (from the Rancher catalogue) the "rancher-nfs" container. I had to be careful about the folder mapping though, and eventually got it working through trial and error. The data I want to back up on my FreeNAS volume is in a folder /mnt/Volume1/Fotos. I had to use FreeNAS to create a NFS share on /mnt/Volume1. This is what I pointed the rancher-nfs configuration at. Then I had to add a "Volume" called Fotos (in the Infrastructure/Storage menu). Then when installing the 'jlesage/crashplan-pro' container, I had to specify -v Fotos:/storage in the command, along with specifying rancher-nfs as the --volume-driver to the docker run command. Now I am able to browse the crashplan UI via [DockerVM ip]:5800

In Rancher, when I list Hosts (and uncheck System containers), I now see my crashplan-pro container (expected) and the rancher-server container (unexpected) running on the one host that I have.

Interestingly, the Host shows as "disconnected" (a day or two later), and I don't know what to do about that, but I am still able to browse my crashplan UI, and it is backing up, so I'll not worry too much about this for now, but it does raise an eyebrow?!? What is it disconnected from?

I have not even ventured into the purpose of creating different Environments or multiple Hosts in Rancher...but I guess that's a rant for another post.
 
Last edited:

shawndewet

Dabbler
Joined
Feb 28, 2014
Messages
37
Nope...but as I do, I guess I will revisit this thread and contribute my findings.
 
Status
Not open for further replies.
Top