Bug 1489415
| Summary: | cloud-init fails to set static ip settings | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 7 | Reporter: | Ilkka Tengvall <ikke> | ||||
| Component: | cloud-init | Assignee: | Ryan McCabe <rmccabe> | ||||
| Status: | CLOSED ERRATA | QA Contact: | Vladimir <vshypygu> | ||||
| Severity: | medium | Docs Contact: | |||||
| Priority: | high | ||||||
| Version: | 7.4 | CC: | aherr, fdelorey, fdinitto, ikke, jbadiapa, jgreguske, lars, lastmikoi+rh, mavital, mmagr, mrunge, mvermaes, myllynen, redhat | ||||
| Target Milestone: | rc | Keywords: | Triaged | ||||
| Target Release: | --- | ||||||
| Hardware: | x86_64 | ||||||
| OS: | Linux | ||||||
| Whiteboard: | |||||||
| Fixed In Version: | cloud-init-0.7.9-17.el7 | Doc Type: | If docs needed, set a value | ||||
| Doc Text: | Story Points: | --- | |||||
| Clone Of: | Environment: | ||||||
| Last Closed: | 2018-04-10 14:05:07 UTC | Type: | Bug | ||||
| Regression: | --- | Mount Type: | --- | ||||
| Documentation: | --- | CRM: | |||||
| Verified Versions: | Category: | --- | |||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||
| Embargoed: | |||||||
| Attachments: |
|
||||||
|
Description
Ilkka Tengvall
2017-09-07 12:13:08 UTC
Before someone tells to use the RH guided way I can tell it's broken too: https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux_atomic_host/7/html/installation_and_configuration_guide/setting_up_cloud_init It does not set up gateway nor DNS server, so the machine is without the network that way too. Is this a regression from older versions for you, or are you trying now for the first time? Looking more closely at your config, could you try removing the first line ("network:") and see if that solves the issue?
I did do that, and it still fails. It still creates the DHCP config for eth0. This is the error in the logs now:
2017-09-08 03:13:14,313 - util.py[DEBUG]: Attempting to load yaml from string of length 1821 with allowed root types (<type 'dict'>,)
2017-09-08 03:13:14,317 - util.py[DEBUG]: Attempting to load yaml from string of length 0 with allowed root types (<type 'dict'>,)
2017-09-08 03:13:14,317 - util.py[DEBUG]: load_yaml given empty string, returning default
2017-09-08 03:13:14,317 - stages.py[DEBUG]: applying net config names for {'ethernets': {'eth0': {'nameservers': {'addresses': ['8.8.8.8']}, 'gateway4': '192.1
68.122.1', 'addresses': ['192.168.122.2/24'], 'dhcp4': False}}, 'version': 2}
2017-09-08 03:13:14,318 - stages.py[DEBUG]: Using distro class <class 'cloudinit.distros.rhel.Distro'>
2017-09-08 03:13:14,318 - __init__.py[DEBUG]: no interfaces to rename
2017-09-08 03:13:14,318 - stages.py[INFO]: Applying network configuration from ds bringup=False: {'ethernets': {'eth0': {'nameservers': {'addresses': ['8.8.8.8
']}, 'gateway4': '192.168.122.1', 'addresses': ['192.168.122.2/24'], 'dhcp4': False}}, 'version': 2}
2017-09-08 03:13:14,318 - util.py[WARNING]: failed stage init-local
2017-09-08 03:13:14,319 - util.py[DEBUG]: failed stage init-local
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/cloudinit/cmd/main.py", line 513, in status_wrapper
ret = functor(name, args)
File "/usr/lib/python2.7/site-packages/cloudinit/cmd/main.py", line 269, in main_init
init.apply_network_config(bring_up=bool(mode != sources.DSMODE_LOCAL))
File "/usr/lib/python2.7/site-packages/cloudinit/stages.py", line 642, in apply_network_config
return self.distro.apply_network_config(netcfg, bring_up=bring_up)
File "/usr/lib/python2.7/site-packages/cloudinit/distros/__init__.py", line 150, in apply_network_config
dev_names = self._write_network_config(netconfig)
File "/usr/lib/python2.7/site-packages/cloudinit/distros/rhel.py", line 60, in _write_network_config
self._net_renderer.render_network_state("/", ns)
File "/usr/lib/python2.7/site-packages/cloudinit/net/sysconfig.py", line 509, in render_network_state
network_state).items():
File "/usr/lib/python2.7/site-packages/cloudinit/net/sysconfig.py", line 483, in _render_sysconfig
for iface in network_state.iter_interfaces():
AttributeError: 'NoneType' object has no attribute 'iter_interfaces'
2017-09-08 03:13:14,351 - util.py[DEBUG]: Reading from /proc/uptime (quiet=False)
2017-09-08 03:13:14,351 - util.py[DEBUG]: Read 10 bytes from /proc/uptime
2017-09-08 03:13:14,351 - util.py[DEBUG]: cloud-init mode 'init' took 0.538 seconds (0.54)
2017-09-08 03:13:14,352 - handlers.py[DEBUG]: finish: init-local: SUCCESS: searching for local datasources
btw, this was the content of network-config file, it get's parsed ok it seems:
# cat /tmp/bastion/network-config
version: 2
ethernets:
eth0:
dhcp4: false
addresses:
- 192.168.122.2/24
gateway4: 192.168.122.1
nameservers:
addresses: [8.8.8.8]
(In reply to Ryan McCabe from comment #3) > Is this a regression from older versions for you, or are you trying now for > the first time? I'm trying it for the first time, no regression that I could point out. Could you try using the network_data.json format to pass in network settings. We don't have netplan (v2) support on rhel (or fedora). what exactly to do here? I tried converting the network-data into json, and pasting it into file network_data.json and regenerated the config CD. Content of the file was now:
{
"network": {
"version": 2,
"ethernets": {
"eth0": {
"dhcp4": false,
"addresses": [
"192.168.122.5/24"
],
"gateway4": "192.168.122.1",
"nameservers": {
"addresses": [
"8.8.8.8"
]
}
}
}
}
}
No network config got applied. I also tried renaming the file back to network-config within the CD, doesn't work either. Do you have any link to instructions on how to do that?
How should the network config be put into CD? What filename and which is the correct json format within the file?
Verified using cloud-init version 0.7.9.20 Using metadata format as per https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux_atomic_host/7/html/installation_and_configuration_guide/setting_up_cloud_init Addition to the comment above: RHEL version: 7.4 RHEVM version: 4.2.0.2-0.1.el7 When will this be included into qcow image for KVM on the download page? That image is broken until it's included, currently it has this version according to details page: cloud-init-0.7.9-9.el7_4.1.x86_64.rpm https://access.redhat.com/downloads/content/69/ver=/rhel---7/7.4/x86_64/product-software According to comment #14 moving to verified Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHEA-2018:0806 |