Ubuntu Pastebin

Paste from aim at Tue, 5 Apr 2016 17:04:25 +0000

Download as text
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
Apr 05 14:20:37 <frobware>	has there been a recent change for when the containers /e/n/i gets generated. In juju I see us writing the config but it looks like it is being overwritten - this is something that used to work ~5-10 days ago.
Apr 05 14:21:01 <frobware>	See https://bugs.launchpad.net/juju-core/+bug/1564395/comments/3
Apr 05 14:21:02 <frobware>	and https://bugs.launchpad.net/juju-core/+bug/1564395/comments/4
Apr 05 14:21:58 <frobware>	jam: ^^
Apr 05 15:00:11 *	dduffey_afk is now known as dduffey
Apr 05 15:10:57 *	evilnick-afk is now known as evilnick
Apr 05 16:26:40 *	jgrimm is now known as jgrimm-afk
Apr 05 16:26:56 *	andreas is now known as andreas-lunch
Apr 05 16:26:59 *	Ursinha is now known as Ursinha-lunch
Apr 05 16:39:35 <stgraber>	frobware: when and how are you overwriting /etc/network/interfaces exactly?
Apr 05 16:40:46 <frobware>	stgraber: the how, by directly writing to /var/lib/cont...
Apr 05 16:41:11 <frobware>	stgraber: I was going to stop there because I have feeling you're going to say don't do that...
Apr 05 16:41:22 <stgraber>	yep, don't do that :)
Apr 05 16:41:26 <frobware>	lol
Apr 05 16:41:29 <frobware>	sigh
Apr 05 16:41:50 <stgraber>	anyway, the problem you're running into is that LXD re-generates /etc/network/interfaces on first startup of containers
Apr 05 16:42:05 <frobware>	stgraber: actually (I need to double check) this should be via cloud init
Apr 05 16:42:09 <stgraber>	this is needed infrastructure for lxdbr0 as we need to be able to flip between "inet manual" and "inet dhcp"
Apr 05 16:42:23 <frobware>	stgraber: can we do this via cloud-init?
Apr 05 16:42:39 <stgraber>	you can overwrite arbitrary files with cloud-init, yes
Apr 05 16:43:11 <frobware>	stgraber: so is the really the only way we should be generating this content?
Apr 05 16:44:58 <stgraber>	well, you could use the lxd file push mechanism but you'd still have the same problem. LXD applies its templates at container startup time as it needs to know all of the container's environment. So you'd basically need to call Action("start", ...) then wait for it to succeed and then immediately copy /etc/network/interfaces which would probably be racy
Apr 05 16:45:46 <stgraber>	frobware: what changes are you doing to /etc/network/interfaces anyway?
Apr 05 16:47:04 <frobware>	stgraber: we create a profile for the container: http://pastebin.ubuntu.com/15631952/
Apr 05 16:47:20 <frobware>	stgraber: we then generate static IP addresses ala:
Apr 05 16:47:54 <frobware>	stgraber: http://pastebin.ubuntu.com/15631973/
Apr 05 16:50:17 <frobware>	stgraber: if we could specify that in the profile... that would be sweet!
Apr 05 16:53:29 <stgraber>	well, in theory the new cloud-init network feature would let you do that just fine, the problem is that it's a 16.04 only feature so won't do you much good for 14.04 containers
Apr 05 16:56:41 <frobware>	stgraber: so the LCD here is to just use cloud-init? Would that bring up all the interfaces as well?
Apr 05 16:59:20 <stgraber>	with the new network feature you can't use on anything but 16.04, it should. On anything else, it won't because cloud-init runs after network has been brought up...
Apr 05 17:00:08 <frobware>	stgraber: so in theory we should `ifdown -a --exclude lo; copy-in-our-file; ifup -a'?
Apr 05 17:00:54 <stgraber>	yup, and have that done through cloud-init
Apr 05 17:01:14 <frobware>	stgraber: ok thx
Apr 05 17:01:48 <stgraber>	hmm, hold on a sec, I'm just noticing something now. LXD doesn't actually template /etc/network/interfaces
Apr 05 17:01:56 <stgraber>	we template /etc/network/interfaces.d/eth0.cfg only
Apr 05 17:04:54 <frobware>	stgraber: the template you're talking about is purely LXD related, correct?
Apr 05 17:05:51 <stgraber>	frobware: yeah, LXD templates /etc/network/interfaces.d/eth0.cfg at first container startup then never touches it again. cloud-init is the one which overwrites /etc/network/interfaces at first boot.
Apr 05 17:07:22 <stgraber>	let me try something real quick here
Apr 05 17:13:42 <stgraber>	frobware: ok, so looks like you can push your interface file to /etc/network/interfaces.d/00-juju.cfg which will then be run at boot time just fine. You will then just need to have cloud-init do a "rm -f /etc/network/interfaces.d/eth0.cfg" so that the next boots are clean.
Apr 05 17:34:15 <frobware>	stgraber: this can be done programmatically?
Apr 05 17:34:22 <frobware>	stgraber: ie.. the push
Apr 05 17:34:33 <stgraber>	yep, lxd has an API for that
Apr 05 17:34:56 <stgraber>	PushFile() in the Go client
Apr 05 17:36:11 <frobware>	stgraber: ok need to see if it is exposed in any way on the juju side already
Apr 05 17:43:23 *	andreas-lunch is now known as andreas
Apr 05 17:49:55 *	Ursinha-lunch is now known as Ursinha
Apr 05 17:58:56 <redir>	got an lxd update today. It noted that it would remove lcxbr0 and that I needed to run dpkg-reconfigure to configure a bridge for lxd to use going forward.
Apr 05 17:59:07 <redir>	Does this require a reboot? 
Apr 05 18:02:01 <redir>	nope
Apr 05 18:02:08 <redir>	just removing lxc1
Apr 05 18:03:25 <redir>	however it looks like juju2 still wants lxcbr0
Download as text