/srv/irclogs.ubuntu.com/2017/03/30/#cloud-init.txt

=== shardy is now known as shardy_mtg
=== shardy_mtg is now known as shardy
randomhackIs it possible to override the default cloud-init values inside the OS image?  I'm trying to have it always run the disable-ec2-metadata module. TIA!13:42
larsksrandomhack: yes, you can pass in a cloud configuration that will override what is provided in the image.14:13
smoserrandomhack, or just put that setting into /etc/cloud/cloud.cfg.d/14:13
smoseri think thats what you're asking.14:13
smoserecho "disable_ec2_metadata" >> /etc/cloud/cloud.cfg.d/99-disable-ec2.cfg14:14
smoserer... with the value too14:14
randomhackThanks!15:08
smoserrharper, around ?15:13
rharperhere15:13
smoserhttps://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/167557615:13
rharpery15:13
smosershall i attempt to know understand the 00-snapd-config.yaml15:13
smoserand delete the files it writes undconditionally15:14
smoseror just unconditionally delete those ?15:14
rharperI think we do it like the eni one;  it has known content15:14
rharperit's baked into the core snap image;15:14
rharperso, just like the eth0.cfg in the cloud-images15:14
smoserok. so if the 00-snapd-config.yaml exists with known content15:15
smoserthen i unconditionally delete the 3 other files15:15
rharperI think so; let me walk through the paths15:18
rharper1) if cloud-init is disabled, then the image will use the baked in config; no issue  2) if cloud-init is enabled and has no network-config; it should still generate a fallback config, like we do today; uc16 will enable the netplan renderer; the baked in config should be removed  3) cloud-init is enabled, and we have a network config;  uc16 is configured to use netplan renderer, so we should delete15:19
rharper(2) and (3) I think cover the cases for if content is known, delete it as cloud-init will render a fallback (or specified) network config15:20
rharperand yes to wiping the files that netplan would have generated as the netplan renderer will call 'netplan generate' which will create those files as needed (from the cloud-init config it rendered)15:20
jgrimmpowersj and magicalChicken, you are probably interested in reviewing this too -> https://code.launchpad.net/~raharper/cloud-init/+git/cloud-init/+merge/32139716:01
jgrimmrharper, thanks for writing ^^ fantastic16:05
powersjrharper: that doc is incredibly helpful. thank you!16:22
rharpercool16:26
smoserrharper, https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/32146516:28
rharperk16:28
rharpersmoser: I proposed that the other night16:29
smoseroh. link ?16:29
smoseri thought i'd seen it16:29
rharperhttps://code.launchpad.net/~raharper/cloud-init/+git/cloud-init/+merge/32122216:30
rharpermines better because you need to import logging and create  LOG object16:30
smoser:)16:31
smoseryeah16:31
smoserok16:31
smoserrharper, http://paste.ubuntu.com/24282363/16:59
smoserare you opposed to that on top of yours ?16:59
rharperlooking17:05
rharpersmoser: that looks fine17:05
smoserrharper, thats merged. if you want to read... https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/32147117:09
smoseri need to add tests17:09
smoserits very simplistic and targetted. i had more generic looking things, but the scaffolding is unnecessary at this time. if we need somethign smarter later, add it then.17:10
rharpersmoser: ok, looking17:56
smoser*just* p ushed with teests17:57
rharpersmoser: also, is it reasonable for ds-identify to also look in /etc/cloud/cloud.cfg.d/ ? for maas datasource ?17:57
rharperthe debconf_setselections hook for maas IIRC, writes the maas datasource cfg to /etc/cloud/cloud.cfg.d17:57
rharperbut ds-identify detect_maas only searchs PATH_CLOUD_CONFD/*maas*cfg ;  which I believe will miss the .cfg.d dir17:58
smoserrharper, it does look for maas datasource there, no?18:00
smoserit should. let me check.18:00
rharperwould be nice if check_config mentioned the files it checked in the debug log so we could be certain18:01
smoserbah. i thjin its busted.18:01
rharperdebugging a uc16 deploy with plars and it's not finding the datasource18:01
rharpersmoser:  it does check files in .cfg.d/*maas*;  it;'s looking for a top-level key 'MAAS' but I believe we specify it via datasource:\n\tMAAS: {}18:15
rharperso it doesn't match18:15
smoserno. its just not looking right. the file names input are wrong.18:16
smoseri dont think it checks in .cfg.d18:16
smoserat all18:16
rharperhrm18:16
rharperI added a debug log to check_config to print the fnames that match18:16
rharper[up 659.59s] ds-identify18:17
rharperpolicy loaded: mode=search report=false found=all maybe=all notfound=disabled18:17
rharperchecking config file: /etc/cloud/cloud.cfg18:17
rharperchecking config file: /etc/cloud/cloud.cfg.d/05_logging.cfg18:17
rharperchecking config file: /etc/cloud/cloud.cfg.d/50-cloudconfig-maas-cloud-config.cfg18:17
rharperchecking config file: /etc/cloud/cloud.cfg.d/90_dpkg.cfg18:17
rharpershows it reading it18:17
rharpernow checking why we don't match18:17
smoser http://paste.ubuntu.com/24282702/18:19
smoserhm..18:19
smoseroh. those are just other things reading it.18:19
smoserit does read those for some sources18:19
smoserfor some calls to check_config18:19
smoserbut not for maas's18:20
smosertry that paste ?18:20
rharperok;  currently it looks like key was getting clobbered from a value in the file18:20
rharperahh, I see18:21
rharperother methods were looking there but the dscheck_MAAS wasn't18:21
rharperlemme try yours18:21
rharpersmoser: ok, that works!18:23
rharperchecking config file: /etc/cloud/cloud.cfg for key: MAAS18:23
rharperchecking config file: /etc/cloud/cloud.cfg.d/05_logging.cfg for key: MAAS18:23
rharperchecking config file: /etc/cloud/cloud.cfg.d/50-cloudconfig-maas-cloud-config.cfg for key: MAAS18:23
rharperchecking config file: /etc/cloud/cloud.cfg.d/90_dpkg.cfg for key: MAAS18:23
rharpercheck for 'MAAS' returned found18:23
smoserthat PATH_CLOUD_CONFD18:23
smoserwas very confusing18:23
rharpersmoser: that said, I think we want to check for datasource: MAAS  though18:23
smoseri need to get my unit tests for ds-identify18:24
rharpernot just 'MAAS' does it walk indented colons ?18:24
smoserthers a comment about that18:24
smoser"currently does not respect any hierarchy in searching for key."18:24
rharperurg18:24
rharperso, how do specify the datasource: MAAS  then ?18:24
rharperwe need to emit MAAS: foo and the datasource: MAAS ?18:24
smoseri'm confused.18:25
smoserdatasource:18:25
smoser MAAS:18:25
smoser   stuf here18:25
smoserthat will work18:25
smoserthe parser doesn't know that 'MAAS' there is under datasource.18:25
smoseriti just finds a key named MAAS18:25
rharperok; the comment about hierarchy led me to believe we'd not look at anything but the top level keys18:25
smoserits just broken in a different way then you imagined :)18:26
rharperif it was written datasource: { MAAS: { } }18:26
smoserbasically it just flattens everything and looks at only key names.18:26
rharperit'd break as well18:26
smosermaybe, yes.18:26
rharperok, well, that's good enough until we do unittests and sort out edge cases18:26
smoseryeah. it doesnt support reading that.18:26
smoserwait. maybe it does.18:26
* rharper tries18:26
rharpernope18:27
smoserright. it doesnt. we need a tool that can merge cloud config in the same way cloud-init does and run fast.18:28
rharpery18:29
smoserrharper, mp https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/32148219:26
rharperk19:26
smoserrharper, fwiw, stumbled upon free speedup in cloud-init at19:39
smoser http://rmcgibbo.github.io/blog/2013/05/23/faster-yaml-parsing-with-libyaml/19:39
smoserseemingly free19:39
jgrimmsmoser, have you benchmarked?19:40
smoserit probably wont be huge for cloud-init, but it is faster per19:41
smoser http://stackoverflow.com/questions/16864132/is-there-an-up-to-date-fast-yaml-parser-with-python-bindings19:41
smoser http://stackoverflow.com/questions/27743711/can-i-speedup-yaml19:41
jgrimmack, yeah that's what i was curious about, whether it actually makes a difference, tho  small, but free is something19:42
smoserrharper, cloudinit/net/netplan.py19:45
smoserbah19:45
smoserhttps://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/32147119:45
smoserprints removed19:45
rharpersmoser: whoa , we have libyaml ?19:56
smoserwell, in a new container this works:20:00
smoser python3 -c 'import yaml; from yaml import CLoader'20:00
smoserso i'd think that'd trow exception otherwisd20:00
jgrimmi had a trusty container handy, seemed to work their too (and i can see libyaml in dpkg -l too)20:00
jgrimms/their/there20:00
smoser# apt-cache show python3-yaml | grep Depe20:01
smoserDepends: python3 (<< 3.6), python3 (>= 3.5~), python3:any (>= 3.3.2-2~), libc6 (>= 2.14), libyaml-0-220:01
rharperdo we run py3 on trusty c-i ?20:01
smoserprobably python2 there.20:01
jgrimmi ran python2 there20:02
smoserand we should do a try: except ImportError anyway20:02
jgrimmhttps://github.com/msmbuilder/msmbuilder-legacy/pull/199/commits/beb21bf10892dd566fccf567f907404957db1aed20:02
rharperoh I suppose it should still work for py2 to call to libyaml though right ?20:02
jgrimmlooks like easy pattern to adopt20:02
smoseryeah20:02
smoserrharper, intentionally or not, your bond rename devices test case shows that vlans have the same mac as the nic they use also20:48
smoserso have to ignore those20:48
smoserso, good that you did that .20:49
rharperhuh20:49
rharperyeah, I guess that makes  sense20:49
rharperthey just need to check for the vlan header but the mac is going to be the same20:49
rharperw.r.t "is this packet for me"20:49
rharperyay unittests!20:49
jgrimmpowersj, any strong reason to require --data-dir to the integration test 'collect'?  That is, why not allow for tmpname as it gets output to stdout with 'run' (so could be inspected if left alone and/or verify'd later)20:59
powersjjgrimm: I don't think it is a very strong feeling, but it was to prevent writing it to /tmp so you didn't loose your collect after each reboot :)21:01
powersjstrong reason* ugh21:01
jgrimmcool, i assumed so. just didn't work as i'd guessed it would (since i didn't read the docs, doh)21:02
powersj:)21:02
powersjyeah if I recall when I was writing all the initial tests it would go to tmp and then the next day I would spend the first 20mins running collect again :\21:02
jgrimmfwiw, the docs could be a bit more explicit on 'use collect' if you want to actually inspect a run21:02
jgrimmi can certain submit a pull request if agreed21:02
powersjmagicalChicken has a MR to keep the records around when doing a run21:03
jgrimmpowersj, cool, that's what i was wanting to do and figured collect was the intended way of doing that21:03
powersjhttps://code.launchpad.net/~wesley-wiedenmeier/cloud-init/+git/cloud-init/+merge/32040121:03
jgrimmpowersj, do we run integration tests on trusty as part of automation?21:04
powersjthat however does still need a doc update :)21:04
powersjnot yet21:04
powersjA few too many of the tests initially did not work with trusty versus xenial and newer due to changes in behavior21:05
jgrimmheh, ok i want to play with the tests and better understand.. randomly chose a module.. blows up on trusty, not elsewhere. :)21:05
jgrimmcool. known issue(s). :)21:05
powersjhaha yeah magicalChicken has yet another MR for distro flags, to be able to specify what tests can run on what distros21:05
powersjhttps://code.launchpad.net/~wesley-wiedenmeier/cloud-init/+git/cloud-init/+merge/32102921:06
jgrimmindeed, looking forward to that landing, really nice addition21:06
* jgrimm checks whether this one is fixed already. 21:07
jgrimmpowersj, but overall I think the integration test infrastructure is really nice.. easy to add to it21:08
powersjjgrimm: thanks! magicalChicken: ^^^ :)21:08
jgrimm\o/21:09
magicalChickenpowersj, jgrimm: nice thanks :)21:11
magicalChickenjgrimm: you mentioned getting everything going on trusty, i still have a couple more feature flags to mess with there i think21:12
magicalChickenjgrimm: part of the issue is out of date cloud-init, so i need to build a py2 deb with current master for trusty and see how many tests fail just because of the old version21:13
jgrimmmagicalChicken, very cool21:18
jgrimmindeed, i'm guessing this is an issue with being out of date21:19

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