/srv/irclogs.ubuntu.com/2022/07/22/#cloud-init.txt

phunyguyholmanb: ok, that got /etc/conf.d/net.eth0 to come back.  It's still not parsing the mac address from the clouddrive config file.  mac_eth0="None"00:55
phunyguyI feel like that should be something really easy to fix.  And then the last thing is starting the network service "net.eth0"00:56
phunyguyOh it's missing the nameserver and domain name settings too.00:56
holmanbphunyguy: hrm, I'd need more info than that to debug further15:14
phunyguyholmanb: I'll do a once over, dump some logs, and try to give some pointers as to what I think the problems are from a gentoo perspective.  15:33
phunyguyI am not good with python, so probably can't fix15:33
phunyguybut I can direct you at potential areas/line numbers15:34
holmanbphunyguy: sure no problem - thanks that would be helpful15:34
phunyguyfirst, coffee15:34
phunyguyday off today ☺15:35
holmanbNice! I'm working today, I can maybe help a little as time allows, but then I'm off hiking in the mountains over the weekend, so I'll be far away from a network connection until Monday :)15:36
phunyguyI better get moving then15:36
phunyguylol15:36
phunyguyalso that sounds like my nightmare.  Not a heights guy, and I have vague memories of being a kid hiking with my parents in Maine and being scared to death walking along foot-wide cliffs hanging on to bars.15:38
phunyguylooking down at teeny tiny trees15:38
phunyguypalms get sweaty just thinking about it.15:39
holmanbphunyguy: Maine has a via ferrata? Never been on one of those myself. I'm more into either climbing (class 5) or hiking. This one should be pretty tame, nothing technical.15:40
phunyguyI have no idea what that is.  It was sections of the hike that would hang off the side of the mountain with bars to hold on to.  I was scared to death15:41
phunyguyAcadia15:41
holmanbvia ferrata is the metal bars (literally "iron path")15:42
phunyguywell there ya go.15:42
phunyguyyes I guess I did that15:42
phunyguyThis was in the early 90s I think, not sure if anything is the same.15:43
holmanbnice15:44
phunyguyOK, so once I got rid of the mac address problem, by commenting it out in the generated config, the system boots with network.15:56
phunyguyso that's good.15:56
phunyguyBut I think it would be better to figure out why the mac config generation is putting "none"15:56
phunyguyholmanb: https://paste.ubuntu.com/p/BC4nrvJ3h7/16:00
phunyguyI have a feeling those log entries are old though16:01
phunyguyholmanb: ok so https://github.com/phunyguy/cloud-init/blob/main/cloudinit/distros/gentoo.py#L9516:06
phunyguythat is returning "None" for a value16:06
phunyguyLooking like the config is supplying "mac_address" and this is looking for "hwaddress"?16:07
phunyguyI guess I can test that in my own repo16:09
phunyguyoh sidenote, it had networking on boot because I left behind the net.eth0 service init.d file.16:15
phunyguyand that got started as a wants/needs16:15
holmanbre: old log entries fyi -> cloud-init clean --logs --reboot will re-init the system w/cloud-init and remove old logs16:17
holmanbWhen I'm testing changes in cloud-init I run that a lot ^^16:17
phunyguyok16:18
phunyguythanks for that16:18
phunyguyI was just doing `cloud-init clean`16:18
holmanbno problem, I'll add some more logging in _write_network()16:22
holmanbactually some interesting bits are already logged16:25
phunyguyoh goody, it did create the network init.d file, so that's good.  16:25
holmanbphunyguy: "Translated ubuntu style network settings" should be in the log -> what's that say?16:25
holmanbthat log output should tell us whether the issues is in `translate_network()` (or earlier) or in _write_network()16:27
phunyguyholmanb: https://gist.github.com/phunyguy/a93cd17ce13a75490eb6e1afe6310d2816:29
phunyguylooks like it's missing from the resultant eth0 line in that log16:30
phunyguythe hwaddress piece specifically.16:31
phunyguyMeh, maybe that part can just go away.  I am not even really sure of a good reason to include the mac in the config.16:41
phunyguyMan this could really use some work, and I am actually willing to try and situate the DNS portion of this that is really hacked together.  openrc can actually handle creation of a dynamic resolv.conf, as long as the proper things are in /etc/conf.d/net{.*}. 16:55
phunyguycurrently this writes a rudimentary /etc/resolv.conf, and is missing suffix search, etc.16:55
phunyguyGuys I'm learning python17:20
holmanbphunyguy: learning python -> \o/19:27
holmanbseeing this now19:27
holmanbphunyguy: In practice I dunno why anyone would want to spoof macs in the cloud, but it's pretty common these days on mobile devices I think (for whatever EUI48 addresses are called on mobile devices).19:34
holmanbEither way, if it's an expected configurable input, we should try to do the right thing rather than silently not do what users expect.19:35
holmanbbased on that gist, it looks like translate_network() isn't translating everything correctly19:35
phunyguyok19:46
phunyguyin the mean time, I am attempting to get the dns configuration working correctly.19:46
phunyguyholmanb: I'm struggling a little bit but I'll get there.19:46
holmanb^ relatable19:49
phunyguyThis is going to be a mess when I get done with it, but it will be more functional.19:50
phunyguyOnce I get done with this part, probably over the weekend, I'll send a PR to your repo/branch19:51
phunyguy...which I haven't really done before, so we'll see!19:51
phunyguyholmanb: what I am ending up with for dns_servers_lo is "['192.168.0.1']"...  How do I get rid of the [' ']19:53
phunyguythe end result should be a space separated list of what the list is19:53
phunyguylist/tuple, still haven't figured out the difference19:55
phunyguywhat the hell is a tuple19:56
phunyguyoh I think I got it.20:15
phunyguyblech: dns_nameservers = str(", ".join(dns_nameservers)).replace(",", "")20:15
holmanbconfused, are you writing a new network config parser? 20:32
phunyguyI am just modifying what's there to handle dns correctly.20:36
phunyguythe gentoo way20:36
phunyguycurrently it's only manually creating resolv.conf with the list of dns servers20:37
phunyguynetifrc has the ability to parse /etc/conf.d/net to gather suffix and dns-servers list to dynamically create resolv.conf with what's there20:37
holmanbphunyguy: oh I see. I don't think you should need to parse that data out. Looks like it gets cast to a string on line 81, just grab the data structures before the cast20:49
holmanbfrom the gist you shared previously, the value in "entries" is a dict: {'lo': {'ipv6': {}, 'dns-nameservers': ['192.168.0.1'], 'dns-search': ['neverserio.us'], 'auto': True}, 'eth0': {'ipv6': {}, 'bootproto': 'static', 'address': '192.168.0.249', 'gateway': '192.168.0.1', 'netmask': '255.255.255.0', 'broadcast': '192.168.0.255', 'auto': True}}20:50
holmanbso for this particular config entries["lo"]["dns-nameservers"] would get you a list of strings (where each string is an ip)20:52
holmanbkinda just guessing based on your variable names here ^^20:54
holmanb- but I'm pretty sure you shouldn't need to actually parse anything from a string20:54
phunyguyok21:06
phunyguyyeah this is whacky anyway..  dns-nameservers being associated with lo is weird to begin with21:07
phunyguyMaybe that's why the original author was writing resolv.conf directly.21:08
phunyguyIt's making it really difficult to do this with netifrc the way I want.  I don't think it's going to work.  So I'll just get the original code to drop the right stuff in /etc/resolv.conf and call it a day.21:09
holmanbgotcha +1, sounds good21:10
phunyguyThe last thing to figure out then is the hwaddress problem, which is where I would really need help.21:10
phunyguyholmanb: regarding your "cast to a string on line 81", that's exactly the line I was modifying, because originally the output was "('192.168.0.1')"21:12
phunyguythe (' and ') are a noop21:13
holmanbphunyguy: I'm trying to avoid rewriting this whole module.21:43
sam_:D21:44
holmanblol hi sam_ :)21:46
phunyguyholmanb: yeah I feel that21:50
holmanbphunyguy: pretty sure that ugly cast/replace line can just be a " ".join(dns_nameservers). I'm not sure why you would want to depend on tuple.__repr__ for just inserting spaces between items in a list.21:50
holmanbpushing a commit to your branch shortly21:51
phunyguyI don't know either.  I've reverted all that.21:51
phunyguyIt's not relevant if I'm not changing any of that.21:52
phunyguyHey I wrote something that worked!21:54
holmanbcongrats :D21:54
phunyguyOK I have another question before I lose you for the weekend21:54
sam_holmanb: hi! 21:54
holmanbo/21:55
holmanbphunyguy: go for it21:55
phunyguythe system update stuff... this is NOT a good idea in the gentoo world.... so I am changing "emerge" to "true" to completely eliminate all that for now.21:55
phunyguyI hope that's OK21:55
phunyguyif you have a better way to disable that, I am all ears21:56
sam_what's this?21:56
phunyguysam_: noooooottttthinnngg.....21:56
holmanbsam_: tl;dr phunyguy is working on some brokenness in the network stack they identified (mac and dns aren't passed through correctly)21:57
holmanbphunyguy: disabling update is a change I would run by a gentoo maintainer21:58
phunyguywell that's the thing, it's completely broken.21:58
phunyguywhen the images are built, portage is completely stripped out to make the image smaller, so there is no profile, tree, or anything.21:59
holmanbwhich images?21:59
phunyguyrunning emerge in that case to try and update the system is completely hosed up.21:59
phunyguysorry, this is being used with diskimage-builder in my case, the openstack project.21:59
holmanbcloud-init isn't responsible for image build so I'd argue that's not a cloud-init problem.22:00
phunyguynor is it a diskimage-builder problem.22:00
phunyguylol22:00
phunyguythe primary for the gentoo portion of that project is so vehemently against cloud-init vs simple-init it's hilarious.22:01
holmanbdiskimage-builder strips portage but it's not diskimage-builder's problem?22:01
phunyguyI was being sarcastic22:01
holmanbI see22:01
* phunyguy holds up the sarcasm sign22:01
phunyguyinterestingly enough, the person that wrote this gentoo.py is the same person I am mentioning22:02
phunyguyit seems we are the only two people doing things like this with gentoo, and we disagree on many things.22:02
phunyguyAlso it should be noted, that before I changed it to "true" to get rid of the emerge command, network setup was also failing.22:04
phunyguyso something is definitely wonky there.22:04
holmanbhuh, I'm going to attempt to continue staying out of those sorts of turf wars, but happy to help making the project better :)22:04
sam_yes, tell me if you need me to tie-break or something phunyguy 22:05
phunyguysam_: possibly.22:05
phunyguyhowever I don't necessarily disagree with stripping out portage to keep the images smaller22:05
phunyguybut if that's causing problems, then maybe it should stay unstripped.22:06
phunyguyBut I am still concerned that emerge is running before the network is up.22:06
phunyguyso that's still a cloud-init problem if so.22:06
holmanbI don't think package managers are executed elsewhere without network - if so that's probably a bug22:07
phunyguyI think networking isn't started until default runlevel, which comes after all this.22:09
phunyguyahh scratch that, I see where it's supposed to22:09
phunyguyyeah you are right, this is 100% a DIB issue22:10
phunyguyit's the mac issue that causes it to not come up initially, but still tries to update22:10
phunyguyI guess I should ask, if the packages fail to update, would that affect anything else in the CI process?22:11
phunyguyif not, then I say leave it.22:11
phunyguyI await your commit22:12
holmanboops, one sec22:12
holmanbphunyguy: pushed22:13
phunyguy\o/22:13
holmanbI don't think package install failure will cause cloud-init to stop as a whole. Those invocations should be limited to config modules, which are later in boot process. You'll see lots of noise in logs and any module depending on package update/install will exit early, but the rest of the process will continue.22:15
phunyguyexcellent22:16
phunyguynothing-burger then22:16
phunyguyok I think I got your changes merged with mine22:28
phunyguyholmanb: what to you out? I would assume soon?22:29
phunyguywhat time you out*22:33
phunyguysheeeeeeeeeeeeesh22:33
holmanbhalf hour left for me, mountain time22:35
phunyguyok22:35
* phunyguy wipes sweat22:35
phunyguythe last thing I want to do is keep you from your trail fun22:38
phunyguyany thoughts on the missing mac?22:38
holmanbpretty sure the problem is in translate_network(), how exactly I'd need to read the code and understand both formats22:40
phunyguyok so definitely not a today thing.22:41
phunyguyI'm going to send you a pr for what I have, for your review, and you can do what you want with it.  We can approach the other problem later.22:41
holmanbNot going to get to that today. Sounds good, I'll take a look at it Monday.22:44
phunyguyYep, it's there for you22:45
phunyguyenjoy your weekend and THANK YOU for the help here.22:46
holmanbphunyguy: thanks for putting in the legwork on it - it helps :D22:46

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