/srv/irclogs.ubuntu.com/2019/08/15/#cloud-init.txt

felipe1982where is the output from "echo" in a "boothook" script sent?06:17
felipe1982not seen in /var/log/cloud-init-output.log06:18
=== cpaelzer__ is now known as cpaelzer
otuboI have a small question about ds-identify: on line 1447 checks $DI_DSNAME, which is the data source specified on the configuration file. If it's specified, that's enough reason to end the script and return FOUND to the systemd generator. Am I correct?12:22
otuboI mean, it doesn't really checks if the data source specified in the configuration file really exists.12:22
otuboI see lots of commits form smoser, so I'll just ping :-)12:25
smoserotubo: yes, that is what it does12:36
smoserthat would be specified as 'datasource=' in the ds-identify config.12:38
smoserwhich is not documented, somewhat by design.12:38
smoserhttps://bugs.launchpad.net/cloud-init/+bug/183809212:39
ubot5Ubuntu bug 1838092 in cloud-init "Add documentation for ds-identify configuration" [Wishlist,Triaged]12:39
smoserand /me goes afk for a bit.12:39
otubosmoser, shouldn't it really check if the data source exists? Let me explain my issue: I'm deploying a VM with vSphere with network customization (aka data source). First boot ok, network is configured. Second boot, ds-identify fails to check that the data source is gone (because of this check I mentioned) and cloud-init is still enabled. With cloud-init enabled and no data source, it falls back to default configuration (dhcp in my case)12:40
rharperotubo: generally if the command line (or config on disk) is telling cloud-init which datasource to use, then there's nothing to check.  If you do not hardcode the datasource in cmdline or in config, then ds-identify will do the checks to find the datasource12:51
lfainThe cloud-init.service  that is provided by cloud-init-19.2+10.g7f674256-1.el7.noarch.rpm for Centos7 doesn't contain "ConditionKernelCommandLine=!cloud-init=disabled"13:03
lfainIs it a bug?13:03
Odd_Blokelfain: I believe the cloud-init generator reads the kernel cmdline and disables all the cloud-init services if that line exists.13:05
Odd_BlokeOn an Ubuntu system, that generator is installed to /lib/systemd/system-generators/cloud-init-generator.13:07
lfainUnfortunately, cloud-init 19.2 ignores presence of "cloud-init=disabled" in the kernel command line in Centos7...13:07
Odd_Blokelfain: Do you have that generator installed, do you know?13:08
Odd_Bloke(If it's not exactly in that path, try `find / -name cloud-init-generator`.)13:09
lfainYes, it is installed. I just checked.13:09
lfain"/lib/systemd/system-generators/cloud-init-generator"13:10
Odd_Blokelfain: OK, this is probably worth a bug report.  Could you file one using https://bugs.launchpad.net/cloud-init/+filebug and make sure you attach the output of `cloud-init collect-logs` on a failing instance, please?13:12
lfainOk, I will13:13
otuborharper, doesn't that increases the boot time? On the second boot of my use case I get 1 min and 34 seconds of boot time just for cloud-init-loca.service. Also, even if I don't set the data source on ds-identify.cfg, ds-identify recognizes OVF (vmware) but resets the network configuration to dhcp13:13
lfainOdd_Bloke: Is it safe to add the "ConditionKernelCommandLine=!cloud-init=disabled" meantime?13:14
rharperotubo: ds-identify runs fast, it's reading data from /proc and sys;  it does invoke blkid once; but the overhead isn't high at all.   you can run cloud-init analyze show to see where time was spent.  depdenting on the datasource, local may attempt to extract metadata from a network source, which means cloud-init will do a dhcp and then crawl metadata for network config.13:17
rharper1m30 seconds *sounds* like a network timeout though13:17
rharperlogs will tell the story13:17
rharperotubo: if someone specified a datasource that wasn't there but is network-based, then it's going to try to read a url without networking ... or wait for networkd-wait-online.service to complete13:18
Odd_Blokelfain: You'd need to do it for every cloud-init unit.  But, to be clear, I don't know for sure that it will do what you want.13:25
otuborharper, I'm a little bit puzzled from this command, look at the output: https://pastebin.com/hHtSapG413:26
otuborharper, on line 18 it says it couldn't find OVF data source, even if ds-identify recognizes it.13:26
otuborharper, and on line 38 and 39 it spends a lot of time looking for network based configuration from EC2 and OpenStack (as you said above)13:27
rharperotubo: it does not look like ds-identify found an OVF, it looks completely disabled since cloud-init is searching all datasources13:27
rharperwe recently fixed a but with the generator on RHEL systems where ds-identify didn't have the correct path13:28
rharperdo you have a /run/cloud-init/ds-identify.log ?13:28
otuborharper, ok, two important things to mention here: 1) I'm using version 18.5 (but we're open to upgrade if necessary); 2) I can see from ds-identify.log and from the function dscheck_OVF() that it returns FOUND if disable_vmware_customization is set to false (which is in this case)13:31
rharperotubo: on (2) do you see a /run/cloud-init/cloud.cfg  ?13:32
rharperds-identify should write out a simple config of datasource: [<Found ds name>, None]13:32
rharperthen cloud-init will only search that list of datasources rather than the complete list;13:33
otuborharper, yes datasource_list: [ OVF, None ]13:33
rharperand if you've a cloud-init.log  then let's take a look13:33
otuborharper, sure, hang on13:33
otuborharper, You have exceeded the maximum paste size of 512 kilobytes per paste. hahahaha do you really need it?13:37
rharperthat's  a lot of reboots =)13:37
rharperjust the first boot or two13:37
otuborharper, as I understand ds-identify finds OVF because it is set on cloud.cfg (disable_vmware_customization to false) and it triggers it to NOT find the data source hence resetting to dhcp. Now the reason why cloud-init tries all other data sources I don't know.13:38
rharperwhat a mess;  ds-identify can find OVF without it being set in config13:40
rharperdisable_vmware_customization doesn't have anything to do with which datasource is selected, so that wouldn't make cloud-init search all datasources again13:40
rharpersomething else is going on; so the first boot or two logs13:40
otuborharper, ok, hang on13:41
otuborharper, this is the last reboot https://pastebin.com/80atbhBZ13:43
otuborharper, disclaimer: there's some curse words in Portuguese as I was doing some debugs.13:43
rharperoh man, so .. OVF has a really rotten bug right now w.r.t instance-id, https://bugs.launchpad.net/cloud-init/+bug/183520513:44
ubot5Ubuntu bug 1835205 in cloud-init "OVF datasource should check if instant id is still on VMware Platform" [Medium,Triaged]13:44
rharper2019-08-15 13:06:35,076 - util.py[DEBUG]: waiting for configuration file took 90.096 seconds13:45
rharperthat's your long boot time13:45
otuborharper, yep, just saw it too.13:46
rharperthe OVF datasource _resets_ it's instance-id on each boot so it could apply customizations after a first boot;  I'm not sure how we let that slip into the OVF datasource but it's just wrong from a cloud-init perspective13:46
otuborharper, and I just realized that `cloud-init analyze show' also shows other boots not only the current one. So hopefully ds-identify is doing its job correctly. So the only problem now is fixing this bug you just mentioned.13:47
rharperat least that bug needs a fix;  there could be more issues; but it's hard to say without sorting out what to do.13:48
otuborharper, I'm gonna try to contact Pengpeng Sun, perhaps we could work together.13:49
rharperotubo: if you have any vmware contacts, it would be great to reach out to them on this issue;  if we don't have anything before the summit, I'd really like to get together then and walk through the vmware scenarios to see how we can support as many and without this instance-id trick13:49
otuborharper, sounds good. BTW, I'll be at the Summit, just got my flight tickets.13:50
rharpero/13:51
* rharper raises other hand13:51
rharper\o/13:51
otuborharper, I think I've been working with you for *at least* 8 years (since IBM..) and I have no idea how's your face :-D13:52
rharperhehe13:52
rharperI think I put something up on linkedin a while back13:52
otuborharper, anyway, I'll work on this issue and will keep launchpad updated. Thanks for the help :-)13:53
rharperotubo: great!13:53
rharperif you have an existing RHBZ, feel free to link to that from launchpad as well, via the  Also affects distribution/package  link, you can specify distro and bug url13:54
otubowill do!13:58
Odd_Blokerharper: So I'm looking at the dracut network configuration, and I was assuming this would be relatively easy as this is sysconfig.  However, it looks like we don't have support for parsing sysconfig network configuration, only for rendering it.  Am I missing something, or is that the case?14:27
blackboxswrharper: do you have access to an OpenStack intsance w/  multi-nic and or  bonds bridges where we can dump curl http://169.254.169.254/openstack/latest/network_data.json   I was looking to avoid setting that up myself if you had a reference (this would be for my testing of OpenStack networking v214:57
blackboxsws/a reference/an example/  ...  I'm working on handling the unit test example coverage for v2, but wondered if you had any more complex examples in mind too14:58
blackboxswOdd_Bloke: objections to my uploading to eoan? we have a couple of fixes, azure & oracle that could use some 'exposure' before feature freeze (and the rest of the oracle work is likely going to be a day or two)15:37
Odd_Blokeblackboxsw: Nope, except to observe we'll probably want to do an upload right before FF anyway.15:38
blackboxswright +1. no concerns with more uploads :P15:38
blackboxswok kicking one off15:39
blackboxswok done [ubuntu/eoan-proposed] cloud-init 19.2-13-g2f3bb764-0ubuntu1 (Accepted)15:52
rharperblackboxsw: I was talking with jamespage about that; and it's not very common; I think maybe ironic backend;  the closest to that we have would be something on rax baremetal; they deploy with bonds and vlans;16:34
rharperI have some older network_data.json we used in the original parsing, but the upstream "format" should still show all of the details16:34
rharperhttps://specs.openstack.org/openstack/nova-specs/specs/liberty/implemented/metadata-service-network-info.html and https://specs.openstack.org/openstack/nova-specs/specs/rocky/approved/multiple-fixed-ips-network-information.html (proposed but not  yet landed I think)16:36
rharperOdd_Bloke: that's correct (we don't have a read-from-sysconfig -> network_state) path;  there are sysconfig reader helpers in tree used for updating and rendering sysconfig from distro classes;16:37
blackboxswthanks for the reference rharper16:44
Odd_Blokerharper: OK, thanks, I'll look around for those.16:44
rharper cloudinit/distros/parsers/sys_conf.py16:45
rharperand cloudinit/distros/rhel_util.py16:45
Odd_BlokeThanks!16:46
blackboxswminor fix for ubuntu-drivers for review https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/37136918:03
Odd_Blokeblackboxsw: Reviewed.18:37
blackboxswOdd_Bloke: just saw. wrapping up comments now thanks18:37
blackboxswOdd_Bloke: did you mention no sysconfig parsers in cloud-init? cloudinit/distros/parsers/sys_conf.py19:59
blackboxswnot sure if you already ran into that case19:59
blackboxswrharper: ^?20:00
rharperblackboxsw: I passed it along20:00
Odd_Blokeblackboxsw: Yeah, rharper pointed me at it. :)20:00
Odd_BlokeThanks!20:00
blackboxswsorry missed that response20:00
rharpernp20:00
blackboxswjust ran into it while looking at all our uses of ConfigObj in existing cloudinit20:01
rharperblackboxsw: I hope you saw my comment w.r.t the drivers branch20:02
blackboxswhadn't yet, refreshing rharper20:03
rharperIIUC, the /etc/default/* stuff is shell sourceable, so you can't use spaces in variable assignment20:03
blackboxswahh20:03
blackboxswwill use load_shell_content instead20:04
blackboxswthx20:04
blackboxswhrm but as Odd_Bloke mentioned, once we load_shell_content and attempt re-writing the file for amendments, we'll lose pre-existing comments if added by someone outside of cloud-init20:06
blackboxswnot sure if we care or not, but if we are re-writing the file, then I guess we could add the # written by cloud-init header20:07
blackboxswand we can cope with bugs and improve it if need be20:07
rharperwe can load the content to see what's there and then decide how to update/modify20:10
rharperwe could render via append with #header\n<content>\n#footer20:10
blackboxswand I see we use         return shlex.split(blob, comments=True)20:12
blackboxswso I think we do have the ability to retain comments20:12
blackboxswbut maybe that's just on the specific line which contains a value20:12
blackboxswwill test20:12
Odd_BlokeMy original comment doesn't stand as it's shell content.20:13
Odd_BlokeSo we may just be able to stick with what you had?20:13
blackboxswOdd_Bloke: rharper I think we do need to stick with what I had as load_shell_content actually strips comments, and trying to preserve comments across the shlex.split use is more work than just parsing line by line I feel.20:24
rharperblackboxsw: agreed;  I really don't expect that file to have a lot of manual changes20:27
blackboxswrharper: Odd_Bloke force pushed, comments addressed I think.20:31
* blackboxsw force-pushed set of fixes to https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/37136921:23
blackboxswwoot! thx Odd_Bloke rharper on https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/37097021:36
* blackboxsw celebrates with a victory lap for the trello card21:36
rharpernice21:36
Odd_Bloke\o/21:39
felipe1982where is the output from "echo" in a "boothook" script sent? not seen in /var/log/cloud-init-output.log22:44
blackboxswfelipe1982: it could be an error in the script preventing you from getting to execution. try running /var/lib/cloud/instance/boothooks/part-001 to see if you get an error or your echo22:55

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