[SRU] ConfigDrive fails to provision when network interface key is "interfaces"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init (Ubuntu) |
Invalid
|
Medium
|
Unassigned | ||
Precise |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[SRU Justification]
[IMPACT] The ConfigDrive datasource fails to provision on ConfigDrive capable clouds that use "interfaces" rather than "network-
This is only seen on 12.04. As a result, some Cloud providers are unable to use Cloud-init to provision Ubuntu Instances
[FIX] The fix is simple: allow for both "network-
[REGRESSION POTENTIAL] This is a mild-risk change. CloudDrive has been implemented by many Cloud Providers and this change implements a new set of behavior. The most likely scenerio is that Cloud-init on Ubuntu 12.04 will start work where it has been broken previously.
[TEST CASES 1] :
1. Build new images from proposed
2. Boot image on Cloud w/ "instance" as the metadata value
3. Boot image on Cloud w/ "network-
4. Check to make sure that cloud-init provisioned with out errors
[TEST CASE 2]:
1. Build existing Ubuntu image on ConfigDrive provisioned cloud
2. Check for any errors in the logs
3. Upgrade cloud-init
4. Reboot and check for errors in logs
5. Create a new instance from existing instance
6. Check for errors in the log.
The following meta_data.json is from an instance showing the problem:
{
"domain": "foobar.com",
"files": [
[]
],
"hostname": "utl-precise-
"meta": {
"dsmode": "net"
},
"name": "utl-precise-
"network_
},
"public_keys": {
"177313": "<REDACTED FOR READABILITY>"
},
"uuid": "9ba148b1-
}
Related branches
Changed in cloud-init (Ubuntu Precise): | |
status: | New → In Progress |
Changed in cloud-init (Ubuntu Precise): | |
assignee: | nobody → Ben Howard (utlemming) |
description: | updated |
description: | updated |
summary: |
- ConfigDrive fails to provision when network interface key is + [SRU] ConfigDrive fails to provision when network interface key is "interfaces" |
tags: | added: patch |
tags: |
added: verification-done removed: verification-needed |
Simple fix:
--- cloud-init- 0.6.3.orig/ cloudinit/ DataSourceConfi gDrive. py 0.6.3/cloudinit /DataSourceConf igDrive. py
LOG. debug(" Updating network interfaces from config drive (%s)",
dsmode)
+++ cloud-init-
@@ -198,8 +198,14 @@
- util.write_ file("/ etc/network/ interfaces" , interfaces' ]) interfaces" , "interfaces"): file("/ etc/network/ interfaces" , iface_def)
(out, err) = util.subp(['ifup', '--all'])
- md['network-
+ # Look at network-interfaces first and then use interfaces
+ # to support OpenNimbula clouds.
+ for iname in ("network-
+ iface_def = md.get(iname, None)
+ if iface_def is not None:
+ util.write_
+ break
+
try:
if len(out) or len(err):