lxc / distrobuilder

System container image builder for LXC and Incus
https://linuxcontainers.org
Apache License 2.0
571 stars 165 forks source link

No IPv4 from macvlan interface on centos8 on LXD 3.0.3 #444

Closed technicalflow closed 1 year ago

technicalflow commented 3 years ago

Issue description

Hello All

I got Ubuntu 18.04 install on hardware and got issues running centos8 in lxd container on macvlan profile. When launching any container on lxdbr0 I got IPv4 address - even on centos8 images. When launching any container (beside centos8) on macvlan I got IPv4 address, only centos8 got trouble. On centos8 I cannot start eth0 interface when launching with macvlan profile. Tried this workaround and does not help Same happens on centos/8 and centos/8/cloud. Adding privileged setting also does not help. ifup eth0 Error: Connection activation failed: No suitable device found for this connection (device lo not available because device is strictly unmanaged).

Required information

Steps to reproduce

  1. Step one lxc launch images:centos/8 cn6 -p macvlan
  2. Step two lxc exec cn6 bash
  3. Step three ip a && ifup eth0

lxc config show cn6 --expanded architecture: x86_64 config: image.architecture: amd64 image.description: Centos 8 amd64 (20210530_07:08) image.os: Centos image.release: "8" image.serial: "20210530_07:08" limits.cpu: "2" limits.memory: 2GB limits.memory.enforce: soft limits.memory.swap: "false" user.user-data: |

cloud-config

package_upgrade: true
packages:
- curl
locale: en_GB.UTF-8
timezone: Europe/Warsaw
runcmd:
- [touch, /tmp/one]

volatile.base_image: 81ead575d0af5e62f761c49e86889b24f8a4583278e4dde71930f27c364f2ebe volatile.eth0.hwaddr: 00:16:3e:72:6b:79 volatile.idmap.base: "0" volatile.idmap.next: '[{"Isuid":true,"Isgid":false,"Hostid":100000,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":100000,"Nsid":0,"Maprange":65536}]' volatile.last_state.idmap: '[{"Isuid":true,"Isgid":false,"Hostid":100000,"Nsid":0,"Maprange":65536},{"Isuid":false,"Isgid":true,"Hostid":100000,"Nsid":0,"Maprange":65536}]' volatile.last_state.power: RUNNING devices: eth0: name: eth0 nictype: macvlan parent: enp0s10 type: nic root: path: / pool: defaultsp1 type: disk ephemeral: false profiles:

From inside container systemctl --failed UNIT LOAD ACTIVE SUB DESCRIPTION
sys-kernel-config.mount loaded failed failed Kernel Configuration File System

journalctl -xe May 30 13:02:20 cn6 systemd-journald[140]: Runtime journal (/run/log/journal/25a9046e4f414316b71a05d97db99628) is 8.0M, max 385.9M, 377.9M free. Subject: Disk space used by the journal Defined-By: systemd Support: https://access.redhat.com/support Runtime journal (/run/log/journal/25a9046e4f414316b71a05d97db99628) is currently using 8.0M. Maximum allowed usage is set to 385.9M. Leaving at least 578.9M free (of currently available 3.7G of disk space). Enforced usage limit is thus 385.9M, of which 377.9M are still available. The limits controlling how much disk space is used by the journal may be configured with SystemMaxUse=, SystemKeepFree=, SystemMaxFileSize=, RuntimeMaxUse=, RuntimeKeepFree=, RuntimeMaxFileSize= settings in /etc/systemd/journald.conf. See journald.conf(5) for details. May 30 13:02:20 cn6 systemd-sysctl[137]: Couldn't write '0' to 'kernel/yama/ptrace_scope', ignoring: Permission denied May 30 13:02:20 cn6 mount[136]: mount: /sys/kernel/config: permission denied. May 30 13:02:20 cn6 systemd-sysctl[137]: Couldn't write '|/usr/lib/systemd/systemd-coredump %P %u %g %s %t %c %h %e' to 'kerne l/core_pattern', ignoring: Permission denied May 30 13:02:20 cn6 systemd-sysctl[137]: Couldn't write '16' to 'kernel/sysrq', ignoring: Permission denied May 30 13:02:20 cn6 systemd-sysctl[137]: Couldn't write '1' to 'kernel/core_uses_pid', ignoring: Permission denied May 30 13:02:20 cn6 systemd-sysctl[137]: Couldn't write '1' to 'kernel/kptr_restrict', ignoring: Permission denied May 30 13:02:20 cn6 systemd-sysctl[137]: Couldn't write 'fq_codel' to 'net/core/default_qdisc', ignoring: No such file or dire ctory May 30 13:02:20 cn6 systemd-sysctl[137]: Couldn't write '1' to 'fs/protected_hardlinks', ignoring: Permission denied May 30 13:02:20 cn6 systemd-sysctl[137]: Couldn't write '1' to 'fs/protected_symlinks', ignoring: Permission denied May 30 13:02:20 cn6 systemd-sysctl[137]: Couldn't write '81920' to 'net/core/optmem_max', ignoring: No such file or directory

May 30 13:02:20 cn6 systemd-sysctl[137]: Couldn't write '4194304' to 'kernel/pid_max', ignoring: Permission denied May 30 13:02:20 cn6 systemd[1]: Starting Flush Journal to Persistent Storage... -- Subject: Unit systemd-journal-flush.service has begun start-up

1 loaded units listed. Pass --all to see loaded but inactive units, too. To show all installed unit files use 'systemctl list-unit-files'.

tomponline commented 3 years ago

@stgraber I believe this is a known issue with centos 8 and macvlan, namely that network manager doesn't recognize it as a managed Ethernet device as it sees it as a preconfigured macvlan interface as ignores it. Worth moving to distrobuilder?

stgraber commented 3 years ago

Yeah, we can move the issue to distrobuilder to see if there's a workaround we can put in place in our shiny new systemd-generator.

monstermunchkin commented 1 year ago

@technicalflow is this still an issue for you?

technicalflow commented 1 year ago

Hello @monstermunchkin

No, it is an old issue with container image.