cloud-config merging not forward or backward compatible
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Raring |
Fix Released
|
High
|
Unassigned |
Bug Description
=== Begin SRU Information ===
[Impact]
Users of who had used cloud-init's multi-part user-data and cloud-config in previous ubuntu releases will find it does not behave like previous ubuntu releases. Their existing user-data configurations will be broken.
If we do not fix this in 13.04, then users will have to know that they provide one set of user-data to Ubuntu images for 13.04 and another set for all other releases. This forces a special case to the end user that is very much non-desireable.
The merge routines upstream now include tests to ensure that they behave like previous releases do (both ubuntu releases and upstream cloud-init releases).
[Test Case]
Launch an instance with the following user-data:
$ cat > user-data <<<"EOF"
#cloud-
- |
#cloud-config
cloud_
- ssh-import-id
- locale
- runcmd
- |
#cloud-config
cloud_
- ssh-import-id
- locale
- |
#cloud-config
runcmd:
- [sh, -c, 'echo "==== $(date -R) : runcmd ====" > /run/runcmd.txt' ]
EOF
The expected behavior (in 12.04, 12.10, and 13.10) is that the 'runcmd'
module should have been removed from the list of cloud-config-
As a result, the shell command provided should not run.
In a current cloud instance, it will run.
To verify this, ssh into the instance and:
$ cat /run/runcmd.txt
That will verify the 'runcmd' module ran.
To see a list of all config_modules that ran, do this:
$ mods=$(python -c 'import yaml; print " ".join(
$ for mod in $mods; do f=/var/
Its expected that the only config modules to have run are 'ssh-import-id' and 'locale', but on raring you'll see many more.
[Regression Potential]
Users who have started using 13.10 and have been bit by this bug could have special cased this already, and an SRU will cause them to have to remove that special case. That is unfortunate, but generally removal of special case code is a good thing.
[Other Info / Background]
cloud-init has always supported user-data being composed of multiple parts. Each of those parts can be of a different type. For cloud-config types, each subsequent part was merged "over" top of the existing cloud-config. The merge algoritm was very simplistic.
In the 0.7.2 development cycle we added a new way for users to use more functional merge algorithms to get better behavior. This was developed to be backwards compatible with 0.7.1. Essentially, in order to get new behavior, the user had to add additional information to the cloud-config part. The code that shipped in Ubuntu's snapshot of 0.7.2 development cycle is not backwards compatible.
=== End SRU Information ===
cloud-init in the 0.7.2 time frame added the ability for user to specify how a cloud-config part should be merged into the existing cloud-config. Basically this means that instead of overwriting a list, the user can chose to append to it.
This was fixed in upstream revision 813 and is fixed in 0.7.2 release.
The 0.7.2 release is intended to be backwards compatible with 0.7.1.
Changed in cloud-init (Ubuntu): | |
status: | New → Triaged |
Changed in cloud-init (Ubuntu): | |
importance: | Undecided → Medium |
status: | Triaged → Fix Released |
Changed in cloud-init (Ubuntu Raring): | |
status: | New → In Progress |
importance: | Undecided → High |
description: | updated |
Changed in cloud-init (Ubuntu): | |
status: | Fix Released → In Progress |
description: | updated |
It's not clear to me that this bug is an appropriate SRU candidate.
If you believe it is, please expand on the justification. It might help for you to follow the SRU bug template¹ - you're also missing a test-case we can use to verify that this bug is fixed, and what should be checked to be confident that the change doesn't introduce any regressions.
¹: https:/ /wiki.ubuntu. com/StableRelea seUpdates# SRU_Bug_ Template