** Description changed:

+ === 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:
+  |#cloud-config
+  |cloud_config_modules:
+  | - ssh-import-id
+  | - locale
+  |runcmd:
+  | - [sh, -c, 'echo "==== $(date -R) : runcmd ====" > /run/runcmd.txt' ]
+ 
+ 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-modules.
+ 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(yaml.load(open("/etc/cloud/cloud.cfg"))["cloud_config_modules"])')
+  $ for mod in $mods; do f=/var/lib/cloud/instance/sem/config-$mod; [ -f $f -o 
-f ${f//-/_} ] && echo $mod; done
+ 
+ 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: Fix Released => In Progress

** Description changed:

  === 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.
+ [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
+  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
+  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:
-  |#cloud-config
-  |cloud_config_modules:
-  | - ssh-import-id
-  | - locale
-  |runcmd:
-  | - [sh, -c, 'echo "==== $(date -R) : runcmd ====" > /run/runcmd.txt' ]
+ $ cat > user-data <<<"EOF"
+ #cloud-config-archive
+ - |
+   #cloud-config
+   cloud_config_modules:
+    - ssh-import-id
+    - locale
+    - runcmd
+ - |
+   #cloud-config
+   cloud_config_modules:
+    - 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-modules.
  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
+  $ 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(yaml.load(open("/etc/cloud/cloud.cfg"))["cloud_config_modules"])')
-  $ for mod in $mods; do f=/var/lib/cloud/instance/sem/config-$mod; [ -f $f -o 
-f ${f//-/_} ] && echo $mod; done
+  $ mods=$(python -c 'import yaml; print " 
".join(yaml.load(open("/etc/cloud/cloud.cfg"))["cloud_config_modules"])')
+  $ for mod in $mods; do f=/var/lib/cloud/instance/sem/config-$mod; [ -f $f -o 
-f ${f//-/_} ] && echo $mod; done
  
  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.
+ [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.
+  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.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1180867

Title:
  cloud-config merging not forward or backward compatible

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1180867/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to