/srv/irclogs.ubuntu.com/2013/09/18/#cloud-init.txt

=== ctracey|away is now known as ctracey
=== helgi- is now known as helgi
smoserharlowja, thoughts:14:57
smoserhttps://code.launchpad.net/~vlastimil-holer/cloud-init/net-reconfigure/+merge/18635214:57
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:09
smoserpedroalvarez_, i'm not sure. i've never used systemd. 17:12
smoserwhat is 'crash' ?17:12
smoserlogs ?17:12
pedroalvarez_smoser: http://paste.ubuntu.com/6124789/17:17
harlowjaya, maybe logs, i haven't used systemd either myself (yet)17:17
smoserwell it sure thinks it failed to create the user17:19
pedroalvarez_If I do: `systemctl start cloud-init` it works.17:19
pedroalvarez_And if I reboot the image, sometimes it starts. 17:19
pedroalvarez_I want cloud-init to execute commands at boot time, through the "customization-script" of OpenStack17:20
harlowjaya, thats fine17:21
harlowjapretty normal use-case17:21
pedroalvarez_And, correct me if I am wrong, the services running are essential17:21
harlowjalikely :)17:21
harlowja*likely u are right17:21
harlowjapedroalvarez_ is this systemd via fedora17:22
harlowjaor systemd via some other distro?17:22
pedroalvarez_customized core linux17:23
pedroalvarez_baserock17:23
pedroalvarez_I have located the systemd files on /etc/systemd/system17:26
pedroalvarez_And I made a symlink in /lib/systemd/system/multi.user.bla.wants17:26
pedroalvarez_Also in /lib/systemd/system/17:27
harlowjahmmm, eck, defintly outside of my area of expertise :(17:27
pedroalvarez_smoser: Does the install script try to copy them?17:28
pedroalvarez_harlowja: no worries :) tvm17:28
harlowjapedroalvarez_ can u just use the init.d versions instead of the sytemd ones?17:29
harlowjathat might work better, idk17:29
pedroalvarez_harlowja: I'll try init.d version then :) thanks17:29
harlowjathose work on RHEL6 and such17:29
harlowjaand i know the upstart ones work17:30
harlowjasince smoser  uses them17:30
harlowjathe systemd ones i think work with fedora, but i don't know if smoser or me have to much experience with them17:30
smoseryeah, i have no idea on systemd.17:32
smoserharlowja, did you see above?17:32
harlowjasmoser that review looks ok, an interesting approach with the 'pretend'17:32
smoserwhy is it 'pretend' ?17:32
smoserwhat was that for. i didn't understand.17:32
harlowjadef _write_network(self, settings, pretend=False)17:32
smoserright. what is that doing ?17:33
smoserother than for testing. why would i want that.17:33
harlowjaah, k, got your question17:33
harlowjadigging deeper, incase i missed why its being used, ha17:33
harlowjai think its for 17:34
harlowjadev_names = self._write_network(settings, pretend=True)17:34
harlowjaself._bring_down_interfaces(dev_names)17:34
harlowjawhich is like a way to figure out the device names to bring down17:34
harlowjaalthough i would think its a little convoluted :-P17:35
harlowjajust have a 'list_interfaces' function and bring those down, ha17:35
harlowjaso from my understanding, whats happening17:35
harlowjais that its pretending to write out the network interfaces, the result of this gives u the device names, and then the code is ifdown those17:36
harlowjaand then it writes out in non-pretend mode17:36
smoserso the reason for this being is https://bugs.launchpad.net/cloud-init/+bug/122592217:36
smoserin 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
harlowjagotcha17:37
smoser(ifup'ed successfully or non-successfully)17:37
smoserwe need to bring it down and then back up.17:37
smoserand ideally we dont run 'ifdown -a'17:37
harlowjaso 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
smoserand 'ifup -a'17:37
smoser(although that i a hacky solution)17:37
smoserah. 17:38
harlowjapretend make sense now?17:38
harlowjathats my interpreation17:38
smoserbut where does he call with 'pretend'?17:38
smoserah. i see.17:39
harlowja19+ if bring_up:17:39
harlowja20+ dev_names = self._write_network(settings, pretend=True)17:39
harlowja21+ self._bring_down_interfaces(dev_names)17:39
harlowjait is a little convoluted i guess, haha17:39
harlowjaa function like 'list_interfaces(settings)'17:40
harlowjathat returns the device names17:40
harlowjaprobably would be clearer to understand17:40
smoseryeah. 17:40
smoserparse the existing17:40
smoserparse the new17:40
harlowjaya, since all that write_network does is parse settings and write out a file17:41
harlowja*or files17:41
harlowjawant me to comment on that review17:42
harlowjaor u got it under control boss17:42
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 ubuntu17:47
harlowja:)17:51
harlowjahaha17:51
pedroalvarez_hahahahaha17:51
harlowjaya, so u need to edit the cloud.cfg for that17:51
pedroalvarez_harlowja: good news then?17:52
harlowjayup17:52
harlowja# System and/or distro specific settings17:52
harlowja# (not accessible to handlers/transforms)17:52
harlowjasystem_info:17:52
harlowja # This will affect which distro class gets used17:52
harlowja distro: rhel17:52
harlowjasomething like that17:52
harlowjayou are probably using the default ('ubuntu')17:52
harlowjaand the other part is what modules u have left active by default in cloud.cfg17:52
harlowjasome of them are more ubuntu speicfic17:53
harlowja*aka ones starting with 'apt' and such17:53
harlowjaall smoser  fault, ha17:53
pedroalvarez_The other problem of initialization is just because cloud-init needs ssh services running, and cloudinit doesn't wait I think.17:54
smoserharlowja, i'd appreciately comement.17:54
smoserpedroalvarez_, the user is configurable.17:54
pedroalvarez_smoser: that's cool17:55
pedroalvarez_I think I found all my problems on this file! :)18:11
harlowja:)18:12
pedroalvarez_I'm going home happy today18:12
pedroalvarez_I owe you a couple of beers18:12
harlowjaha18:13
harlowjanp18:13
harlowjacloud.cfg is the magic file18:13
smosercloud.cfg is the magic.18:24
harlowjaall the magic18:24
=== shardy is now known as shardy_afk

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!