cloud-init 0.7.9 fails for CentOS 7.4 in Cloudstack

Bug #1717147 reported by Ian Forde
16
This bug affects 4 people
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
Medium
Scott Moser
cloud-init (CentOS)
Fix Released
Medium

Bug Description

Environment:
CentOS 7.4, cloud-init-0.7.9-9.el7.centos.2.x86_64

Problem (quick):
CentOS 7.4 builds on Cloudstack 4.8 don't run cloud-init because the newer version of cloud-init doesn't appear to like the way the dhclient lease file is named.

Problem (long):

I've just built a CentOS 7.4 instance in one of my CloudStack 4.8 clusters. Unfortunately, cloud-init fails with the following in snippet in /var/log/cloud-init.log:

2017-09-13 18:53:00,118 - __init__.py[DEBUG]: Seeing if we can get any data from <class 'cloudinit.sources.DataSourceCloudStack.DataSourceCloudStack'>
2017-09-13 18:53:00,118 - DataSourceCloudStack.py[DEBUG]: Using /var/lib/dhclient lease directory
2017-09-13 18:53:00,118 - DataSourceCloudStack.py[DEBUG]: No lease file found, using default gateway

Where it then tries to use the default route to download userdata. The problem is that we're not using the Cloudstack VR as a default router, so I expected it to parse /var/lib/dhclient/dhclient--eth0.lease for the "dhcp-server-identifier" line.

Theory as to cause:
I believe that this change (https://github.com/cloud-init/cloud-init/commit/aee0edd93cb4d78b5e0d1aec71e977aabf31cdd0#diff-5bc9de2bb7889d66205845400c7cf99b) breaks cloud-init beyond the 7.3-distributed cloud-0.7.5 when 7.4 includes 0.7.9-9.

Fix:

Changing it from "dhclient." to "dhclient-" in /usr/lib/python2.7/site-packages/cloudinit/sources/DataSourceCloudStack.py on the running box with an installed RPM did the trick theoretically (after removing the pyc and pyo files, of course).

This *can* be patched around by RedHat/CentOS (and hopefully will), but I figure it might be better to take it straight upstream.

Related branches

Revision history for this message
Ryan McCabe (rmccabe) wrote :

Please also create a red hat bugzilla for this, and I will make sure it gets pulled in when a fix is accepted here.

Revision history for this message
Ian Forde (ianforde) wrote :

Because $JOB has a RH support agreement, I created a support ticket (01932169). Do you also want a public bugzilla entry created? (Would require digging up my old RH Bugzilla creds...)

Revision history for this message
In , James (james-redhat-bugs) wrote :

This is a replicate of upstream bug
https://bugs.launchpad.net/cloud-init/+bug/1717147

As requested by customer in support case, I replicate this upstream bug to RHBZ.

Description of problem:

CentOS 7.4 builds on Cloudstack 4.8 don't run cloud-init because the newer version of cloud-init doesn't appear to like the way the dhclient lease file is named.

I've just built a CentOS 7.4 instance in one of my CloudStack 4.8 clusters. Unfortunately, cloud-init fails with the following in snippet in /var/log/cloud-init.log:

2017-09-13 18:53:00,118 - __init__.py[DEBUG]: Seeing if we can get any data from <class 'cloudinit.sources.DataSourceCloudStack.DataSourceCloudStack'>
2017-09-13 18:53:00,118 - DataSourceCloudStack.py[DEBUG]: Using /var/lib/dhclient lease directory
2017-09-13 18:53:00,118 - DataSourceCloudStack.py[DEBUG]: No lease file found, using default gateway

Where it then tries to use the default route to download userdata. The problem is that we're not using the Cloudstack VR as a default router, so I expected it to parse /var/lib/dhclient/dhclient--eth0.lease for the "dhcp-server-identifier" line.

Theory as to cause:
I believe that this change (https://github.com/cloud-init/cloud-init/commit/aee0edd93cb4d78b5e0d1aec71e977aabf31cdd0#diff-5bc9de2bb7889d66205845400c7cf99b) breaks cloud-init beyond the 7.3-distributed cloud-0.7.5 when 7.4 includes 0.7.9-9.

Changing it from "dhclient." to "dhclient-" in /usr/lib/python2.7/site-packages/cloudinit/sources/DataSourceCloudStack.py on the running box with an installed RPM did the trick theoretically (after removing the pyc and pyo files, of course).

This *can* be patched around by RedHat/CentOS (and hopefully will), but I figure it might be better to take it straight upstream.

Version-Release number of selected component (if applicable):
CentOS 7.4, cloud-init-0.7.9-9.el7.centos.2.x86_64

How reproducible:

Steps to Reproduce:
1.
2.
3.

Actual results:

Expected results:

Additional info:

Revision history for this message
Scott Moser (smoser) wrote :

Thanks for the good bug and root cause diagnosis.

I can see that the name of the files in /var/lib/dhclient on centos is in fact
 /var/lib/dhclient/dhclient--eth0.lease

the change clearly regressed reading those files.

More for information (not justification) /var/lib/dhclient/dhclient.eth0.leases.

Anyone here have an idea on why the '--' in that filename ? More just curious.

Changed in cloud-init:
status: New → Confirmed
importance: Undecided → Medium
Chad Smith (chad.smith)
Changed in cloud-init:
status: Confirmed → Fix Committed
assignee: nobody → Chad Smith (chad.smith)
assignee: Chad Smith (chad.smith) → Scott Moser (smoser)
milestone: none → 0.7.10
Revision history for this message
In , James (james-redhat-bugs) wrote :

Looks like a fix has been committed upstream, as noted in Launchpad at https://bugs.launchpad.net/cloud-init/+bug/1717147

Their fix is visible here: https://github.com/cloud-init/cloud-init/commit/da1db792b2721d94ef85df8c136e78012c49c6e5

Revision history for this message
Scott Moser (smoser) wrote : Fixed in Cloud-init 17.1

This bug is believed to be fixed in cloud-init in 17.1. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in cloud-init:
status: Fix Committed → Fix Released
Changed in cloud-init (CentOS):
importance: Unknown → Medium
Revision history for this message
In , Ademar (ademar-redhat-bugs) wrote :

The rebase is being tracked via Bug 1525267.

Changed in cloud-init (CentOS):
status: Unknown → In Progress
Changed in cloud-init (CentOS):
status: In Progress → Fix Committed
Revision history for this message
In , errata-xmlrpc (errata-xmlrpc-redhat-bugs) wrote :

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/RHBA-2019:2123

Changed in cloud-init (CentOS):
status: Fix Committed → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
Revision history for this message
In , bugzilla (bugzilla-redhat-bugs) wrote :

The needinfo request[s] on this closed bug have been removed as they have been unresolved for 500 days

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.