[07:47] hello! it's possible to set hostname with variables? [07:58] or should i use something like bootcmd: - hostnamectl set-hostname "hostname-$(http://169.254.169.254/2009-04-04/meta-data/instance-id)" ? [12:53] SmokedCheese: its not possible right now. we have a card to do something like that. [12:53] so yeah, your only option is what you have there. [12:53] okay, thanks! [14:15] SmokedCheese: https://trello.com/c/AYaCdQyT [14:15] that is the card that describes what we'd be looking to do. [14:17] and i just added a section for what i think you were asking for. [14:30] sweet [16:14] powersj: so... https://code.launchpad.net/~ajorgens/cloud-init/+git/cloud-init/+merge/331660 [16:14] ci didnt run. but didnt complaon [16:14] and /me didn't see it cry [16:14] because ajorgens isnt in happy list [16:14] probably need some solution for that [16:14] aah [16:15] let me add him to the white list [16:15] +1 powersj can you make sure robjo is on that too [16:15] he might already be [16:16] blackboxsw: robojo is rjschwei? [16:16] powersj: yep [16:16] powersj: where is that list ? [16:17] smoser: torkoal:~/.jlp/jlp.config [16:18] and done [16:26] my lp userid is rjschwei [16:26] powersj: ^^^^ [16:27] robjo: thx [17:35] welcome to the wide world of automated CI votes on your branches robjo [17:36] blackboxsw: thanks, something new to figure out ;) [17:37] on that note, anyone have any time to provide some feedback on the chrony integration on the ML? [17:39] blackboxsw: hm.. [17:40] hm.. [17:40] hm.. [18:18] ok cloud-init status systemctl checks is pushed [18:19] sorry smoser yeah that last paragraph of the blog post was WIP. will ping when done [18:36] ok done. [19:18] smoser: blackboxsw was there a network rendering fix after 17.1 was released? [19:18] reference is https://bugzilla.opensuse.org/show_bug.cgi?id=1064854 [19:18] bugzilla.opensuse.org bug 1064854 in OpenStack "cloud-init ignores network settings from config-drive in external network" [Normal,New] [19:18] it looks to me as if a V1 config is not properly transformed [19:19] robjo approve https://code.launchpad.net/~rjschwei/cloud-init/+git/cloud-init/+merge/333575 with comments [19:19] approved rather. nothing for you to fix that I can see. [19:19] probably will merge later today [19:19] checking the bug [19:19] this appears to be tested in test_apply_network_config_eni_ub in test_netconfig [19:20] and I fail to see where this transformation would be distro implementation dependent [19:22] The way I see it the transformation should be as follows from V1 config to the debian/ubuntu network specification, which should then end up in the distro implementation which for openSUSE is still _write_network [19:30] robjo: looks there is a distro-dependent component for network renders. I see renderer_configs defined in cloudinit/distros/debian.py which direct what renders to use for debian/ubntu [19:31] checking how that's used [19:32] I am not using the renderer concept yet, because the sysconfig renderer has the path hard coded and the paths between RH and SUSE do not match, that's where the refactoring comes into play that I mentioned in the meeting the other day [19:33] for now I end up in network_state.parse_net_config_data [19:34] In "regular" code flow somewhere would be a call to distro,apply_network_config(), which fails for openSUSE/SLES the exception is then caught and we end up in _apply_network_from_network_config [19:35] in this method the information is supposed to be transformed to the "standard" debian/ubuntu interface configuration, i.e. it should look something like V1_NET_CFG_OUTPUT in the test [19:36] is there a test that covers that specific transformation? [19:42] robjo: so, network_data.json -> v1 config happens, then, since you're not yet using the sysconfig renderer, you're getting an already rendered eni config, but the opensuse write_network is re-reading it to convert it to sysconfig; it appears [19:42] generally there is ./tools/net-convert in our repository we use to validate rendering types given a provided network config and specifying whether your are rendering ['eni', 'netplan', 'sysconfig'] output files. [19:42] I don't think we have a v1 -> net_util.translate_network() path [19:42] which is what's happening here [19:44] robjo: and there are no unit tests for net_util [19:44] :( [19:45] meh the problem with 63% unittest coverage, is the other 37% [19:47] whats the delta in rhel sysconfig paths and suse ones? [19:47] that seems like a shorter path (using sysconfig renderer in the suse distro class) [19:48] 'network' (SUSE) vs. 'network-scripts' (RHEL) , yes I also roll my eyes over stuff like this ;) [19:48] man, that wants some temporary symlinking [19:48] if that's it [19:49] well "two ugly" do not really make "one pretty" [19:49] nope [19:49] but the instance boots with networking [19:50] too bad we can't ask sysconfig what paths it's using [19:51] but I suppose I could force the symlink in the cloud-init package, although I I remember correctly I tried to patch the path for 0.7.9 and that failed [19:51] robjo: where duse SUSE put the /etc/sysconfig/network (global settings) file ? [19:52] of course when 17.1 came around I had forgotten all of that and just moved forward since a good chunk of my out of tree code was now included [19:52] on RH, that has NETWORKING=yes and NETWORKING_IPV6=yes ; [19:52] the global settings file is /etc/sysconfig/network/config [19:53] urg [19:53] so both those paths [19:53] I suppose in the rendered we could test the and then switch between 'network' and 'network-scripts' but that's not very pretty either [19:54] s/rendered/renderer/ [19:54] well, I was thinking about that as well but; I think there may be other issues [19:54] in that config file, it uses NETCONFIG_* namespace for some variables [19:55] I suspect you'd need a subclass of sysconfig for some things, but others would be fine [19:56] bbiab [19:56] yes, there are NETCONFIG_* settings in that file [19:57] I agree that the proper route is subclassing i.e. refactoring, hence my question during the meeting [19:58] I think the shorter path for now may be to figure out a v1 -> net_util.translate_network() [19:58] unfortunately I am getting lost in network_state.py in parse_config_v1, cannot quite wrap my head around what's happening there [20:04] BTW at least in the code the path from v1 -> net_util.translate_network() at the high level is not too convoluted [20:05] If I put he puzzle together properly it would go along these lines: [20:08] apply_network_config -> this raises an exception which is caught and gets me to _apply_network_from_network_config here the config gets transformed vi network_state.parse_net_config_data() and eni.network_state_to_eni() then we end up in apply_network which finally calls _write_network() and the last method is implemented in the distro subclass and for openSUSE/SLES we end up caling net_util.translate_network() [20:09] my thinking is that either in network_state.parse_net_config_data() or eni.network_state_to_eni() something goes wrong [20:29] blackboxsw: were you looking at centos fail ? [20:31] i verified it does fail here locally [20:31] ./tools/run-centos --unittest 7 --keep [20:33] smoser: yeah I had forgotten while fixing up disable and the blogpost. but reproduced on 6 and I'm working now [20:41] looks like the URLError text raised is different in centos than ubuntu: 403 Client Error: Forbidden for url: %s versus just "403 Client Error: Forbidden" [20:41] Error: Ubuntu bug 403 could not be found [20:41] thx ubot5 [20:42] I'll update a patch to provide the bad_url if not present in the error message [20:43] nacc: i think you told me of somethign that is like [20:43] git commit-tree && HEAD [20:43] ie, head after commit-tree [20:43] ? [20:45] smoser: sorry, not followinng [20:46] if i have changes in my working directory [20:46] i wanted to refer to HEAD + changes-to-tracked files [20:47] ithink like this https://stackoverflow.com/questions/2766600/git-archive-of-repository-with-uncommitted-changes [20:47] smoser: you can write-tree [20:47] smoser: and that gives you a treeish [20:47] and git-archive can archive a treeish [20:47] smoser: it depends on what you want to do ... HEAD points to a commit, so it can't point to an uncommited state [20:47] and the yes [20:48] smoser: is there any reason you ca't just do a wip commit? [20:48] (which you might discard later) [20:49] how do you you reset to state before the commit ? [20:50] including 'git add' or other things. [20:51] ie, if i [20:51] touch foo [20:51] git add foo [20:52] git commit -a -m "that wip commit" [20:52] git reset HEAD^ [20:52] smoser: you can alwasy reset --hard to a commit [20:52] then i've lost the fact that 'foo' was added [20:52] smoser: and potentially do a `git clean -fxd` [20:52] smoser: no, it's still inn the commit you created [20:52] yeah, but the state of having been added is lost [20:52] smoser: i mean, i'm not sure i understand the use case, exactly [20:52] except for in that commit [20:55] smoser: oh you want to go back to an index state? [20:57] yeah, that was the goal. [20:57] basically i wanted to collect the tree up as it is right now. [20:57] wierd, i looked at 'git stash create' [20:57] this seems wrong: [20:57] echo "hi mom" > foo.txt [20:57] git add foo.txt [20:57] git stash create [20:57] the stash does not contain the new 'foo.txt' [20:58] oh wait. it does [21:00] powersj: smoser https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/333845 for the ci nightly errors [21:01] robjo: re v1 -> translate; I think at least for the immediate concern, matching the post-up "default gw" -> gateway: ought to get that working [21:01] smoser: i'm still trying to understad why you want the tree up to now? for a git-archive call? [21:02] rharper: ? [21:02] robjo: by my reading it goes config-drive -> openstack helper convert_network_data_json to v1 config -> v1 config gets rendered to eni, then the eni content get's passed to your class which calls net_util.translate() [21:03] OK, then I am on a wild goose chase [21:04] yes, the https://bugzilla.opensuse.org/attachment.cgi?id=749026 [21:04] shows the 2017-11-16 15:26:39,868 - opensuse.py[DEBUG]: Translated ubuntu style network settings # Converted from network_config for distro and then prints out the eni that got converted from v1 config [21:05] in distro base-class, it emits the Warning, thand then does a ns = network_state_parse_config(which is fed the v1 which was converted from the network-data json, you can see the v1 config earlyer in the log) [21:06] then in base distro, it does content = eni.network_state_to_eni() which makes an eni file; and passes that to the distro specify layer (self.apply_network() -> self._write_network()) [21:06] I am confused about where the openstack helper comes into play [21:06] converting the config drive network_data.json [21:06] when the Datasource is parsing it's input [21:10] robjo: cloud-init local runs to find the datasource, detects config-drive and runs the ConfigDrive datasource; in it, if there is a file network_data.json, it calls the helper to convert the json into v1 config and storages it in DataSource class property (network-config); then as cloud-init local continues, if the datasource has a 'network-config' property; it it's read and "rendered" [21:10] 2017-11-16 15:26:39,825 - stages.py[DEBUG]: applying net config names for {'version': 1, 'config': [{'subnets': [{u'routes': [{u'netmask': u'0.0.0.0', u'network': u'0.0.0.0', u'gateway': u'192.168.168.1'}], u'netmask': u'255.255.255.0', u'type': 'static', 'ipv4': True, 'address': u'192.168.168.30'}], 'mac_address': u'fa:16:3e:ee:2b:97', u'type': 'physical', 'name': 'eth0', u'mtu': 1500}]} [21:10] there you can see stages applying the v1 config that it got from the configdrive data source (after the network_data.json conversion) [21:11] yes, that very early part I ignored and I started with that data and where I think it would end up in the code [21:11] smoser: sorry for being dense if i'm missing something obvious [21:12] and as I noted in comment #32 in the bug gateway information is missing from the renedered intermediate format [21:14] right, that;s due to hoe the eni is rendered [21:14] the gateway is inside the post-up route add default gw [21:14] the net_util.translate does not know how to (yet) extract the gateway value from the eni contents [21:15] so, I believe in that net_util.translate, you can check if line has 'post-up' and 'default gw' strings [21:15] and extract out the ip addr in there and use that as the GATEWAY= value in sysconfig [21:16] you can see the v1 dictionary has 'gateway': 192.168.168.1 which matches the post-up line; post-up route add default gw 192.168.168.1 || true [21:18] OK I think I think I get how that part of the puzzle fits together [21:23] the network_data.json file may have other routes that are not default gateway ones, so there may be additional {pre,post}-{up,down} routes added which will also need converting to the sysconfig syntax; depending on how far you want to take the translator [21:26] well everything that is not "default gw" shoud really go into ifroute-IFACE [21:28] yes, I think so [21:28] we generally only had special handling for default gw, vs. route add -net