Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NetworkManager activator failed to apply DataSourceNoCloudNet network configuration #6064

Open
xiachen-rh opened this issue Mar 3, 2025 · 1 comment
Labels
bug Something isn't working correctly new An issue that still needs triage

Comments

@xiachen-rh
Copy link
Contributor

xiachen-rh commented Mar 3, 2025

Bug report

I tested “(NoCloudNet): Add network-config support” (24.3+) with a RHEL KVM instance and found that when network-config contains static IP, cloud-init created configuration file but it was ineffective.
The root cause is the command ['systemctl', 'reload-or-try-restart', 'NetworkManager.service'] does not restart the interface.

We may need the solution that Ani mentioned before, see this comment
#5512 (comment)

I also have another question about "“Applying network configuration from fallback” in " "init-local" stage, which created the DHCP network configuration, is it expected or not?

Steps to reproduce the problem

Prepare network data in http server and then launch a KVM instance
For example, using rhel9 guest image which contains cloud-init 24.4 to create a KVM instance,

  • local network define

br1.xml

<network>
<name>br1</name>
<bridge name='virbr1'/>
<forward/>
<ip address='10.0.2.1' netmask='255.255.255.0'>
<dhcp>
<range start='10.0.2.2' end='10.0.2.254'/>
</dhcp>
</ip>
</network>

virsh net-define br1.xml
virsh net-start br1

  • prepare network data as below and start http server “python3 -m http.server 8000 &”
network-config
#cloud-config
network:
config:
- name: eth0
subnets:
- address: 10.0.2.2/24
gateway: 10.0.2.1
type: static
type: physical
- type: nameserver
interface: eth0
address:
- 8.8.8.8
- 4.4.4.4
search:
- example.com
version: 1
  • launch an KVM instance by virt-install command

sudo virt-install --name ${DOMAIN_NAME} --disk /var/lib/libvirt/images/${RHEL_CLOUD_IMAGE},device=disk,bus=virtio,format=qcow2 --os-variant rhel-unknown --network bridge=virbr1,model=virtio --graphics none --sysinfo system.serial="ds=nocloud;s=http://10.0.2.1:8000/" --import

  • virsh console login and got that IP is DHCP configured, the static IP configured in ifcfg-eth0 but it did not take effect
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 52:54:00:f5:77:1c brd ff:ff:ff:ff:ff:ff
altname enp1s0
inet 10.0.2.182/24 brd 10.0.2.255 scope global dynamic noprefixroute eth0
valid_lft 2806sec preferred_lft 2806sec
inet6 fe80::5054:ff:fef5:771c/64 scope link noprefixroute
valid_lft forever preferred_lft forever
 
$ nmcli -f NAME,FILENAME c show
NAME FILENAME
System eth0 /etc/sysconfig/network-scripts/ifcfg-eth0
lo /run/NetworkManager/system-connections/lo.nmconnection
 
 
$ cat /etc/sysconfig/network-scripts/ifcfg-eth0
# Created by cloud-init automatically, do not edit.
#
AUTOCONNECT_PRIORITY=120
BOOTPROTO=none
DEFROUTE=yes
DEVICE=eth0
GATEWAY=10.0.2.1
IPADDR=10.0.2.2
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet
USERCTL=no

Environment details

  • Cloud-init version: cloud-int 24.4
  • Operating System Distribution: rhel9
  • Cloud provider, platform or installer type:KVM

cloud-init logs

cloud-init_rhel9.log

@xiachen-rh xiachen-rh added bug Something isn't working correctly new An issue that still needs triage labels Mar 3, 2025
@xiachen-rh
Copy link
Contributor Author

xiachen-rh commented Mar 3, 2025

RHEL internal ticket https://issues.redhat.com/browse/RHEL-81703

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working correctly new An issue that still needs triage
Projects
None yet
Development

No branches or pull requests

1 participant