View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0015475 | CentOS-7 | Cloud-Images | public | 2018-11-19 19:09 | 2021-02-13 12:04 |
Reporter | pakdel | Assigned To | |||
Priority | normal | Severity | major | Reproducibility | always |
Status | new | Resolution | open | ||
Product Version | 7.5.1804 | ||||
Summary | 0015475: AWS AMI should not include /etc/sysconfig/network-scripts/ifcfg-eth0 | ||||
Description | Amazon EC2 instance types like m4.* do not have an eth0 interface. An appropriate interface, ens3 in my case, is created on the first boot. I believe it is because of the recent addition of ENA . This is the AMI of the one I am using in eu-west-1 :ami-3548444c CentOS 7 AMIs come with /etc/sysconfig/network-scripts/ifcfg-eth0, which causes confusion for the network service, because it cannot restart dhclient properly. Consequently, systemctl status network fails. | ||||
Steps To Reproduce | On a newly created m4.large instance: > [root@ip-10-173-64-139 ~]# systemctl status network > * network.service - LSB: Bring up/down networking > Loaded: loaded (/etc/rc.d/init.d/network; bad; vendor preset: disabled) > Active: failed (Result: exit-code) since Mon 2018-11-19 18:29:30 UTC; 28min ago > Docs: man:systemd-sysv-generator(8) > CGroup: /system.slice/network.service > `-789 /sbin/dhclient -1 -q -lf /var/lib/dhclient/dhclient--ens3.lease -pf /var/run/dhclient-ens3.pid ens3 > > Nov 19 18:29:30 ip-10-173-64-139 network[595]: [ OK ] > Nov 19 18:29:30 ip-10-173-64-139 network[595]: Bringing up interface eth0: ERROR : [/etc/sysconfig/network-scripts/ifup-eth] Device eth0 does not seem to be present, delaying initialization. > Nov 19 18:29:30 ip-10-173-64-139 network[595]: [FAILED] > Nov 19 18:29:30 ip-10-173-64-139 systemd[1]: network.service: control process exited, code=exited status=1 > Nov 19 18:29:30 ip-10-173-64-139 systemd[1]: Failed to start LSB: Bring up/down networking. > Nov 19 18:29:30 ip-10-173-64-139 systemd[1]: Unit network.service entered failed state. > Nov 19 18:29:30 ip-10-173-64-139 systemd[1]: network.service failed. > Nov 19 18:54:21 ip-10-173-64-139.ca-central-1.compute.internal dhclient[789]: DHCPREQUEST on ens3 to 10.173.64.1 port 67 (xid=0x63d43e87) > Nov 19 18:54:21 ip-10-173-64-139.ca-central-1.compute.internal dhclient[789]: DHCPACK from 10.173.64.1 (xid=0x63d43e87) > Nov 19 18:54:23 ip-10-173-64-139.ca-central-1.compute.internal dhclient[789]: bound to 10.173.64.139 -- renewal in 1753 seconds. > [root@ip-10-173-64-139 ~]# systemctl restart network > Job for network.service failed because the control process exited with error code. See "systemctl status network.service" and "journalctl -xe" for details. > [root@ip-10-173-64-139 ~]# systemctl status network > * network.service - LSB: Bring up/down networking > Loaded: loaded (/etc/rc.d/init.d/network; bad; vendor preset: disabled) > Active: failed (Result: exit-code) since Mon 2018-11-19 18:58:02 UTC; 40s ago > Docs: man:systemd-sysv-generator(8) > Process: 10912 ExecStart=/etc/rc.d/init.d/network start (code=exited, status=1/FAILURE) > CGroup: /system.slice/network.service > └─789 /sbin/dhclient -1 -q -lf /var/lib/dhclient/dhclient--ens3.lease -pf /var/run/dhclient-ens3.pid ens3 > > Nov 19 18:58:02 ip-10-173-64-139.ca-central-1.compute.internal network[10912]: RTNETLINK answers: File exists > Nov 19 18:58:02 ip-10-173-64-139.ca-central-1.compute.internal network[10912]: RTNETLINK answers: File exists > Nov 19 18:58:02 ip-10-173-64-139.ca-central-1.compute.internal network[10912]: RTNETLINK answers: File exists > Nov 19 18:58:02 ip-10-173-64-139.ca-central-1.compute.internal network[10912]: RTNETLINK answers: File exists > Nov 19 18:58:02 ip-10-173-64-139.ca-central-1.compute.internal network[10912]: RTNETLINK answers: File exists > Nov 19 18:58:02 ip-10-173-64-139.ca-central-1.compute.internal network[10912]: RTNETLINK answers: File exists > Nov 19 18:58:02 ip-10-173-64-139.ca-central-1.compute.internal systemd[1]: network.service: control process exited, code=exited status=1 > Nov 19 18:58:02 ip-10-173-64-139.ca-central-1.compute.internal systemd[1]: Failed to start LSB: Bring up/down networking. > Nov 19 18:58:02 ip-10-173-64-139.ca-central-1.compute.internal systemd[1]: Unit network.service entered failed state. > Nov 19 18:58:02 ip-10-173-64-139.ca-central-1.compute.internal systemd[1]: network.service failed. | ||||
Additional Information | Here is a snippet from /var/log/cloud-init.log: > 2018-10-04 17:45:55,155 - util.py[DEBUG]: Running command ['ip', '-6', 'addr', 'show', 'permanent', 'scope', 'global'] with allowed return codes [0] (shell=False, capture=True) > 2018-10-04 17:45:55,171 - util.py[DEBUG]: Running command ['ip', '-4', 'addr', 'show'] with allowed return codes [0] (shell=False, capture=True) > 2018-10-04 17:45:55,174 - __init__.py[DEBUG]: no work necessary for renaming of [['xx:xx:xx:xx:xx:xx', 'ens3']] > 2018-10-04 17:45:55,174 - stages.py[INFO]: Applying network configuration from fallback bringup=False: {'version': 1, 'config': [{'subnets': [{'type': 'dhcp'}], 'type': 'physical', 'name': 'ens3', 'mac_address': 'xx:xx:xx:xx:xx:xx'}]} > 2018-10-04 17:45:55,177 - util.py[DEBUG]: Writing to /etc/sysconfig/network-scripts/ifcfg-ens3 - wb: [420] 159 bytes This is what I have to do every time I create a new instance, if there is no eth0: > rm -i /etc/sysconfig/network-scripts/ifcfg-eth0 > for PATH_DHCLIENT_PID in /var/run/dhclient* > do > export PATH_DHCLIENT_PID > dhclient -r > # Making sure it really truly stopped > kill $(<PATH_DHCLIENT_PID) > rm -f $PATH_DHCLIENT_PID > done > systemctl restart network | ||||
Tags | aws, centos 7, dhcp, ec2 | ||||
abrt_hash | |||||
URL | |||||