namespace collision on url kernel arg results in downloading iso multiple times

Bug #1937319 reported by Dan Bungert
16
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
Medium
Alberto Contreras
casper (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

As listed at https://discourse.ubuntu.com/t/netbooting-the-live-server-installer/14510/135

When attempting a netboot, we can end up in a situation where cloud-init downloads a full iso, only to decide that the first few bytes aren't the expected header and to ignore it.

I suggest an enhancement where a small amount of data is downloaded at first, we check this data for the required #cloud-config, and then use that info to decide to continue to download the file or not.

Related branches

Revision history for this message
James Falcon (falcojr) wrote :

How is cloud-init getting pointed to an iso? Is there a way this can happen that isn't the result of a simple misconfiguration?

Changed in cloud-init:
status: New → Incomplete
Revision history for this message
Dan Bungert (dbungert) wrote :

It's valid for netboot to do something like this:
  APPEND root=/dev/ram0 ramdisk_size=1500000 ip=dhcp url=http://releases.ubuntu.com/focal/ubuntu-20.04.1-live-server-amd64.iso
See the top post of that discourse for more details:
https://discourse.ubuntu.com/t/netbooting-the-live-server-installer/14510

So the url argument is rational for netboot, but there is a namespace collision here.

It's my hope that we fix this in multiple ways
1) add a new argument for netboot, one that isn't the generic 'url=', much like how cloud-init can accept 'cloud-config-url' instead of 'url'
2) Address the issue here, so that existing users don't download isos more times than intended until they learn about the fix in #1

What do you think?

Changed in cloud-init:
status: Incomplete → New
Revision history for this message
Dan Bungert (dbungert) wrote :
Revision history for this message
James Falcon (falcojr) wrote :

Thanks for the context. Yes, I think your proposal makes sense.

Changed in cloud-init:
status: New → Triaged
importance: Undecided → Medium
Dan Bungert (dbungert)
summary: - cloud-init can attempt to download an iso from kernel arg url
+ namespace collision on url kernel arg results in downloading iso
+ multiple times
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

I had a look at the code that does this download and the structure of the APIs used looks to make this kind of sniffing a bit awkward :( Nothing impossible of course but it's not going to be completely trivial either.

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in casper (Ubuntu):
status: New → Confirmed
Dan Bungert (dbungert)
Changed in casper (Ubuntu):
status: Confirmed → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package casper - 1.472

---------------
casper (1.472) kinetic; urgency=medium

  * Support iso-url= on the kernel command line as a synonym for url=, to
    help avoid the conflict with cloud-init over that argument. (LP: #1937319)

 -- Michael Hudson-Doyle <email address hidden> Fri, 03 Jun 2022 11:25:33 +1200

Changed in casper (Ubuntu):
status: In Progress → Fix Released
Revision history for this message
Alberto Contreras (aciba) wrote :

PR to avoid downloading urls that does not contain cloud-configs: https://github.com/canonical/cloud-init/pull/1606

Chad Smith (chad.smith)
Changed in cloud-init:
status: Triaged → In Progress
assignee: nobody → Alberto Contreras (aciba)
Revision history for this message
Chad Smith (chad.smith) wrote :
Changed in cloud-init:
status: In Progress → Fix Committed
Revision history for this message
Brett Holman (holmanb) wrote : Fixed in cloud-init version 22.3.

This bug is believed to be fixed in cloud-init in version 22.3. 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
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.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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