=== shardy is now known as shardy_lunch === shardy_lunch is now known as shardy [16:26] smoser: if you're around, what is the thought behind having DefaultDependencies=no in cloud-init.service? It turns out this this is causing cloud-init to start before dbus on fedora, so things like setting the hostname fall over. The fix may be an explicit dependency on dbus.(service|socket)... [16:37] larsks, 1 minute. [16:39] (the root cause is that DefaultDependencies=no means there is no implicit dependency on basic.target) [16:52] more than on minute. [16:52] ok [16:53] larsks, yeah, so we had issues with that too, starting before dbus. [16:53] If we removed DefaultDependencies=no it would in theory Just Work. [16:54] ...unless there was a specific problem that was meant to solve. [16:54] well, no. then cloud-init is not running early enough in order to block netoworking. [16:54] Ah, I see. [16:54] theres a series of bugs, probably referenced in commits. [16:54] let me look [16:54] So you think an explicit dependency on dbus.service is probably the way to go. [16:54] and this is, agreed, really a pita [16:54] i dont think that will actually work. let me see. [16:58] larsks, there isa lot of information in git log systemd/ [16:58] https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/1629797 is what had us adding the dbus.socket [16:58] Indeed, I've had to look at several of those. [16:58] it was resolved. [16:59] Looking... [16:59] we could ask pitti for advice... [17:00] he's the one who holds most knowledge in his head about systemd and aided in this slew of bugs. [17:00] pitti works for rh now [17:01] So https://git.launchpad.net/cloud-init/commit/?id=6e45ffb21e9622780585b4fe15890f009ca8fa71 added Bfore=dbus.socket, but that appears to have been removed by your commit e568aec31051674901047ee577f6e229785cbfc3 [17:02] I will bug pitti for thoughts. [17:03] ask him to join here, nice to have conversation logged if we do have irc conversation. [17:05] larsks, so you're suggesting [17:05] http://paste.ubuntu.com/23864232/ [17:05] righ t? [17:06] Or After=dbus.socket, maybe, but yeah. I'm going to test that later today and see if it corrects out issue. [17:06] s/out/our/ [17:08] Well, that doesn't work: [17:08] Breaking ordering cycle by deleting job cloud-init.service/start [17:15] yeah, i saw that quickly in a lxd container (well, for some reason journalctl doesnt show the error... but cloud-init.service did not run) [17:15] larsks: we switched dbus for sysinit.target [17:15] rharper: yes, I spotted that. [17:17] typically, you need to run after dbus.socket (which is required for networkd/timesyncd) but before sysinit.target [17:18] larsks: which fedora release? [17:18] larsks, what is the ordering cycle that you see ? [17:18] can you paste journalctl ? [17:19] The problem we have is that we have Before=sysinit.target, which means we run before dbus.service. But adding After=dbus.service results in an ordering loop: http://chunk.io/f/b9c11198c8c14c6b84dccec25cd1f3cc [17:20] This is F25 right now, using cloud-init 0.7.9. [17:21] Note that those log entries are what we get after adding After=dbus.socket to cloud-init.service. [17:21] I can produce logs for other scenarios if you would like. [17:26] larsks: yes, that sounds familiar, it should be ok to run before dbus.service; just not before dbus.socket; we had to split the gap so-to-speak; we also have a resolv service that does libnss before dbus.service is up (which then resolv takes over) [17:26] rharper: the point is that with After=dbus.socket results in the ordering loop. [17:27] right, and larsks needs to run after dbus.socket so that he can update the hostname on the system [17:27] yeah, we'll need to detangle that [17:27] because obviously calling a kernel api should go through a user space daemon witih a dbus socket [17:27] and something else may need a 'DefaultDependencies=no' [17:27] well i think its just that you cant be before sysinit.target and after dbus.socket === rangerpbzzzz is now known as rangerpb [17:27] Right. [17:28] But I'm still not clear on why we need defaultdependencies=no. We have explicit ordering on most of the network stuff now, I think. [17:28] if you drop defaultdependencies=no, then you get defaultdependencies [17:28] which include sysinit.target [17:28] i think [17:28] Yeeeeeees. [17:28] it's because default adds more deps that do not allow the correct ordering for placing befor networking [17:29] rharper: do you know exactly what the problem is? Because there are now explicit dependencies on serveral network units. [17:29] Are those insufficient? [17:29] it's the additional deps that push things with default deps further up in the cycle [17:29] What do we hit if we come after sysinit.target? Is there a test case that demonstrates an actual problem? [17:29] we cannot block networking [17:30] we so need better integration test. :-( [17:30] its coming. [17:30] I understand the problem is "we cannot block networking", but why, and why are the explicit Before= deps not sufficient to permit us to block networking? [17:30] cloud-init local needs to be able to write out a network config [17:30] they are [17:30] rharper: sure, but this isn't about cloud-init-local [17:30] but defaultdeps bring in *MORE* deps [17:30] This is cloud-init.service. [17:30] There is no problem with cloud-init-local having defaultpdeps=no [17:30] i thinkt hat the issue is probably thatAfter sysinit.target (which is added unless you are Defaultdependencies=no) will mean that we run After dbus.socket [17:30] which runs right before networking is considered online [17:31] which, on ubuntu, with resolved , means dns queries block until timeout [17:31] because resolved wasnt up but the socket was [17:31] Since it doesn't sound like there is any evidence that defaultdeps=no is necessary, I'd like to produce some so that we can actually test things. smoser, what is a scenario that requires that we "block networking"...something passing in a static network config? [17:32] I would like to find something that will fail somewhere (fedora/ubuntu/whatever) if I remove the defaultdependencies line. [17:32] it is necessary [17:32] other wise you run After=sysinit.target [17:32] which is After=dbus.socket [17:33] This discussion has developed an ordering problem :). I am just asking for some sort of scenario that would demostrate the problem you and rharper have described. [17:33] openstack boot [17:34] But a normal openstack boot doesn't require cloud-init to do *anything* w/r/t networking. [17:34] when cloud-init.service runs it will attempt to poke at network based metadata services [17:34] right [17:34] it can and usually does [17:34] So it needs to run *after* networking in that case. [17:34] and it will attempt dns lookup on the gce .internal name [17:34] but before it's online [17:34] and that blocks [17:34] a cloud may provide network configuration via metadata services [17:34] rharper: I think I just missed a distinction there. [17:35] so all other units that need network, run after 'network-online.target' is reached [17:35] Ah, I see. So in that case, you expect cloud-init to...bring up interfaces manually first, in order to contact the metadata service? [17:35] I mean, how do the interfaces come up in that situation to permit access to the network metadata service, if we're running before the system brings up networking? [17:35] hey, i'm really sorry, but ih ave got to work on some other things . [17:35] smoser: np [17:36] Yeah sure. I just want to understand the problem we're trying to solve with these dependency settings. [17:36] I also have other things I need to work on :) [17:36] larsks: we use the hosts network service (so ifupdown or netword) a fallback network config (typically dhcp on first nic) is done [17:36] But aren't those going to depend on, e.g., networkmanager already running? [17:36] right [17:36] but not reaching the network-online.target [17:36] it's really threading a needle [17:37] cloud-init is expected to do things iwth the network which could affect network-based services (like sshd host key gen) [17:37] Hmmmm. But we already have Before=network-online.target, right? [17:37] we don't want sshd to be running (it runs after network-online.target is reached) [17:37] So even if we exclude default dependencies, we're still okay. [17:37] We also have Before=sshd.service [17:38] what we really need is a list of default deps that get added unless you add DD=no [17:38] I am pretty sure that means sysinit.target and basic.target. But I suppose you mean you'd like the transitive deps in that case? [17:38] then we can walk each of those to see if they order themselves after network-online.target or something else that forces cloud-init.service to run later than we need [17:39] right, DefaultDeps is larger than just those two right ? [17:39] No. From systemd.service: Unless DefaultDependencies= in the "[Unit]" is set to false, service units will implicitly have dependencies of type Requires= and After= on sysinit.target, a dependency of type After= on basic.target as well as dependencies of type Conflicts= and Before= on shutdown.target. [17:39] What exactly is implied by those depends on a lot on how other services are ordered w/r/t to basic.target and sysinit.target [17:40] right, so the default deps of sysinit.target and basic.target make cloud-init.service run too late [17:40] Maaaybe. I've noticed that between ubuntu and rhel/fedora there are substantial differences in service ordering. And even between fedora and rhel, I think. [17:40] very likely [17:40] the list of units and ordering is massively fragile [17:41] So we still don't have a clear test case that demonstrates an actual problem. It sounds like you are suggesting that an openstack config that passes in an explicit network configuration should help demonstrate one? [17:41] I can try putting that together later this week. [17:41] you don't even need a network config [17:42] just use the default metadata service (ie, not a configdrive) [17:42] in our case, if you run systemctl list-dependencies sysinit.target [17:43] honestly; we can try moving it back in as well and see what breaks [17:43] in general, it's such a mess that it gets paged out of my memory once things work as expected [17:44] Yeah, the thing is, running cloud-init *after* network-online.target will work just fine in that case (since it doesn't need to touch the network config). [17:44] Since networking is up, it will have no problem contacting the metadata service. [17:44] right [17:44] I am trying to produce a failure :) [17:49] Speaking of paging things out, I should get lunch before my next meeting and the meeting after that. I've also pointed pitti at the problem, although he's got devconf going on right now and may not be able to look at things until next week or so. [17:49] cool === shardy is now known as shardy_afk === shardy_afk is now known as shardy [21:49] smoser: https://code.launchpad.net/~raharper/cloud-init/+git/cloud-init/+merge/315633 === rangerpb is now known as rangerpbzzzz