Bug 1126096 - cloud-init-local.service hangs when bringing up interface
Summary: cloud-init-local.service hangs when bringing up interface
Keywords:
Status: NEW
Alias: None
Product: Fedora EPEL
Classification: Fedora
Component: cloud-init
Version: epel7
Hardware: Unspecified
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Pádraig Brady
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-01 21:02 UTC by Jonathan Süssemilch Poulain
Modified: 2015-09-12 22:28 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:


Attachments (Terms of Use)

Description Jonathan Süssemilch Poulain 2014-08-01 21:02:31 UTC
Description of problem:
When booting a CentOS 7 vm with cloud-init configured network cloud-init-local.service hangs when bringing up the configured interface and never finishes the rest of the user-data script. 

Version-Release number of selected component (if applicable):
0.7.x


How reproducible:
always

Steps to Reproduce:
1. Create a vm, install CentOS 7 add EPEL 7 beta repo. Install cloud-init.
2. Boot vm with static network configuration for eth0 and some random user-data script.
3. Log in to vm and run: systemctl status cloud-init-local.service

Actual results:
[root@localhost xxxxx]# systemctl status cloud-init-local.service
cloud-init-local.service - Initial cloud-init job (pre-networking)
   Loaded: loaded (/usr/lib/systemd/system/cloud-init-local.service; enabled)
   Active: activating (start) since fre 2014-08-01 22:50:34 CEST; 1min 2s ago
 Main PID: 897 (cloud-init)
   CGroup: /system.slice/cloud-init-local.service
           ├─ 897 /usr/bin/python /usr/bin/cloud-init init --local
           ├─1304 /bin/bash /etc/sysconfig/network-scripts/ifup-eth ifcfg-eth0
           └─2624 /usr/bin/python -Es /usr/bin/firewall-cmd --zone= --change-interface=eth0

aug 01 22:50:38 localhost.localdomain cloud-init[897]: [CLOUDINIT] util.py[DEBUG]: Writing to /etc/resolv.conf - wb: [420] 247 bytes
aug 01 22:50:38 localhost.localdomain cloud-init[897]: [CLOUDINIT] util.py[DEBUG]: Restoring selinux mode for /etc/resolv.conf (recursive=False)
aug 01 22:50:38 localhost.localdomain cloud-init[897]: [CLOUDINIT] util.py[DEBUG]: Restoring selinux mode for /etc/resolv.conf (recursive=False)
aug 01 22:50:38 localhost.localdomain cloud-init[897]: [CLOUDINIT] util.py[DEBUG]: Reading from /etc/sysconfig/network (quiet=False)
aug 01 22:50:38 localhost.localdomain cloud-init[897]: [CLOUDINIT] util.py[DEBUG]: Read 66 bytes from /etc/sysconfig/network
aug 01 22:50:38 localhost.localdomain cloud-init[897]: [CLOUDINIT] util.py[DEBUG]: Writing to /etc/sysconfig/network - wb: [420] 66 bytes
aug 01 22:50:38 localhost.localdomain cloud-init[897]: [CLOUDINIT] util.py[DEBUG]: Restoring selinux mode for /etc/sysconfig/network (recursive=False)
aug 01 22:50:38 localhost.localdomain cloud-init[897]: [CLOUDINIT] util.py[DEBUG]: Restoring selinux mode for /etc/sysconfig/network (recursive=False)
aug 01 22:50:38 localhost.localdomain cloud-init[897]: [CLOUDINIT] __init__.py[DEBUG]: Attempting to run bring up interface eth0 using command ['ifup', 'eth0']
aug 01 22:50:38 localhost.localdomain cloud-init[897]: [CLOUDINIT] util.py[DEBUG]: Running command ['ifup', 'eth0'] with allowed return codes [0] (shell=False, capture=True)

Expected results:
Something like this

cloud-init-local.service - Initial cloud-init job (pre-networking)
   Loaded: loaded (/usr/lib/systemd/system/cloud-init-local.service; disabled)
   Active: active (exited) since fre 2014-08-01 23:00:32 CEST; 6s ago
 Main PID: 897 (code=exited, status=0/SUCCESS)
   CGroup: /system.slice/cloud-init-local.service

And vm booted with network interface configured and up, user-data script finished running.

Additional info:
With this SELinux policy loaded the vm boots as expected.

---
module local 1.0;

require {
        type NetworkManager_t;
        type cloud_init_t;
        type firewalld_t;
        class dbus send_msg;
}

#============= NetworkManager_t ==============
allow NetworkManager_t cloud_init_t:dbus send_msg;

#============= firewalld_t ==============
allow firewalld_t cloud_init_t:dbus send_msg;
---

Comment 1 Onmeac 2015-09-12 22:28:51 UTC
I am experiencing this problem too when trying to build a CentOS 7 image. It seems weird that there aren't many other Google search results; almost as if no one else is having experiencing this or every just turns off SELINUX or something?


Note You need to log in before you can comment on or make changes to this bug.