(Network) Config Version 2 is not working on CentOS 7.4
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Expired
|
Undecided
|
Unassigned |
Bug Description
We're using CentOS 7.4.1708.
My config (using NoCloud ISO):
#### meta-data
#cloud-config
instance-id: iid-<hostname>
local-hostname: <fqdn>
#### user-data
#cloud-config
write_files:
- content: |
# This file is automatically generated by cloud-init!
172.29.6.61 <fqdn> <hostname>
127.0.0.1 localhost localhost.
::1 localhost localhost.
path: /etc/hosts
#### network-config:
version: 1
config:
- type: physical
name: eth0
subnets:
- type: static
address: <ip>/16
- <DNS1>
- <DNS2>
dns_search:
- <DNS_DOMAIN>
- type: route
destination: 0.0.0.0/0
gateway: <GATEWAY>
I've disabled NetworkManager, and enabled the 'old' network daemon with chkconfig.
Things that do not work:
gateway is not set (either in the network-
resolv.conf is empty, except for a comment that cloud-init visited the file.... :(
I've tried using Config Version 2, but that fails horribly (not even the IP is set). Even when enabling NetworkManager things go hay-wire real soon (things like dhclient interfering, having a DHCP address as well as a static address...)
I only want 3 things:
- simple network configuration with IP, GW, DNS and DNS Lookup Domain
- hostname
- hosts file
I don't care if i have to use the Legacy ENI, Config Version 1 or Config Version 2, i just want it to work...
Can anyone provide a working example?
description: | updated |
You might need to remove the prefix in 'address: <ip>/16'. It doesn't work on CentOS7.
I believe this issue was addressed by d00da2d5b0d45db 5670622a66d833d 2abb907388 in the latest cloud-init.
The route part doesn't work even in the latest cloudinit.