CloudStack datasource fails to find DHCP lease if IPv6 present

Bug #1576273 reported by Wido den Hollander
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
Medium
Unassigned
cloud-init (Ubuntu)
Fix Released
Medium
Unassigned
Xenial
Fix Released
Medium
Unassigned

Bug Description

The CloudStack data source looks in /var/lib/dhcp for DHCP lease files and compares the timestamps.

If you have a dhclient.leases and dhclient6.leases file present it will look in the dhclient6.leases file for a DHCP server to connect to.

The fix for this is rather simple, change a if-statement so that it checks if the leases file starts with 'dhclient.'

        if file_name.startswith("dhclient.") and \
           (file_name.endswith(".lease") or file_name.endswith(".leases")):

Related branches

Revision history for this message
Wido den Hollander (wido) wrote :

The whole BZR experience is new to me, but I managed to push a branch: http://bazaar.launchpad.net/~wido/cloud-init/cloudstack-dhcp/revision/1213

Is that sufficient to apply this to cloud-init upstream?

Revision history for this message
Dan Watkins (oddbloke) wrote :

Hi Wido,

Thanks for reporting the bug and taking the time to work out the fix! It looks good to me. :)

Before we can apply it to cloud-init trunk, we'll need you to sign the CLA[0].

Thanks,

Dan

[0] http://www.ubuntu.com/legal/contributors/submit

Revision history for this message
Wido den Hollander (wido) wrote :

Thank you Dan! I just signed the CLA form online.

I hope that is sufficient :) Would like to see this fixed upstream so it can also be fixed in Ubuntu 16.04

Revision history for this message
Dan Watkins (oddbloke) wrote :

Thanks Wido, merged and pushed!

Changed in cloud-init:
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cloud-init - 0.7.7~bzr1215-0ubuntu1

---------------
cloud-init (0.7.7~bzr1215-0ubuntu1) yakkety; urgency=medium

  * debian/new-upstream-snapshot: minor change supporting revision
    passed in as an argument.
  * New upstream snapshot.
    - Paths: fix instance path if datasource's id has a '/'. (LP: #1575938)
    - Config Drive: fix check_instance_id signature. (LP: #1575055)
    - cloudstack: Only use DHCPv4 lease files as a datasource (LP: #1576273)

 -- Scott Moser <email address hidden> Fri, 29 Apr 2016 12:37:48 -0400

Changed in cloud-init (Ubuntu):
status: New → Fix Released
Revision history for this message
Scott Moser (smoser) wrote :

Hello,
An SRU upload of cloud-init for 16.04 that contains a fix for this bug has been made under bug 1595302. Please track that bug if you are interested.

Changed in cloud-init (Ubuntu Xenial):
status: New → Fix Committed
importance: Undecided → Medium
Changed in cloud-init (Ubuntu):
importance: Undecided → Medium
Changed in cloud-init:
importance: Undecided → Medium
Revision history for this message
Scott Moser (smoser) wrote :

fix is now released to xenial under bug 1595302. daily cloud-images with this newer version of cloud-init should appear in the next few days. Any image with a serial number *newer* than 20160707 should have cloud-init at 0.7.7~bzr1246-0ubuntu1~16.04.1 .

Changed in cloud-init (Ubuntu Xenial):
status: Fix Committed → Fix Released
Revision history for this message
Scott Moser (smoser) wrote :

This is fixed in cloud-init 0.7.7

Changed in cloud-init:
status: Fix Committed → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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