ec2-set-defaults should be 'run_once_per_ami'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu on EC2 |
Invalid
|
Low
|
Unassigned | ||
VMBuilder |
Invalid
|
Undecided
|
Unassigned | ||
ec2-init (Ubuntu) |
Invalid
|
Medium
|
Unassigned | ||
vm-builder (Ubuntu) |
Invalid
|
Undecided
|
Unassigned |
Bug Description
ec2-set-defaults currently runs "once ever". from /etc/init.
| if run_once_ever ec2-defaults
| then
| log_daemon_msg "Setting EC2 defaults"
| if ec2-set-defaults 2> /dev/null
...
ec2-set-defaults currently does:
- apply_locale per location (where location is based on availability_zone)
- generate_
I think a better fit for those operations is 'run_once_per_ami'
If a user re-bundles an image, moves that instance to another region, you would want those to run again. Currently, the semaphore written to /var/lib/
I verified this issue in ec2-init 0.4.99-0ubuntu3
description: | updated |
tags: | added: ec2-images uec-images |
Changed in ubuntu-on-ec2: | |
status: | New → Invalid |
Changed in vm-builder (Ubuntu): | |
status: | New → Invalid |
Changed in vmbuilder: | |
status: | New → Invalid |
Changed in ec2-init (Ubuntu): | |
status: | New → In Progress |
assignee: | nobody → Soren Hansen (soren) |
Changed in ec2-init (Ubuntu): | |
importance: | Low → Medium |
Changed in ec2-init (Ubuntu): | |
milestone: | none → ubuntu-9.10-beta |
The decision here is a tough call as we're trying to meet a couple major use cases:
1. User runs a base AMI; installs some software; rebundles to create another AMI which is them migrated to multiple regions. User wants (or wouldn't mind) instances of the new AMI to automatically detect the region and update local and sources.
2. User runs a base AMI; sets the locale and/or tweaks the apt/sources.list to her preferences; rebundles to create another AMI. User does *not* want the local and apt sources changes overwritten in instances of the new AMI.
If it's an either/or, then I would think that overwriting 2's customizations is a more serious violation than not updating the locale or apt/sources when the 1's fire off a rebundled, migrated AMI. I would wager that very few people are in bucket 1 anyway as most EC2 users probably stick with a single region.
Most 1's and 2's could be made happy by only overwriting the locale and/or apt sources if they haven't been changed since the first boot. Perhaps a copy (or hash) could be saved in /var/lib/ec2/ and compared on the boot of a new AMI.
The logic would then be something like:
once_per_ami: ec2/last- saved-apt- sources. list does not exist ec2/last- saved-apt- sources. list is the same as /etc/apt/ sources. list sources. list ec2/last- saved-apt- sources. list
determine recommended apt/sources for current EC2 region
if /var/lib/
or /var/lib/
then
install recommended to /etc/apt/
save recommended to /var/lib/
[same for locale]
There could be some additional logic to not overwrite /etc/apt/ sources. list if it is the same as the recommended, but I figured that would just clutter the notes.