/srv/irclogs.ubuntu.com/2016/05/23/#cloud-init.txt

CabbageMan69Hello all. I'm having some problems turning on debugging info for cloud-init on an instance in EC2. Is it as simple as having "verbose:\n  debug: true" in the cloud-init config?05:23
CabbageMan69I'm getting the following two lines of output in my cloud-init-output.log file with that config present, and I see the following two lines ... not sure what is happening between those two steps that causes it to take 2 minutes05:25
CabbageMan69Cloud-init v. 0.7.5 running 'modules:config' at Mon, 23 May 2016 05:02:58 +0000. Up 35.99 seconds. Cloud-init v. 0.7.5 running 'modules:final' at Mon, 23 May 2016 05:05:08 +0000. Up 166.10 seconds.05:25
CabbageMan69For context, I'm using Ubuntu 14.04 and I'm running v0.7.5 of cloud-init (is this ancient?)05:26
cpaelzersmoser: Hi, I extended the MP at https://code.launchpad.net/~paelzer/cloud-init/test-apt-source/+merge/29452115:03
cpaelzerit has now the dictionary based handling and all kind of tests around it15:04
cpaelzersmoser: I'll check tomorrow if I need to revise it a lot / a bit  / not - and will start to poke at the curtin portion of it then15:04
cpaelzersmoser: I'll expect to have some questions tomorrow when you come online, but will let you know then15:05
harlowjarharper ya that's def where the complexity comes from ;)17:25
harlowjaand/or figuring out sysconfig for myself, and its weirdness :-P17:25
rharperharlowja: hehe17:27
harlowjarharper although i think https://gist.github.com/harlowja/d63a36de0b405d83be9bd3222a5454a7/ is mostly there, just eyes on that would be cool17:27
harlowjalet me know if it looks dumb :-P17:27
harlowjahttps://gist.github.com/harlowja/d63a36de0b405d83be9bd3222a5454a7/#file-sysconfig-py-L320 is the main stuffs17:27
harlowjaoddly i don't think redhat has a way to configure routes without an interface17:28
harlowjaor at least i'm not sure if there is one17:28
rharperharlowja: I gave it a once over the other day; it looks quite reasonable (cleaner than my initial cut); looking to steal a lot of that;  we may find with the two implementations (and a networkd coming) that we have a base set of hooks that new config backends would implement17:31
harlowjacool17:31
rharperthe networkd does change things up quite a bit as there is no single file to write, rather multiple files (.link for name mapping) (.network for networks which may or maynot be device specific) and (.netdev for virtual devices like bridges and bonds);  so the in-order processing that happens for eni and sysconfig don't have to apply but certainly can.17:33
harlowjaya, sysconfig also doesn't have single files17:34
harlowjaonly eni i think has a single file17:34
rharperok17:35
rharperbbiab17:35
harlowjasmoser rharper can we (or shall i?) merge in https://code.launchpad.net/~harlowja/cloud-init/cloud-init-net-refactor17:46
harlowjathat way this sysconfig stuff (which that uses as a base) ; can start to get reviewed more offically :-P17:46
* harlowja doesn't know to well how to stack things in bzr (against a branch that hasn't merged yet)17:47
smoserharlowja, can you write at very least a combined commit message and description there ?17:51
smoseris it all just "refactor" did you clean up the N different internal states ?17:51
harlowjasure boss17:51
harlowjaummm, let me check17:51
harlowjamostly refactor :-P17:51
=== nacc_ is now known as nacc
harlowjaok, updated https://gist.github.com/harlowja/d63a36de0b405d83be9bd3222a5454a7 rharper if u want to see21:05
rharperlooking21:09
rharperharlowja: nice, lines 34 -> 70ish look like cloudinit.net common stuff that all backends could use21:14
harlowjadef21:15
rharperharlowja: nit: L82 in the header you say on %(now)s ; would  'at' or '@' be more natural ?  L324 render_dns;  you have it as a pass, but I'd think the signature would need to take a list object to append something if/when it ever did support updating dns;21:24
harlowjasure21:24
harlowjarharper  yup yup, dns not done yet ;)21:24
harlowjalet me get that in a more offical place, ha21:26
harlowjaok smoser added nice handy commit message in https://code.launchpad.net/~harlowja/cloud-init/cloud-init-net-refactor/+merge/293957 :-P21:31
rharperand at the risk of exposing my ignorance;  a few of the render methods are @classmethod ;  but it doesn't appear that they're used outside of other methods within the class; what's that doing ?21:32
harlowjaya, more or less just a thing i've gotten used to, no need to pass self around if not using it for those21:32
harlowjaand if don't need any class attributes, then just doing staticmethod21:33
harlowjacan make them all instance methods, but got in the habit of not doing that and using the right decorator21:33
rharperI see, you didn't explicitly need to reference anything in the instance s?21:33
harlowjanah21:33
rharpergotcha21:34
rharperw.r.t quoting, my reading on ConfigParser and INI is that no quoting should be needed; anything after the Variable= is included in the value ...21:34
harlowjahmmmm, i thought most of these sysconfig files were just 'sourced' into scripts21:34
rharperoh21:35
rharperhehe21:35
rharperI forgot21:35
rharperthe bash scripts21:35
rharperyou're right for sysconfig21:35
harlowjaya, i didn't think sysconfig stuff was very smart, lol21:36
harlowjaand it all eventually gets parsed by some shell scripts, lol21:36
harlowjaso without doing quoting things go bad (especially with whitespace)21:37
harlowjaie like https://gist.github.com/harlowja/5f9b3008d20d2668e8bcfc28eb491955#file-gistfile1-txt-L10221:38
harlowjawhy it was done like this, who knows21:39
rharperyeah21:40
rharperI was just confused21:40
rharpersysconfig is huge legacy21:40
harlowjadef21:40
rharperat the same time, the guts of ifupdown are ... harder to read than the in-line awk in sysconfig so no leg to stand on there21:41
harlowjalol21:45
harlowjaya, it's all one big mess imho21:46
harlowjaguess thats why systemd :-P21:46
rharperone mess + second mess => systemd ?  not sure what we expect then21:51
rharpermagic ?21:51
harlowja:)21:51
* rharper sprinkles some systemd magic around 21:51
rharperI do know that we'll now be told there _is_ one TRUE way21:51
rharperwhether that's right or not; at least you have an answer21:51
harlowjaha21:51
harlowjaya21:51
harlowjamgagne if u get a chance can u look over https://gist.github.com/harlowja/d63a36de0b405d83be9bd3222a5454a722:10
harlowjaits my creation, based off in part https://raw.githubusercontent.com/mgagne/cloud-init-fedora-pkg/epel7/cloud-init-0.7.5-network-info-support.patch + the refactored stuffs22:10
harlowjapretty sure its right, and u can just feed it a openstack json file and see what is output22:10
harlowja$ python sysconfig.py test.json22:10
harlowjafor example22:10
dmsimardharlowja: neat, I'll look too.22:22
harlowjathx22:22
harlowjahttps://gist.github.com/harlowja/d63a36de0b405d83be9bd3222a5454a7#file-sysconfig-py-L406 == the main function that thinks get started from22:22
dmsimardharlowja: just to be sure, what version of cloud init am I supposed to be running ?22:26
harlowjaa unmerged branch ;)22:27
dmsimard(for the imports)22:27
dmsimardehhh, how do I set that up ?22:27
harlowjahttps://code.launchpad.net/~harlowja/cloud-init/cloud-init-net-refactor/+merge/29395722:27
harlowjathat one22:27
dmsimardcan you zip it somewhere or something ? Afraid my bzr skills are pretty awesome (not)22:28
harlowjasure22:28
harlowjadmsimard actually u should just be able to run22:29
harlowjabzr branch lp:~harlowja/cloud-init/cloud-init-net-refactor cloud-init22:29
harlowjathat will get u the branch22:29
harlowja(into a folder called 'cloud-init')22:30
dmsimardok22:30
dmsimardlet me see..22:30
* dmsimard installs bzr ... and shivers22:31
harlowjalol22:32
harlowjatry a few json files (from openstack); let me know if anything looks really crazy (it might be crazy)22:33
harlowjasince things like https://git.fedorahosted.org/cgit/initscripts.git/plain/sysconfig/network-scripts/ifup-eth are crazy22:34
dmsimardharlowja: it's not crazy, it's empty :)22:34
dmsimardsec22:34
harlowjalol22:34
harlowjak22:34
harlowjarunning stuff like $ python sysconfig.py test.json  will just output to stdout btw22:35
harlowjait doesn't write anywhere yet22:35
dmsimardharlowja: https://gist.github.com/dmsimard/d6eaa8b61f3c601d833b29ef430637da this is what I'm testing against22:35
harlowjak let me try22:35
dmsimardand this is my output: http://paste.openstack.org/show/498378/22:35
harlowjayup, looks like that to me also, ha22:36
harlowjaok, let me see where things went here22:36
dmsimardI have the full config drive if you want, it may or may not be the one I think I may have provided you last time22:36
harlowjaoh i know22:36
harlowjalet me see, def seems like it should have more :-P22:37
harlowjaone of these other format layers killing the interfaces there22:37
harlowjawill figure that out22:37
dmsimardfwiw that's a mitaka config drive, if it's different or anything, no clue22:38
harlowjak22:38
harlowjau can try the example in https://bugs.launchpad.net/nova/+bug/151408222:39
harlowjai was trying that one also22:39
harlowjaas i figure out which layer dropped the info in your file22:39
dmsimardharlowja: ah, yup, that one works fine22:40
dmsimardharlowja: the whole config drive is @ https://dmsimard.com/disk.config if you want to peek at it.22:41
harlowjanp, not needed i think, just that one file is what matters here22:41
dmsimardyou should add my network_data.json to your unit tests in test_network_config_conversions after you figure it out :)22:43
harlowjaya22:43
harlowjaya, ok, sooo might have to poke rharper on this one22:44
harlowjahttp://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/cloudinit/net/network_state.py#L239 is puking on your date22:45
harlowjaprimarily because http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/cloudinit/net/network_state.py#L266 keys don't exist22:45
harlowjaand in the openstack version, they aren't getting translated ...22:46
dmsimardI updated my gist to be pretty printed :p https://gist.github.com/dmsimard/d6eaa8b61f3c601d833b29ef430637da22:46
harlowjaand i'm not quite sure what they should translate to/from22:46
harlowjait seems like that code is looking for bridge_interfaces and then interfaces (two sets of interfaces)22:46
harlowjawhere your example only has one :-P22:46
harlowjaso what does it bridge to :-P22:46
dmsimardit's a vm on a linuxbridge environment22:47
harlowjaright22:47
dmsimardthe vm doesn't have to configure any bridge22:47
dmsimardit's done on the compute node22:47
harlowjasure22:48
harlowjabut from my understanding of that code, its looking for a interface definitions of what to bridge to what else22:48
harlowjaso i'm not sure the mapping of http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/cloudinit/net/network_state.py#L239 and what openstack provides (is data missing?)22:49
harlowjawhat happens is that your json file first goes into a intermediarty format that is '[{'subnets': [{u'routes': [{u'netmask': u'0.0.0.0', u'network': u'0.0.0.0', u'gateway': u'172.19.3.254'}], u'netmask': u'255.255.252.0', u'type': 'static', 'ipv4': True, 'address': u'172.19.1.34'}], 'name': u'tap1a81968a-79', 'mac_address': u'fa:16:3e:ed:9a:59', u'type': 'bridge', 'mtu': None}, {u'type': 'nameserver', u'address': u'172.19.0.12'}]'22:50
dmsimardSo you have a network_data.json that's linuxbridge (mine) and the one you provided from the bug is from an ovs setup. It's a pretty good test to ensure both work well.22:50
dmsimardThe OVS one you linked also has the notion of links22:50
harlowjawhich then gets processed by that code into another intermediary format and then that format is what the sysconfig.py stuff works on22:51
harlowjaright, something is off/missing in the handle_bridge stuff here22:51
dmsimardThe links are probably just interfaces on the compute node (bridge tap) and the networks are bridged to these links on the compute node22:51
harlowjaya, i'm gonna delegate to rharper on this one, unsure what the expected openstack translation is for that to correctly work22:53
=== natorious_ is now known as natorious
dmsimardI'm off for the day, let me know if you find out and I'll poke at it some more .. I could even pitch a few VMs at it with the real thing :)22:53
harlowjaya, eventually we'll get there ;)22:54

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