NetworkManager cannot manage macvlan devices inside container
Under the following conditions:
- Using container instances (e.g., LXC)
- macvlan networking is defined for a particular network interface (e.g.,
eth0
defined as typemacvlan
with parent interfaceeno0
) - if NetworkManager is running
Then:
Attempting to bring up the interface will fail with the following error:
[root@centos-8-stream-cloud ~]# ifup eth0
Error: Connection activation failed: No suitable device found for this connection (device lo not available because device is strictly unmanaged).
Note: The requested interface is eth0
not lo
. The error is for lo
. The interface lo
is up.
[root@centos-8-stream-cloud ~]# ip addr show lo
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
Workaround:
The following workarounds can be used if you don't require network access to manage the instance and only if network-scripts is installed.
- Disable NetworkManager. Then
ifup eth0
brings up the interface with no error. - Add
NM_CONTROLLED=no
to/etc/sysconfig/network-scripts/ifcfg-eth0
. Note that this is the default for cloud-init, but RedHat has patched this out of their version. Also addingNM_CONTROLLED=no
toifcfg-lo
does not alter the behavior or error message.
However, cloud instances are often only available over the network. Where networking is expected to work and the primary access method is via ssh, these instances are unusable and unfixable. This presents a major problem.
Desired outcome:
Given the fact that the interface comes up just fine without NetworkManager, NetworkManager needs to get over its hangup regarding macvlan interfaces. The interface works fine. It's just NetworkManager's inability to recognize this and do the right thing.