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

blackboxswtribaal: for tomorrow, can you add some background on the need for the set-passwords override in the merge proposal https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/371823  .   I wasn't sure if there was a limitation in the platform that disallowed changing the instance-id in your metadata after a console operation to update passwords02:46
=== cpaelzer_ is now known as cpaelzer
tribaalhi blackboxsw - so regardig your question (I'll discuss it here and then add a comment on the PR):15:24
tribaalindeed, we currently only set an instance-id per, well, instance. That is - each time a user decides "give me a new VM", our code sets this VM's id as instance-id. While it would be possible to change the instance id between an instance creation and its end of life, it feels weird to me - the user password is not a defining characteristic of the instance, I don't think resetting the password should15:26
tribaalregenerate an instance id15:26
tribaalhowever, resetting the user password (whatever the appropriate user is for that particular os - ubuntu, root, etc...) is a feature we offer our users and so would like to keep. The current flow is something like "press this button in the UI and we regenerate a password for you, then you reboot your instance and voila, new password"15:28
tribaalbut this requires the cloud-init module to be run "always" unless I'm mistaken. It's the same instance - but the password might have changed.15:29
tribaalresetting the instance id would trigger other modules to re-run as well when resetting the password - for instance, I guess per-instance runs of cloud-config's "runcmd" would run again if we changed the instance id?15:30
blackboxswsounds good tribaal we were talking about this in standup at the same time as your ping here15:33
tribaalah :)15:33
tribaalblackboxsw: if you want to hop in a call I can do a live demo of the feature, if that would help15:33
blackboxswsure tribaal. join if you'd like https://meet.google.com/bxm-azib-mtj15:49
blackboxswyour ears are probably burning  :)15:50
blackboxswas we are talking about you15:50
tribaalhaha15:50
blackboxswtribaal: I have a fix, but I'm still working on unit test fixe s16:54
blackboxswwill unfortunately be > 1 hr as I have an errand16:54
blackboxswpushing what I have if you want to look16:55
blackboxswdeb won't build because of unit test failure16:55
tribaalblackboxsw: ack17:30
tribaalblackboxsw: rharper: the only thing I thought about in between is that the semaphore-nuking approach will be a little be strange from a logs perspective - the logs will show something along the lines of "set-passwords ran with frequency once-per-instance" yet it will run more than once per instance.17:32
rharpertribaal: yes17:32
rharperI think if we also log in the datasource what we're doing it's explainable17:32
tribaalyes, that is probably enough17:33
blackboxsw<- back18:20
blackboxswworking on the unittest fixup now18:20
blackboxswand adding a log message about set-password frequency override18:21
blackboxswtribaal: rharper just force pushed the exoscale branch18:51
blackboxswunit tests fixed18:51
blackboxswtesting now on my exoscale branch18:51
blackboxsws/branch/vm18:52
blackboxswbah get_ipath not available at that spot in the datasource. fixing18:58
tribaalblackboxsw: thanks - I kicked off a test, but unfortunately it hit a bump in the road (nothing tragic as far as I can see though)19:52
tribaalblackboxsw: I imported your keys in "ssh ubuntu@159.100.241.241" if you want to poke around (similar setup as the prvious machine - an Eoan snapshot on our preprod infra)19:53
blackboxswthanks tribaal19:59
blackboxswtribaal: that's stale :/20:00
blackboxswahh tribaal I forgot to push my fix will have that up in about ~2020:00
blackboxswtribaal: I fixed for your tomorrow. testing again now on a live instance20:21
blackboxswrharper: tribaal I just tested current 576531c33b7c5bf215b5bc59dbff84eb9feaf981 of https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/371823 with success20:36
* blackboxsw runs to an errand20:37
rharperblackboxsw: thanks, I'll review20:42
* tribaal tries again21:13
blackboxswrharper: per using sem_path = self.paths.get_ipath_cur('sem')  that was coming up None on Exoscale datasource, in my earlier pass on this, the datasource wasn't attached to self.paths for some reason21:37
rharperit should be it's in the base class21:37
rharperright ?21:37
blackboxswahh wait I was using get_ipath() not get_ipath_cur. will try it now21:37
rharperyes21:37
rharperI saw the same thing with get_ipath vs cur21:37
rharpersmells like a bug, but I've not studied the Paths() object enough to know why21:38
blackboxswthanks  rharper. I'll make a note to file a bug about that behavior. Ok I can flip back to my previous unittests then which make use of get_ipath_cur then.21:40
rharpercool21:41
blackboxswand I owe you a review21:41
blackboxswrharper: I reworked https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/37182321:55
blackboxswtaking your suggestions thanks21:55
blackboxswpushing it now. and testing live21:55
* blackboxsw is reviewing https://code.launchpad.net/~raharper/cloud-init/+git/cloud-init/+merge/371906 now21:59
rharperblackboxsw: ok22:00
blackboxswtribaal: validated latest on the vm you gave me. I've shut down that vm now so I have no more access.22:06
blackboxswrharper: per secondary vnic v1 or v2, why are we emitting netmask and gateway in v1, but not providing either a /<prefix> in addresses or routes?22:12
blackboxswrharper: also a followup unrelated question, would you expect that the global DNS defined in this sample should show up as sysconfig rendered config for eth0  as DNS1=172.19.0.12 https://paste.ubuntu.com/p/ZMVk5mNGNm/22:25
blackboxswthat question is part of the openstack v2 network config outstanding unit test failures I have. I'm reflecting global DNS service entries onto every device that doesn't have dhcp or it's own DNS defined22:26
blackboxsw.tox/py3/bin/nosetests tests/unittests/test_net.py on https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+ref/feature/openstack-network-v2-multi-nic22:28
blackboxswahh so rharper v2 is lossy w.r.t. 'global dns'. Since v2 defines top top-level dns service values, (and we reflect dns values to each interface) sysconfig renderer doesn't know if it needs to setup /etc/resolv.conf23:09
blackboxsw*Since network v2 defines *no* top-level dns service values*23:10
blackboxswI wonder if we need sysconfig renderer to be 'smarter' and check v2 config to see if nameservers config on each interface is the same and if identical, reflect that dns information up to top-level /etc/resolv.conf23:11
blackboxswor if not sysconfig renderer, maybe network_state needs to be smarted about it's dns_nameservers property23:11
blackboxswsmarter rather23:12
rharperblackboxsw: re: global dns, it's only interfaces that _have_ an IP, but not dns (and we skip subnets with dhcp)23:39
rharperblackboxsw: so the goal with a global dns is to just ensure that it shows up on any interface that won't already get dns from somewhere else (like dhcp)23:41
rharperblackboxsw: so, yes, in your paste, I would expect a DNS entry in ifcfg-eth023:41
rharperb2 does not define top-level dns, rather it's per interface under the type:  so ethernets: eth0: {nameservers: [], search: []}, eth1: {nameservers: [], search: []}, vlans: eth0.23: {nameservers: [], search: []}}}23:42
rharpers/b2/v223:42
blackboxswrharper: only that it is a slight difference in behavior now, instead of emitting an /etc/resolv.conf, we now append DNS1 on each etc/sysconfig/network-scripts/ifcfg-eth023:43
rharperwhich will end up in resolv.conf23:43
rharperper distro networking23:43
rharperotherwise, what's the point of DNS value in sysconfig ?23:43
blackboxswahh right: dunno if we need to shore up that difference and have network_state.dns_servers track nameservers under each v1 'ethernets' object23:44
blackboxswgood pt23:44
rharperhrm, so looking at sysconfig23:44
rharperwe pick up dns_nameservers from the network_state iface subnet config23:44
rharperthat really shoud end up in resolv.conf23:45
rharperblackboxsw: can you paste out a dump of your network_state dict after openstack -> v2 -> network_state ?23:46
rharperI think we print the object in the unittest in a few places23:46
rharperand do you have a branch up that I can see your converter ?23:46
rharperblackboxsw: if we wanted to stay the same, then I think in network_state parsing v2, as we read in per-interface dns data, we could also append to the network_state.dns_nameservers (if the value isn't already present);23:49
blackboxswrharper: that last statement is what I was questioning. we could do something just like that to retain top-level DNS references, though if we had distinct DNS-per interface, just leave it hanging under the interface23:51
rharperblackboxsw: some quick experiements in centos7, shows that nameserver values already in /etc/resolv.conf get overriden by DNS values from ifcfg files23:55
rharperso I really think that per-interface DNS really is the right way since global isn't really a thing23:56
blackboxswrharper: so we could promote common dns values up to top-level via network_state.dns_servers settings. and allow unique dns to continue to live on the interface23:56
blackboxswrharper: that works. I can leave it per interface then23:56
rharperblackboxsw: so, the only case I can think of that we should verify is that if we have a global dns in the source config, ala openstack, but no interface to put it on23:56
blackboxswrharper: we'll have global dns in network_data.json :/23:56
rharperno, I mean ,no where to put it23:57
rharpernetwork_data.json either gives us a static ip23:57
rharperor they dhcp23:57
blackboxswhrm right.23:57
rharperso we always have a place to put the dns value23:57
rharperit's not really *global*23:57

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