spurin/diveintoansible-lab

Cannot run lab. Fedora 32

Closed this issue · 6 comments

@spurin
I'm trying to run the lab, but it's giving me some errors on the ubuntu containers... please Help

➜  diveintoansible-lab (mine) ✔ docker-compose up
Creating ubuntu-c ... done
Creating centos1  ... done
Creating ubuntu1  ... done
Creating docker   ... done
Creating centos3  ... done
Creating ubuntu2  ... done
Creating centos2  ... done
Creating ubuntu3  ... done
Creating portal   ... done
Attaching to ubuntu-c, centos1, docker, centos3, ubuntu3, centos2, ubuntu1, ubuntu2, portal
ubuntu-c exited with code 255
ubuntu1 exited with code 255
ubuntu3 exited with code 255
ubuntu2 exited with code 255
portal      | 2021/04/19 19:07:52 [emerg] 1#1: host not found in upstream "ubuntu1" in /etc/nginx/conf.d/default.conf:46
portal      | nginx: [emerg] host not found in upstream "ubuntu1" in /etc/nginx/conf.d/default.conf:46
portal exited with code 1

I have done the respective changes to the config file

UBUNTU1_PORT_SSHD=2222                                                                                                                                      
  UBUNTU2_PORT_SSHD=2223                                                                                                                                      
  UBUNTU3_PORT_SSHD=2224                                                                                                                                      
  CENTOS1_PORT_SSHD=2225                                                                                                                                      
  CENTOS2_PORT_SSHD=2226                                                                                                                                      
  CENTOS3_PORT_SSHD=2227                                                                                                                                      
                                                                                                                                                              
  # ttyd (web terminal) ports                                                                                                                                 
  UBUNTUC_PORT_TTYD=7681                                                                                                                                      
  UBUNTU1_PORT_TTYD=7682                                                                                                                                      
  UBUNTU2_PORT_TTYD=7683                                                                                                                                      
  UBUNTU3_PORT_TTYD=7684                                                                                                                                      
  CENTOS1_PORT_TTYD=7685                                                                                                                                      
  CENTOS2_PORT_TTYD=7686                                                                                                                                      
  CENTOS3_PORT_TTYD=7687                                                                                                                                      
                                                                                                                                                              
  # Shared config volume                                                                                                                                      
  CONFIG=/home/ely/diveintoansible-lab/config                                                                                                                 
                                                                                                                                                              
  # Shared home directories                                                                                                                                   
  ANSIBLE_HOME=/home/ely/diveintoansible-lab/ansible_home  

Heres is the folder structure after I bring compose up

➜  diveintoansible-lab (mine) ✔ ls -lhat                
total 192K
drwx------. 47 ely  ely  4.0K Apr 19 13:08 ..
drwxr-xr-x.  8 ely  ely  4.0K Apr 19 13:08 .git
-rw-r--r--.  1 ely  ely   515 Apr 19 13:04 .env
drwxr-xr-x. 10 root root 4.0K Apr 19 12:27 ansible_home
drwxr-xr-x.  5 ely  ely  4.0K Apr 19 12:27 .
drwxr-xr-x.  2 ely  ely  4.0K Apr 19 11:46 config
-rw-r--r--.  1 ely  ely  4.0K Apr 19 11:46 docker-compose.yaml
-rwxr-xr-x.  1 ely  ely  5.8K Apr 19 11:46 README.md
-rw-r--r--.  1 ely  ely  156K Apr 19 11:46 DiveIntoAnsible_Cover.png

Compose and Docker versions :

➜  diveintoansible-lab (mine) ✔ docker --version
Docker version 20.10.6, build 370c289
➜  diveintoansible-lab (mine) ✔ docker-compose --version
docker-compose version 1.29.1, build c34c88b2

Hi @yokodev

This is related to this Linux version having cgroups v2 instead of v1, it affects Docker and Kubernetes. Fedora is more of a bleeding edge release so sometimes these kind of issues arise before they're widely adopted and resolved.

If you revert to cgroup v1 using the following commands, you'll be good to go -

sudo dnf install grubby

sudo grubby --update-kernel=ALL --args="systemd.unified_cgroup_hierarchy=0"

Then, reboot

Best Regards

James Spurin

Thanks for the quick reply... Is there any other way of doing this? I'm not sure I want to downgrade the Cgroups.
I was reading about it and apparently, it brings some good stuff to the table... Please Advice

Hi @yokodev

At the moment I don't have a way of making the lab images work for both cgroups v1 and v2 unfortunately, it is an area I'm looking into.

This post gives some more context on the difficulties (the lab images, use systemd to emulate a real system) -

https://serverfault.com/questions/1053187/systemd-fails-to-run-in-a-docker-container-when-using-cgroupv2-cgroupns-priva

After doing the course, you could revert the settings if desired to put this back as it was 👍

Hello, I am having the same issue but on Arch Linux. I already edited GRUB to start with systemd.unified_cgroup_hierarchy=0.

[aquinas@cave diveintoansible-lab]$ cat /proc/cmdline BOOT_IMAGE=/vmlinuz-linux root=UUID=ef929d12-55e4-4d64-bc41-41f4239bda4f rw loglevel=3 quiet systemd.unified_cgroup_hierarchy=0

EDIT: it works now :) all I had to do was run docker-compose rm and then docker-compose up

Hi,

With the system booted, what's the output you have when running mount please?

Thanks

James

Ahh perfect! I replied without seeing the edit, glad it's all working for you!