Bug 1474226 - [WALA][cloud] cloud-init dhclient-hook script has some unexpected side-effects on Azure [NEEDINFO]
[WALA][cloud] cloud-init dhclient-hook script has some unexpected side-effect...
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: cloud-init (Show other bugs)
x86_64 Linux
high Severity medium
: rc
: ---
Assigned To: Ryan McCabe
Vratislav Hutsky
: Regression, Triaged, ZStream
: 1516941 (view as bug list)
Depends On:
Blocks: 1451548 1579237 1516941 1530127
  Show dependency treegraph
Reported: 2017-07-24 03:47 EDT by Yuhui Jiang
Modified: 2018-07-06 05:35 EDT (History)
25 users (show)

See Also:
Fixed In Version: cloud-init-0.7.9-12.el7
Doc Type: Bug Fix
Doc Text:
A regression was introduced in cloud-init-0.9.9-7 that caused dhclient and NetworkManager hook scripts to run on Microsoft Azure even when the cloud-init service was not enabled at boot. In this release, the bug is fixed. As a result, dhclient and NetworkManager hook scripts do not run on Azure when cloud-init is not enabled at boot.
Story Points: ---
Clone Of:
: 1516941 1530127 1579237 (view as bug list)
Last Closed: 2018-04-10 10:05:07 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
eterrell: needinfo? (rmccabe)

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHEA-2018:0806 normal SHIPPED_LIVE cloud-init bug fix and enhancement update 2018-04-10 08:40:54 EDT

  None (edit)
Description Yuhui Jiang 2017-07-24 03:47:23 EDT
Description of problem:
I am responsible for testing Windows Azure Linux Agent(WALA) with RHEL on Azure.And recently we found that cloud-init has some side effects on WALA.

cloud-init dhclient-hook script(/etc/NetworkManager/dispatcher.d/cloud-init-azure-hook) will always run on booting though cloud-init-local,cloud-init,cloud-config,cloud-final,these 4 services are disabled on booting.And inside the dhclient-hook script,it invoke "exec cloud-init dhclient-hook up "$1"".And this will affect WALA.

In my opinion,the dhclient-hook script should invoke cloud-init when we need rather than always invoke cloud-init.That is to say,when cloud-init-local,cloud-init,cloud-config,cloud-final are disabled,dhclient-hook script shouldn't invoke cloud-init.And when 4 services are enabled,dhclient-hook script should do.

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

RHEL Version:

How reproducible:

Steps to Reproduce:
1. Install cloud-init package in VM, disable related services:
# systemctl disable cloud-{init-local,init,config,final}
2. Deprovision the VM and use this os disk to create a new VM
3. Check VM status

Actual results:
cloud-init dhclient-hook script invoked cloud-init running,and caused WALA Provision failed.

2017/07/21 02:46:16.396313 INFO Running default provisioning handler
2017/07/21 02:46:16.424520 ERROR cloud-init is running [PID 673, /usr/bin/python^@/usr/bin/cloud-init^@dhclient-hook^@up^@eth0^@]
2017/07/21 02:46:24.561451 ERROR Event: name=WALinuxAgent, op=Provision, message=[000004] cloud-init appears to be running, this is not expected, cannot continue
2017/07/21 02:46:24.569447 ERROR Provisioning failed: [000004] cloud-init appears to be running, this is not expected, cannot continue

Expected results:
cloud-init dhclient-hook script shoud exit while cloud-init services are disabled.

Additional info:
Refer to bug: https://bugzilla.redhat.com/show_bug.cgi
Comment 14 tom.asquith 2017-09-06 06:18:32 EDT
Hi - Has there been any progress on this? We're building on Azure and this is an issue!
Comment 15 Yuhui Jiang 2017-09-06 07:12:18 EDT
(In reply to tom.asquith from comment #14)
> Hi - Has there been any progress on this? We're building on Azure and this
> is an issue!

Hi tom,we are working on this issue,plz wait new build to post/release.
Or if you need help right now,you can get help from our supporting team.
Comment 17 Paul Meyer 2017-09-06 12:37:43 EDT
The scenario seems a bit odd to me, installing cloud-init and then disabling it. What is the intended purpose of installing cloud-init in this scenario?

When cloud-init and WALA are both installed, the expectation is that cloud-init does provisioning and WALA takes a back seat for that. WALA will take care of extension handling later on.

Although there is also:

Comment 18 yuxisun@redhat.com 2017-09-06 22:58:55 EDT
Hi Paul Meyer,

We open this issue because this is a "possible" but not a "must" scenario. The WALA and cloud-init packages are not conflict, which means customers can choose to use WALA or cloud-init to provision the VM(in other words, customer probably don't know or forget there's cloud-init in there image if the cloud-init service is disabled). Although we expect that customer install cloud-init only if they enable it, we cannot guarantee that. 

Currently, because of this issue, WALA skips provisioning even if "Provisioning.Enabled=y" "Provisioning.UseCloudInit=n" in waagent.conf and cloud-init service is disabled. 

Comment 26 Ryan McCabe 2017-11-26 14:40:02 EST
*** Bug 1516941 has been marked as a duplicate of this bug. ***
Comment 36 yuxisun@redhat.com 2018-01-03 03:25:28 EST
Verify with cloud-init-0.7.9-19 in RHEL-7.5-20171215.0 in Azure. Result: Pass.
Comment 39 errata-xmlrpc 2018-04-10 10:05:07 EDT
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.


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