Support static network configuration even on already configured devices
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu |
Fix Released
|
Undecided
|
Unassigned | ||
linux-gcp (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Some datasources (e.g. OpenNebula) support full static network configuration. It's done in local execution phase by pushing new interfaces configuration to *distro.
It would be good to first put interfaces down before writing new configuration.
Changed in cloud-init: | |
status: | New → Confirmed |
importance: | Undecided → High |
Changed in linux-gcp (Ubuntu): | |
status: | New → Confirmed |
assignee: | nobody → Roufique Hossain (roufique) |
Changed in cloud-init: | |
assignee: | nobody → Roufique Hossain (roufique) |
status: | Confirmed → Fix Committed |
Changed in cloud-init: | |
assignee: | Roufique Hossain (roufique) → nobody |
affects: | cloud-init → ubuntu |
Changed in ubuntu: | |
importance: | High → Undecided |
status: | Fix Committed → Confirmed |
Changed in linux-gcp (Ubuntu): | |
assignee: | Roufique Hossain (roufique) → nobody |
Currently networking coming up happens independent of cloud-init. We could potentially make cloud-init local block networking from coming up, but I don't think thats something I'd want to take on for cloud-init 0.7.3 / Ubuntu 13.10.
I'm not really sure how much a hack this is, if at all. ['ifquery' , '--list', '--allow', 'auto'])
The solution I'd propose would be:
* use 'ifquery' to get the list of networking interfaces in the original
from cloudinit import util
(out, _err) = util.subp(
orig_list = out.splitlines()
* use ifquery to get the list of 'auto' interfaces in your new list: ['ifquery' , '--interfaces= /tmp/my. tmp.interfaces' ,
--list' , '--allow', 'auto'])
(out, _err) = util.subp(
new_list = out.splitlines()
* take down interfaces in orig_list and new_list subp([' ifdown' , iface]
for iface in [i for i in orig_list if i in new_list]:
util.
# have to ignore errors above in case the interface wasn't up.
* write/update /etc/network/ interfaces file
* bring all interfaces up: subp([' ifup', '-a'])
util.
I opened bug 1226067 (http:// pad.lv/ 1226067) to address an issue where
ifquery is busted in saucy, but that will get fixed.