Network settings should be set in oem cloud-config.yml #11
Comments
Hm, cloudinit should restart networkd if it writes out any .network units.
|
I have just deleted The boot log shows that After the second reboot, the machine was reachable again, and DHCP didn't get applied on the interface statically configured through |
@dsimunic I haven't been able to reproduce this in my environment. Can you confirm whether or not this is still an issue? |
@crawford yes, I did have this issue again setting up new servers two weeks ago. An extra reboot was required for machines to pick up |
@dsimunic would you mind sharing your cloudconfig? |
@crawford sure, here's one for the test machine:
I'm on vacation until the 21st, so won't be able to test this again and share the boot log in case you can't repro it with the latest release. |
Ah, as I suspected. Rather than adding static.network under write_files, put that under coreos.units. After writing out the unit, cloud-init will restart networkd causing it to load the new configuration. Since this was under write_files, cloud-init was unaware that it should restart networkd. coreos:
units:
- name: static.network
runtime: yes
content: |
[Match]
MACAddress=00:1c:c4:87:c5:2e
[Network]
Gateway=192.168.1.1
Address=192.168.1.5/24
DNS=8.8.8.8 I'm going to close this for now (enjoy your vacation). Re-open it if you run into any other issues. |
Thanks. Maybe it would be good to mention this in the docs. Current wording hints at using |
You are absolutely right. I'll fix that right now. |
+1. The thing is that Thanks. |
And, and will this also restart |
While they aren't technically systemd units, it makes sense to group them with the rest of the units. If cloudinit encounters a .network, .netdev, or .link "unit", it will restart networkd after writing the file. |
Thanks for the clarification, @crawford. Could you please clarify one more thing: I am trying to change my interface link name, with a
Will the networkd restart be sufficient to effect the desired change? I'm not seeing it, and not sure what I'm doing wrong. Then again, reboots aren't helping either, so I suspect it's my config. Interestingly, it's writing the unit to be /run/ and /etc/ |
The cloud-init option (
-c
) for bare metal install copies thecloud-init.yml
into/var/lib/coreos-install/user_data
. If one specified changes for network in that file (for example, writing outstatic.networking
), those changes won't be executed until the next reboot, asuser_data
is parsed after thenetwork.service
started.Looking at the boot journal, it appears that
usr/share/oem/cloud-config.yml
gets processed before the network.service is started, so this seems to be the right place for networking changes.It is a minor annoyance, it would be great if at least the documentation mentions that.
The text was updated successfully, but these errors were encountered: