[14:57] <smoser> harlowja, thoughts:
[14:57] <smoser> https://code.launchpad.net/~vlastimil-holer/cloud-init/net-reconfigure/+merge/186352
[17:09] <pedroalvarez_> Hi, I have configured cloud-init in a linux image, but when I boot the image, the systemd services crash. When I start them manually it works. What could it be?
[17:12] <smoser> pedroalvarez_, i'm not sure. i've never used systemd. 
[17:12] <smoser> what is 'crash' ?
[17:12] <smoser> logs ?
[17:17] <pedroalvarez_> smoser: http://paste.ubuntu.com/6124789/
[17:17] <harlowja> ya, maybe logs, i haven't used systemd either myself (yet)
[17:19] <smoser> well it sure thinks it failed to create the user
[17:19] <pedroalvarez_> If I do: `systemctl start cloud-init` it works.
[17:19] <pedroalvarez_> And if I reboot the image, sometimes it starts. 
[17:20] <pedroalvarez_> I want cloud-init to execute commands at boot time, through the "customization-script" of OpenStack
[17:21] <harlowja> ya, thats fine
[17:21] <harlowja> pretty normal use-case
[17:21] <pedroalvarez_> And, correct me if I am wrong, the services running are essential
[17:21] <harlowja> likely :)
[17:21] <harlowja> *likely u are right
[17:22] <harlowja> pedroalvarez_ is this systemd via fedora
[17:22] <harlowja> or systemd via some other distro?
[17:23] <pedroalvarez_> customized core linux
[17:23] <pedroalvarez_> baserock
[17:26] <pedroalvarez_> I have located the systemd files on /etc/systemd/system
[17:26] <pedroalvarez_> And I made a symlink in /lib/systemd/system/multi.user.bla.wants
[17:27] <pedroalvarez_> Also in /lib/systemd/system/
[17:27] <harlowja> hmmm, eck, defintly outside of my area of expertise :(
[17:28] <pedroalvarez_> smoser: Does the install script try to copy them?
[17:28] <pedroalvarez_> harlowja: no worries :) tvm
[17:29] <harlowja> pedroalvarez_ can u just use the init.d versions instead of the sytemd ones?
[17:29] <harlowja> that might work better, idk
[17:29] <pedroalvarez_> harlowja: I'll try init.d version then :) thanks
[17:29] <harlowja> those work on RHEL6 and such
[17:30] <harlowja> and i know the upstart ones work
[17:30] <harlowja> since smoser  uses them
[17:30] <harlowja> the systemd ones i think work with fedora, but i don't know if smoser or me have to much experience with them
[17:32] <smoser> yeah, i have no idea on systemd.
[17:32] <smoser> harlowja, did you see above?
[17:32] <harlowja> smoser that review looks ok, an interesting approach with the 'pretend'
[17:32] <smoser> why is it 'pretend' ?
[17:32] <smoser> what was that for. i didn't understand.
[17:32] <harlowja> def _write_network(self, settings, pretend=False)
[17:33] <smoser> right. what is that doing ?
[17:33] <smoser> other than for testing. why would i want that.
[17:33] <harlowja> ah, k, got your question
[17:33] <harlowja> digging deeper, incase i missed why its being used, ha
[17:34] <harlowja> i think its for 
[17:34] <harlowja> dev_names = self._write_network(settings, pretend=True)
[17:34] <harlowja> self._bring_down_interfaces(dev_names)
[17:34] <harlowja> which is like a way to figure out the device names to bring down
[17:35] <harlowja> although i would think its a little convoluted :-P
[17:35] <harlowja> just have a 'list_interfaces' function and bring those down, ha
[17:35] <harlowja> so from my understanding, whats happening
[17:36] <harlowja> is that its pretending to write out the network interfaces, the result of this gives u the device names, and then the code is ifdown those
[17:36] <harlowja> and then it writes out in non-pretend mode
[17:36] <smoser> so the reason for this being is https://bugs.launchpad.net/cloud-init/+bug/1225922
[17:37] <smoser> in short, if the system is booting, eth0 might have already been 'ifup'ed. and then we write a new /etc/network/interfaces file.
[17:37] <harlowja> gotcha
[17:37] <smoser> (ifup'ed successfully or non-successfully)
[17:37] <smoser> we need to bring it down and then back up.
[17:37] <smoser> and ideally we dont run 'ifdown -a'
[17:37] <harlowja> so the pretend thing is really just a way to list the interfaces by using the same code that writes out the interfaces (which returns a list of device names)
[17:37] <smoser> and 'ifup -a'
[17:37] <smoser> (although that i a hacky solution)
[17:38] <smoser> ah. 
[17:38] <harlowja> pretend make sense now?
[17:38] <harlowja> thats my interpreation
[17:38] <smoser> but where does he call with 'pretend'?
[17:39] <smoser> ah. i see.
[17:39] <harlowja> 19	+ if bring_up:
[17:39] <harlowja> 20	+ dev_names = self._write_network(settings, pretend=True)
[17:39] <harlowja> 21	+ self._bring_down_interfaces(dev_names)
[17:39] <harlowja> it is a little convoluted i guess, haha
[17:40] <harlowja> a function like 'list_interfaces(settings)'
[17:40] <harlowja> that returns the device names
[17:40] <harlowja> probably would be clearer to understand
[17:40] <smoser> yeah. 
[17:40] <smoser> parse the existing
[17:40] <smoser> parse the new
[17:41] <harlowja> ya, since all that write_network does is parse settings and write out a file
[17:41] <harlowja> *or files
[17:42] <harlowja> want me to comment on that review
[17:42] <harlowja> or u got it under control boss
[17:47] <pedroalvarez_> Ok, after see that cloud-init service tries to create an "ubuntu" user, and then another service tries to use "apt", I think it thinks I'm running ubuntu
[17:51] <harlowja> :)
[17:51] <harlowja> haha
[17:51] <pedroalvarez_> hahahahaha
[17:51] <harlowja> ya, so u need to edit the cloud.cfg for that
[17:52] <pedroalvarez_> harlowja: good news then?
[17:52] <harlowja> yup
[17:52] <harlowja> # System and/or distro specific settings
[17:52] <harlowja> # (not accessible to handlers/transforms)
[17:52] <harlowja> system_info:
[17:52] <harlowja>  # This will affect which distro class gets used
[17:52] <harlowja>  distro: rhel
[17:52] <harlowja> something like that
[17:52] <harlowja> you are probably using the default ('ubuntu')
[17:52] <harlowja> and the other part is what modules u have left active by default in cloud.cfg
[17:53] <harlowja> some of them are more ubuntu speicfic
[17:53] <harlowja> *aka ones starting with 'apt' and such
[17:53] <harlowja> all smoser  fault, ha
[17:54] <pedroalvarez_> The other problem of initialization is just because cloud-init needs ssh services running, and cloudinit doesn't wait I think.
[17:54] <smoser> harlowja, i'd appreciately comement.
[17:54] <smoser> pedroalvarez_, the user is configurable.
[17:55] <pedroalvarez_> smoser: that's cool
[18:11] <pedroalvarez_> I think I found all my problems on this file! :)
[18:12] <harlowja> :)
[18:12] <pedroalvarez_> I'm going home happy today
[18:12] <pedroalvarez_> I owe you a couple of beers
[18:13] <harlowja> ha
[18:13] <harlowja> np
[18:13] <harlowja> cloud.cfg is the magic file
[18:24] <smoser> cloud.cfg is the magic.
[18:24] <harlowja> all the magic