Bug 1147613 - Need network-online systemd dependency
Summary: Need network-online systemd dependency
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: cloud-init
Version: 21
Hardware: x86_64
OS: Unspecified
urgent
high
Target Milestone: ---
Assignee: Garrett Holmstrom
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1110731 (view as bug list)
Depends On:
Blocks: 1096081
TreeView+ depends on / blocked
 
Reported: 2014-09-29 15:07 UTC by swat30
Modified: 2015-03-12 17:49 UTC (History)
9 users (show)

Fixed In Version: cloud-init-0.7.6-3.fc22
Clone Of:
Environment:
Last Closed: 2015-03-12 17:49:17 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description swat30 2014-09-29 15:07:20 UTC
Description of problem:
When booting cloud-init on F20, it can launch its init phase prior to networking being setup. This means that, while networking does work, cloud-init may never see it.


Version-Release number of selected component (if applicable):
v.0.7.2-10


How reproducible:
100%


Steps to Reproduce:
1. Boot fully updated F20 cloud image (cloud-init v.0.7.2-10, also tested 0.7.2-7)
2.
3.

Actual results:
Boot -
[    3.025403] cloud-init[281]: Cloud-init v. 0.7.2 running 'init-local' at Mon, 29 Sep 2014 14:27:19 +0000. Up 2.97 seconds.
[    3.197393] random: nonblocking pool is initialized
[[32m  OK  [0m] Started Initial cloud-init job (pre-networking).
         Starting Initial cloud-init job (metadata service crawler)...
[    3.513472] cloud-init[474]: Cloud-init v. 0.7.2 running 'init' at Mon, 29 Sep 2014 14:27:20 +0000. Up 3.48 seconds.
[    3.541996] cloud-init[474]: ci-info: ++++++++++++++++Net device info+++++++++++++++++
[    3.543570] cloud-init[474]: ci-info: +--------+-------+---------+------+------------+
[    3.545075] cloud-init[474]: ci-info: | Device |   Up  | Address | Mask | Hw-Address |
[    3.546751] cloud-init[474]: ci-info: +--------+-------+---------+------+------------+
[    3.548336] cloud-init[474]: ci-info: |  lo:   | False |    .    |  .   |     .      |
[    3.549875] cloud-init[474]: ci-info: | eth0:  | False |    .    |  .   |     .      |
[    3.552294] cloud-init[474]: ci-info: +--------+-------+---------+------+------------+
[    3.555285] cloud-init[474]: ci-info: !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!Route info failed!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
         Starting Hostname Service...
[[32m  OK  [0m] Started Hostname Service.
[    3.950373] cloud-init[474]: 2014-09-29 14:27:20,871 - __init__.py[WARNING]: User fedora already exists, skipping.
[[32m  OK  [0m] Started Initial cloud-init job (metadata service crawler).
[[32m  OK  [0m] Reached target Cloud-config availability.
         Starting Apply the settings specified in cloud-config...
[    4.289174] cloud-init[523]: Cloud-init v. 0.7.2 running 'modules:config' at Mon, 29 Sep 2014 14:27:21 +0000. Up 4.23 seconds.
         Stopping OpenSSH server daemon...
[[32m  OK  [0m] Stopped OpenSSH server daemon.
         Starting OpenSSH server daemon...
[[32m  OK  [0m] Started OpenSSH server daemon.
[[32m  OK  [0m] Started Apply the settings specified in cloud-config.
         Starting Execute cloud user/final scripts...
[    4.675284] cloud-init[547]: Cloud-init v. 0.7.2 running 'modules:final' at Mon, 29 Sep 2014 14:27:21 +0000. Up 4.61 seconds.
[    4.755107] cloud-init[547]: Cloud-init v. 0.7.2 finished at Mon, 29 Sep 2014 14:27:21 +0000. Datasource DataSourceConfigDriveNet [net,ver=2][source=/dev/sr0].  Up 4.75 seconds
[    4.760216] cloud-init[547]: ci-info: +++++++++++++Authorized keys from /home/fedora/.ssh/authorized_keys for user fedora+++++++++++++
[    4.762137] cloud-init[547]: ci-info: +---------+-------------------------------------------------+---------+------------------------+

...

[    4.804302] cloud-init[547]: -----END SSH HOST KEY KEYS-----
[[32m  OK  [0m] Started Execute cloud user/final scripts.
[[32m  OK  [0m] Started LSB: Bring up/down networking.


Expected results:
[    3.106118] cloud-init[279]: Cloud-init v. 0.7.2 running 'init-local' at Mon, 29 Sep 2014 14:53:16 +0000. Up 3.03 seconds.
[    3.280412] random: nonblocking pool is initialized
[[32m  OK  [0m] Started Initial cloud-init job (pre-networking).
[[32m  OK  [0m] Started LSB: Bring up/down networking.
[[32m  OK  [0m] Reached target Network is Online.
         Starting Initial cloud-init job (metadata service crawler)...
[    5.500450] cloud-init[545]: Cloud-init v. 0.7.2 running 'init' at Mon, 29 Sep 2014 14:53:19 +0000. Up 5.47 seconds.
[    5.531516] cloud-init[545]: ci-info: ++++++++++++++++Net device info+++++++++++++++++
[    5.533186] cloud-init[545]: ci-info: +--------+-------+---------+------+------------+
[    5.534739] cloud-init[545]: ci-info: | Device |   Up  | Address | Mask | Hw-Address |
[    5.536595] cloud-init[545]: ci-info: +--------+-------+---------+------+------------+
[    5.538272] cloud-init[545]: ci-info: |  lo:   | False |    .    |  .   |     .      |
[    5.541057] cloud-init[545]: ci-info: | eth0:  | False |    .    |  .   |     .      |
[    5.543043] cloud-init[545]: ci-info: +--------+-------+---------+------+------------+
[    5.545505] cloud-init[545]: ci-info: ++++++++++++++++++++++++++++Route info++++++++++++++++++++++++++++
[    5.548041] cloud-init[545]: ci-info: +-------+-------------+----------+-----------+-----------+-------+
[    5.549813] cloud-init[545]: ci-info: | Route | Destination | Gateway  |  Genmask  | Interface | Flags |
[    5.552584] cloud-init[545]: ci-info: +-------+-------------+----------+-----------+-----------+-------+
[    5.555042] cloud-init[545]: ci-info: |   0   |   0.0.0.0   | 10.0.0.1 |  0.0.0.0  |    eth0   |   UG  |
[    5.556766] cloud-init[545]: ci-info: |   1   |   10.0.0.0  | 0.0.0.0  | 255.0.0.0 |    eth0   |   U   |
[    5.559421] cloud-init[545]: ci-info: +-------+-------------+----------+-----------+-----------+-------+
         Starting Hostname Service...
[[32m  OK  [0m] Started Hostname Service.
[    5.973787] cloud-init[545]: 2014-09-29 14:53:19,875 - __init__.py[WARNING]: User fedora already exists, skipping.
[[32m  OK  [0m] Started Initial cloud-init job (metadata service crawler).
[[32m  OK  [0m] Reached target Cloud-config availability.
         Starting Apply the settings specified in cloud-config...
[    6.327570] cloud-init[594]: Cloud-init v. 0.7.2 running 'modules:config' at Mon, 29 Sep 2014 14:53:20 +0000. Up 6.26 seconds.
         Stopping OpenSSH server daemon...
[[32m  OK  [0m] Stopped OpenSSH server daemon.
         Starting OpenSSH server daemon...
[[32m  OK  [0m] Started OpenSSH server daemon.
[[32m  OK  [0m] Started Apply the settings specified in cloud-config.
         Starting Execute cloud user/final scripts...
[    6.727616] cloud-init[618]: Cloud-init v. 0.7.2 running 'modules:final' at Mon, 29 Sep 2014 14:53:20 +0000. Up 6.66 seconds.
[    6.808397] cloud-init[618]: Cloud-init v. 0.7.2 finished at Mon, 29 Sep 2014 14:53:20 +0000. Datasource DataSourceConfigDriveNet [net,ver=2][source=/dev/sr0].  Up 6.80 seconds
[    6.813667] cloud-init[618]: ci-info: +++++++++++++Authorized keys from /home/fedora/.ssh/authorized_keys for user fedora+++++++++++++
[    6.815554] cloud-init[618]: ci-info: +---------+-------------------------------------------------+---------+------------------------+


Additional info:
Fixed the problem by modifying cloud-init's systemd unit file.

/usr/lib/systemd/system/cloud-init.service.old
[Unit]
Description=Initial cloud-init job (metadata service crawler)
After=local-fs.target network.target cloud-init-local.service
Requires=network.target
Wants=local-fs.target cloud-init-local.service
....

/usr/lib/systemd/system/cloud-init.service.new
[Unit]
Description=Initial cloud-init job (metadata service crawler)
After=local-fs.target network.target network-online.target cloud-init-local.service
Requires=network-online.target
Wants=local-fs.target cloud-init-local.service
...

Comment 1 Matthew Miller 2014-09-29 15:19:19 UTC
Sadly, we don't have a good way of doing updates for the F20 cloud image. However, we _will_ have that for F21, and we can make sure this fix gets in there.

Comment 2 swat30 2014-09-29 15:21:32 UTC
(In reply to Matthew Miller from comment #1)
> Sadly, we don't have a good way of doing updates for the F20 cloud image.
> However, we _will_ have that for F21, and we can make sure this fix gets in
> there.

Comment 3 swat30 2014-09-29 15:22:04 UTC
Ooops, pressed submit accidentally.

This affects the cloud-init package in general. This actually started happening to our image when we ran updates, which included the latest version of cloud-init.

Comment 4 Garrett Holmstrom 2015-02-23 22:29:09 UTC
This should be fixed in cloud-init-0.7.6-3.fc22.  cloud-init-0.7.6-4.20140218bzr1060.fc22 will be pushed shortly with some major changes, so it may be worth testing against that instead.

Comment 5 Garrett Holmstrom 2015-02-23 22:30:43 UTC
*** Bug 1110731 has been marked as a duplicate of this bug. ***

Comment 6 Garrett Holmstrom 2015-02-23 22:40:08 UTC
Update:  cloud-init-0.7.6-4.20140218bzr1060.fc22 isn't going to make it into F22 due to bug 1194577.  If you're testing rawhide it will appear there, but otherwise feel free to go ahead and test cloud-init-0.7.6-3.fc22.  Sorry about the confusion.


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