cloud-init should support apt-proxy and hostname based mirror selection

Bug #897688 reported by Scott Moser
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
Medium
Scott Moser

Bug Description

currently, in EC2, there is logic to select a mirror based on existence of a dns name that matches the region. Ie
 * cloud-init checks ec2 metadata for availability zone (like us-east-1a)
 * take off the 'a',
 * check for dns name of us-east-1.ec2.archive.ubuntu.com
 * use that as mirror if available or fall back to default.

This is good enough for EC2, but not so good for private clouds.
A private cloud may have either a proxy or a full mirror, and want to use that without requiring custom user data on every launch or modifications to the stock images.

To support this, I propose:
 * if user-data specifies 'apt_mirror' or 'apt_proxy' use that.
 * if a dnsname exists for $availability-zone.archive in the default domain, use that.
 * if a dnsname exists in default domain for 'apt-proxy' then configure apt to use that as the proxy
 * if a dnsname exists in default domain for 'ubuntu-mirror' then configure apt to use that mirror

This allows the owner of a private cloud to set up dns entries so that cloud guest images "just work", but also allow for user configuration via cloud-config data like:
 apt_proxy: http://192.168.1.1:3128/

Related bugs:
 * bug 974509: cloud-init selects wrong mirror with dns server redirection

Related branches

Scott Moser (smoser)
Changed in cloud-init:
assignee: nobody → Scott Moser (smoser)
status: New → In Progress
Revision history for this message
Scott Moser (smoser) wrote :

pushed up revision 486 for this.

Changed in cloud-init:
status: In Progress → Fix Committed
Scott Moser (smoser)
Changed in cloud-init:
importance: Undecided → Medium
Scott Moser (smoser)
Changed in cloud-init:
status: Fix Committed → Fix Released
Revision history for this message
Andreas Hasenack (ahasenack) wrote :

This breaks those customers with (already broken) ISPs that have wildcard domains, because "ubuntu-mirror.localdomain" resolves to an actual internet IP, but it's just to show the user a nice html page saying that the domain was not found. Maybe with ads.

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

The bug for Andreas's referenced issue is bug 974509.

description: updated
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.