ec2-init selects us-east-1 mirror when running in us-west-1 region
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ec2-init (Ubuntu) |
Fix Released
|
Medium
|
Scott Moser | ||
Karmic |
Fix Released
|
High
|
Scott Moser | ||
Lucid |
Fix Released
|
Medium
|
Scott Moser |
Bug Description
Binary package hint: ec2-init
ec2-init has the following code:
| def get_mirror_
| if availability_
| return 'http://
| elif availability_
| return 'http://
|
| return 'http://
The above incorrectly sets the archive to us.ec2.
Currently that host is not accessible from inside the us-west-1 region.
ProblemType: Bug
Architecture: amd64
Date: Tue Dec 8 20:24:36 2009
DistroRelease: Ubuntu 10.04
Ec2AMI: ami-133c6d56
Ec2AMIManifest: ubuntu-
Ec2Kernel: aki-0d3c6d48
Package: ec2-init 0.4.999-0ubuntu7
PackageArchitec
ProcEnviron:
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcVersionSign
SourcePackage: ec2-init
Uname: Linux 2.6.32-300-ec2 x86_64
================
SRU Report (ec2-init):
Background: The UEC Images have code that runs at "first boot" and customizes an images to the region upon which it is being run. One of the customizations done is to attempt to select an archive mirror in the same region that this instance is running in. For example, Canonical runs 3 archive mirrors in ec2, {us-west-
An instance is assigned a 'availability zone' within an instance. These availability zones are currently consistently named as '<region>[a-z]' (Example: us-east-1a, eu-west-1d). The previous logic was to select 'us.ec2.
Impact: Instances started in the us-west-1 region incorrectly select the 'us.ec2.
Changes:
Please see the attachment [http://
Test Case:
- Start an instance in us-west-1 region
- ssh to instance, run 'apt-get update'.
- grep "us-west-1" /etc/apt/
# you *should* see entries for the us-west-1. Currently, there the list shows 'us.ec2.
- run 'apt-get update' to verify that the mirrors are functional.
- To verify there is no regression, we should a.) test multiple instance b.) verify that instances in us-east-1 and eu-west-1 do not regress the 'apt-get update' function.
Regression potential:
- The biggest cause for regression is that we are changing logic inside the image. Previously it was all self contained. The change makes the mirror selection depend on dns resolution of a hostname that is dependent upon meta-data available to the image.
This leaves two possible failure paths:
a.) False positive: If the availability zone is named such that a dns entry *does* exist in the .ec2.archive.
b.) False negative: Failure in the logic (dns resolution timeout, or temporary un-availability) could result in failure to select the correct mirror. This is mitigated by a selection of 'archive.
Notes:
- The changes suggested here also reduce the likelyhood that images run in UEC to incorrectly select a ec2 mirror. There is still a possibility of that, but it has been reduced
Previously the code in UEC would fail if the user defined availability zone started with 'us' or 'eu'. Now, the possibility for error is reduced to availability zone names where the folowing is a valid hostname:
"%s.
=====
Changed in ec2-init (Ubuntu): | |
assignee: | nobody → Scott Moser (smoser) |
tags: | added: iso-testing |
description: | updated |
Changed in ec2-init (Ubuntu): | |
status: | New → In Progress |
Changed in ec2-init (Ubuntu Lucid): | |
milestone: | none → lucid-alpha-2 |
Changed in ec2-init (Ubuntu Karmic): | |
milestone: | none → karmic-updates |
status: | New → Triaged |
importance: | Undecided → Medium |
description: | updated |
tags: |
added: verification-done removed: verification-needed |
Changed in ec2-init (Ubuntu Karmic): | |
assignee: | Scott Moser (smoser) → mashaobing1 (mashaobing1) |
Changed in ec2-init (Ubuntu Karmic): | |
assignee: | mashaobing1 (mashaobing1) → Scott Moser (smoser) |
The workaround is to run the following on the booted image: us.ec2. archive. ubuntu. com/ubuntu/ ,http:/ /archive. ubuntu. com/ubuntu/ ,g' /etc/apt/ sources. list
sudo sed -i 's,http://