/srv/irclogs.ubuntu.com/2017/09/22/#cloud-init.txt

stl_Hi all, does anyone know why cloud-init in Ubuntu 16 makes static network interface configuration instead of dhcp like in Ubuntu 14? Thanks11:35
stl_Hi all, does anyone know why cloud-init in Ubuntu 16 makes static network interface configuration instead of dhcp like in Ubuntu 14? Thanks12:48
tellingI have both package_update and package_upgrade set to true in my cloud-config, now I expect it to update before it upgrades. But thats not the behaviour i'm seeing..Is this right?12:49
smoserstl_, in 16.04, it will render network configuration that came from the cloud provider13:06
smoserin 14.04, most likely you just got "dhcp on the first network device".13:06
smosertelling, package_upgrade implies package_update at least on ubuntu. can you share a config and where you're running this ?13:07
smoseralso /var/log/cloud-init.log would be useful if you can paste that.13:07
smoserpowersj, sorry, responding to your last night comment.13:08
smosertox in my mind is somewhat broken for c-i due to lxd having c (and just the pain in building that way)13:08
smoserwrt simplestreams, we can i think fix that. i have to check.13:09
stl_@smoser yes, that's correct. I figure it out from interfaces.d/50-cloud-init.cfg that whole configuration is created. I would like to have it like in Ubuntu 14 -> dhcp on interfaces. I have tried to specify dhcp for network interfaces (version 1 and also version 2) http://cloudinit.readthedocs.io/en/latest/topics/network-config.html#network-configuration-sources13:18
stl_@smoser i have upstream ubuntu images. Running OpenStack Ocata in our company13:19
stl_smoser: and my main problem with cloud-init in Ubuntu 16 is that I have two interfaces (two diferent subnet) and I am getting two default routes configured ny cloud-init. With dhcp OS will install only one default route (that's correct)13:24
smoserwell, its impossible to install 2 default routes.13:33
smoserso in 14.04, cloud-init woudl pick a interface via the hard coded name 'eth0'13:33
smoseractually, cloud-init didn't do that.13:33
smoseryour image had to already be configured to do that. cloud-init didn't do any networking.13:33
smoserso cloud-init in 14.04 completely ignored any information  your provider gave it.13:34
smoserin 16.04, it listens to the provider's desired network configuration and tries to apply it.13:34
smoserit is able to do that on OpenStack with ConfigDrive13:34
smoserit will fall back to "dhcp on eth0" like behavior on OpenStack if there is no config drive.13:35
smoserso, lets try to identify the problem with the routes13:35
smoserthen we can fix that and cloud-init will be working for you again (i think) in 16.0413:35
smoserthat make sense ?13:36
stl_i will share ip r and 50-cloud-init.cfg in a few minutes.13:36
smosercan you pastebin /var/log/cloud-init.log ? pastebinit /var/log/cloud-init.log13:36
stl_smoser: cloud-init.log https://pastebin.com/yBx8Nq14  ;  ip r output after boot https://ibb.co/k0E7g5  ;  /etc/network/interfaces.d/50-cloud-init.cfg https://ibb.co/h2v2EQ  As you can see two defaults defined by cloud-init. Both networks are usual OpenStack virtual networks. First network advertise route 172.16.20.0/24.  Thank you a lot!13:48
smoserstl_, you could have used 'pastebinit'13:53
smoser:)13:53
smoserliterally type: pastebinit /var/log/cloud-init.log :)13:53
stl_if i flush interfaces and run dhclient, then i get https://pastebin.com/Gh9kPdLx which is what i would expect. I have tried following cloud configs, but without success https://pastebin.com/7zb3tb1B13:54
stl_ok :) i will type13:54
stl_cloud-init.log http://paste.ubuntu.com/25592505/ :) sorry i didnt know about pastebinit13:55
smoserits a very useful command. it can paste to other pastebins, but uses ubuntu by default. ubuntu is ad-free which is nice, but requires you to log in to get "raw" download (to avoid abuse)14:00
smoseranyway... after that advertisement for pastebinit, i'm reading your pastes :)14:00
smoserstl_, would you be able to get me the network_data.json file that is on the attached config drive ?14:01
smosercloud-inti doesnt log it, just what it converted it to.14:01
stl_smoser: sure, could you please navigate me where it is stored?14:02
smoserstl_, wow. i actuall thought that kernel/ip would fail if you tried to write two default routes (as in 'route exists')14:03
smoserhm..14:03
smoserhm... so there is a disk attached.14:03
smoserrun14:03
smosermount /dev/disk/by-label/config-v2 /mnt14:03
smosermaybe..14:03
rharpersmoser:  while it's not in json format, looking at the v1 is easy enough to see: http://paste.ubuntu.com/25592551/14:04
smoserrharper, yeah, but i wanted to get the real thing14:04
rharperthere are two nics, each one has a cateway, both are set as "Default"14:04
rharpergateway14:04
smoserin case we did a bad job converting14:04
rharperthat's fair14:04
smoseri really thought you coudl'nt do 'ip route add default' more than once14:05
smoserso https://ibb.co/k0E7g5 confused me :)14:05
rharperwe render eni here, though14:05
rharperwe have |: in those post-ups to deal with the artibrary order of the hook scripts14:05
rharperinteresting14:06
smoserrharper, yeah, but his 'ip r' shows them14:06
rharperwell, maybe ip let's you shoot your self in the foot14:06
smoseri didnt think the kernel would let you14:06
smoserie, i thought 'route exists'14:06
rharperit's just a table14:06
rharperthat's not the kernel, that's the tool saying that14:07
smoseri thought ip tried to add a route to table and got error14:07
smoserthus "kernel"14:07
smoseranyway.14:07
smoserstl_, we really need the original network_data.json14:07
rharperI think we can get it from the obj.pkl; lemme see on an openstack instance14:08
smoserand if it says that both of those nics should contain the "default" route, then .... we're doing as close to what we we were told to do, and we'll probably need to file a bug in openstack.14:08
smoserwell, it shoudl be easily mountable too though. stl_ my 'mount' command above work ?14:08
rharpery14:08
smoserrharper, in your pasted config..14:09
smoserwe could have make a hueristic decision there14:09
smoseras the first had a default route *and* a netmak'd route14:09
stl_smoser: here's paste http://paste.ubuntu.com/25592580/ it's from configdrive openstack/latest/network_data.json14:09
smoseroh wierd. but that .2014:10
smoserwierd14:10
smoserstl_, tyats what we needed. thanks14:10
stl_smoser: great! thank you14:10
rharpersmoser: heh14:12
rharperwe just copy in the routes provided14:12
smoserhttp://paste.ubuntu.com/25592599/14:13
smoser^ is just prettier formated of stl's paste.14:13
rharperI'm not sure at conversion time we can make a choice;   I suspect the second network/nic need not have a gateway, but we don't know how the subnet in neutron was configured14:13
smoseryeah. it is buggy.14:14
smoseropenstack is.14:14
smoserthey tell us there are two networks and give a default route on both. there isnt really a way to pick.14:15
smoserhm..14:15
smoserstl_, do you have access to the hypervisor ?14:15
stl_smoser: yes I have14:16
smoserit'd be good for you to file a bug with 'ubuntu-bug nova-compute'14:16
smoserand then i can fill in some othoer info14:16
smoseryou open it, and then i'll fill in the rest.14:16
smoserbut basically they're giving us incomplete information14:16
smosercloud-init is doing what they said to do :)14:17
smoserstl_, interstingly i think that if you ran dhclient on boht of those interfaces, you'd probably only get one route as default14:17
smoserand that would be random based on which got done first14:17
stl_actualy our hypervisors don't have access to Internet if 'ubuntu-bug nova-compute' is Ubuntu command14:17
smoserunless they have that path somehow fixed and one of the dhcp servers would *not* give you that default route14:18
smoserstl_, it is a command. it'd just collect some info on versions and things.14:18
stl_smoser: yes, if i run dhclient i will get default only from second interfaces (that's what i want)14:18
smoser"second"14:18
smoseras in "second that your run" ? or as in "always network1"14:19
smoserstl_, i'm kind of curious to see that. if you ran 'dhclient eth0' and 'dhclient eth1' and got the leases and the output of each. i'd be interested to see.14:20
stl_smoser: I was always runing just "sudo dhclient"14:21
stl_but i can try dhclient ens3 and then dhclient ens414:21
smoserstl_, you have a launchpad id ?14:21
smoseri'll copy you on the bug.14:21
smoserstl_, if you wanted... dhclient -v14:22
smoserwoudl be sufficient14:22
smoserthe grab the /var/lib/dhcp/dhclient.leases file14:22
stl_smoser: https://ibb.co/bWHA15 got same default. Looks like if no route is advertised then default is installed.14:25
stl_smoser: I have launchpad account14:25
smoserstl_, i suspect that one of the two dhcp servers advertised a default route14:30
smosercould you14:30
smoser dhclient -r14:30
smoserthen14:30
smoserdhclient -v14:31
smoserand then get /var/lib/dhcp/dhclient.leases ?14:31
stl_sure14:31
stl_console, dhclient -r, dhclient -v https://ibb.co/mZYTok  here's dhclient.leases http://paste.ubuntu.com/25592685/14:34
fricklerthere is a bug against neutron that wants to allow not having a default route for networks: https://bugs.launchpad.net/neutron/+bug/171756014:40
ubot5Ubuntu bug 1717560 in neutron "allow to have no default route in DHCP host routes" [Undecided,New]14:40
rharperinteresting14:40
fricklerstl_: not sure if I missed that in the scrollback, could you also pastebin the output of "openstack network/subnet show" for your (sub)networks?14:41
stl_frickler: will do14:42
rharpersmoser: looking at the leases, only ens4 has 'routers' option;  and there is 'classless-static-routes' for both;  I'm not sure how those relate to  setting routes on the system, but I wouldn't expose those to become a default route14:42
smoserfrickler, ! welcome . i was trying to think of who i knew that had some openstack networking chops14:42
smoserand he stepped right into the room!14:42
* rharper is awed by the summoning powers of smoser 14:43
fricklersmoser: been lurking here for long :D14:43
fricklerjust took a view after seeing stl_'s question over in #openstack ;)14:44
smoseroh. ok. i'm opening a bug.14:44
frickleralso about to leave for the weekend, but I hope I can take another look later14:44
smoserit does appear from his dhclient leases that the servers "know"14:44
smoserfrickler, you leave work to early (and i'm not accepting any excuse that includes the word 'timezone')14:45
smoser:)14:45
stl_here's openstack network and subnet pastes http://paste.ubuntu.com/25592742/14:46
stl_smoser: if you need i can open bug on launchpad14:48
smoserhttps://bugs.launchpad.net/nova/+bug/171895414:51
ubot5Ubuntu bug 1718954 in OpenStack Compute (nova) "network_data.json contains default routes for 2 interfaces" [Undecided,New]14:51
stl_thanks!14:51
smoserstl_, who are you there?14:56
smoserLukas or Dr. Jens ?14:56
stl_smoser: Lukas :)14:57
smoserstl_, if you're looking for a hack / workaround14:57
smoserthe easiest thing is probably to just delete the route14:57
smoserip route delete ...14:58
smoserof the bad one14:58
stl_smoser: yes, that's something i have came up also. I was hoping that cloud-config will work (set interfaces to dhcp), but no success from my side.14:59
smoserstl_, well, you can't really affect networking confguration in user-data15:01
smoserits just kind of "too late"15:01
stl_:)15:02
smoserstl_, you could provide some script to run that would re-write it, so it'd be fixed on reboot15:04
smoserbut you could just as well add a post ifup.d15:04
smoserthat took out that default route15:04
stl_thanks for help and that bug report! Have a nice weekend.15:08
kszarlejhi guys. I have that configuration for NoCloud drive. It is used for my LibVirt KVM VMs. The mount (vdb) is not mounted. The device is available at /dev/sdb and in /etc/cloud/cloud.cfg the mounts module is listed in init modules. There is no error in logs. Any suggestions?15:09
kszarlejoh the configuration is here, forgot the link http://paste.ubuntu.com/25592915/15:09
kszarlejthe /data directory actually doesnt exist when booting but I assume that cloud-init should create it? (Creating it using runcmd is pointless as it runs after the mounts module)15:12
powersjkszarlej: can you please look the two lcoud-init logs under: /var/log/cloud-init*15:44
powersjsmoser: rharper: https://bugs.launchpad.net/cloud-init/+bug/1718959 looks like this guy ran into an odd unicode character. Is there a good suggestion to help him debug his user-config?15:44
ubot5Ubuntu bug 1718959 in cloud-init "user-data ignored in DataSourceNoCloud" [Undecided,New]15:44
kszarlejpowersj: found that15:46
kszarlejhttp://paste.ubuntu.com/25593105/15:46
kszarlejin cloud-init.log15:46
kszarlejlooks like the ci cant see the mount I have in config15:47
kszarlejbtw I use centos and a daily build from cloud init devel repo (because the upstream from centos repos is broken :P)15:49
kszarlejrest of the stuff specified in meta-data was configured fine15:54
powersjkszarlej: was the daily build from: https://copr.fedorainfracloud.org/coprs/g/cloud-init/cloud-init-dev/15:58
kszarlejyes16:00
kszarlejthe one that is in centos 7 repos16:00
kszarlejwas unable to set the networking16:00
kszarlejbeen consulting that yesterday evening here :P16:00
powersjkszarlej: If you could, can you file a bug please.16:01
blackboxswI can't wait for us to get 17.1 into xenial so we can have  "ubuntu file-bug cloud-init".16:10
blackboxswit works currently on artful16:11
blackboxswI mean ubunt-bug cloud-init16:11
blackboxswI mean ubuntu-bug cloud-init16:11
blackboxswthird time's the charm16:11
=== blackboxsw changed the topic of #cloud-init to: is Reviews: http://bit.ly/ci-reviews | Meeting minutes: https://goo.gl/mrHdaj | Next status meeting: Monday 10/2 14:00 UTC | cloud-init 17.1 released (artful)
=== blackboxsw changed the topic of #cloud-init to: is Reviews: http://bit.ly/ci-reviews | Meeting minutes: https://goo.gl/mrHdaj | Next status meeting: Monday 10/2 14:00 UTC | cloud-init 17.1 released
blackboxswI know that won't help us on centos, but it's a fun improvement for ubuntu16:13
blackboxswkszarlej: you can run cloud-init collect-logs to collect a tarfile of logs that can be attached to the bug16:14
blackboxswor even 'cloud-init collect-logs --include-userdata16:16
smoserblackboxsw, well, kszarlej is using trunk16:28
smoserso he can16:28
blackboxswtrunk centos  right?16:28
smosertrunk on centos16:28
smoser(copr build)16:28
blackboxswhe can "collect-logs --include-userdata" :)16:28
smoserright16:29
smoserah. ubuntu-bug . i see . you were saying that wont work there.16:29
smoserwhich is treu16:29
smosertrue even16:29
blackboxswglad someone has has a case of typos this morning16:29
smoserkszarlej, is that you -> https://bugs.launchpad.net/cloud-init/+bug/1718959 ?16:32
ubot5Ubuntu bug 1718959 in cloud-init "user-data ignored in DataSourceNoCloud" [Undecided,New]16:32
powersjsmoser: if you make a request of someone can you mark the bug incomplete?16:33
dpb1yes16:35
dpb1absolutely16:35
kszarlejsmoser: no16:35
kszarlejI didnt create the bug yet16:35
kszarlejtrying to make a workaround first16:35
kszarlejneed to have that working today16:35
dpb1powersj: there is room for judgement if the request isn't material to the working on the bug, but normally, you don't want to action a bug with incomplete information.16:36
powersjdpb1: agreed: I just like to see new bugs that we respond to either moved to incomplete, invalid, or confirmed.16:37
kszarlejok now I lost my mind16:37
smoserdone16:38
dpb1powersj: yes, it's a sane policy that we should try to stick to.  (or wont fix)16:38
kszarlejhttp://paste.ubuntu.com/25593417/ and in log: 2017-09-22 16:32:00,901 - cc_runcmd.py[DEBUG]: Skipping module named runcmd, no 'runcmd' key in configuration16:38
=== robjo is now known as robjo_away
ajorggah. why haven't I prepared https://git.launchpad.net/~ajorgens/cloud-init/commit/?id=aaa626dd8aecc078210d3a48ff39faf3fd30cbdc for merging yet. It seemed pretty important when I wrote it!16:44
blackboxswit's that "day job" thing... it just keeps getting in the way of good fun16:46
ajorgseriously16:46
cesarjorge_Hi16:54
cesarjorge_I need help with cloud-init in an OS image of Centos 7.4 that I build16:56
ajorgcesarjorge_: best to cut right to the chase and describe the problem you ran into16:57
cesarjorge_I need to create this image to working without extra changes in the cloud or not cloud environments:16:58
cesarjorge_I need that my image instantiate correctly if I launch it, for example, inside OpenStack, or, as a simple instance in local, I have virtualbox17:00
cesarjorge_Then, if I launch the image in OpenStack, works correctly. But if launch the image in virtualbox (as a simple instance), the cloud-init does:17:01
cesarjorge_Break my configured specific user with password, and takes many time to start17:02
cesarjorge_And does other things17:03
cesarjorge_Then, I need create a image that, if not launched in cloud, then do nothing and not interfere. If launch in a cloud, then execute as normal17:04
cesarjorge_How can I do it?17:16
blackboxswok schema suggestion for https://code.launchpad.net/~rjschwei/cloud-init/+git/cloud-init/+merge/331149 added robjo_away17:17
ajorgcesarjorge_: you've tried, and it doesn't work? Or you're assuming it won't work?17:18
ajorgIIRC for VirtualBox cloud-init will try to use the NoCloud data source: https://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html17:20
smosercesarjorge_, ajorg is right. cloud-init goes looking for a "datasource". and if it doesnt find one can be kind of annoying. you can provide it one in virtualbox.17:20
smoseryou can configure the datasource_list in the image to only consider OpenStack (or ConfigDrive) and NoCloud17:22
smoserthen it wont end up polling for the ec2 metadata service17:22
cesarjorge_I have try, but dont work. Using datasources will work?17:22
smoserand will fallback to the None datasource faster.17:22
smoserwell, "don't work" isnt much information.17:23
smoserNoCloud will work in virtualbox for sure.17:23
smoserhttps://asciinema.org/a/13201317:23
smosertheres a ubuntu cloud image demo of doing this in qemu-system-x86_64 but the same basic thing will work on virtualbox.17:24
ajorg"Break my configured specific user with password" you can probably configure it not to do, with a NoCloud source. "takes many time to start" sounds mysterious17:24
ajorghttps://cloudinit.readthedocs.io/en/latest/topics/modules.html#users-and-groups17:25
cesarjorge_Then, I configure datasource_list: [ NoCloud ] ?17:25
cesarjorge_In file cloud.cfg?17:25
ajorgoh, you probably mean it take *much* time to start. That's fixed by limiting it to the data sources you know it might use, as smoser said.17:25
smoserwell, if you want it to work on penstack you'll need to put either ConfigDrive or OpenStack in there.17:26
smoser(ajorg, i assume he's polling for the ec2 metadata service is what takes long)17:26
ajorgsmoser: I thought that was fixed by checking the system uuid?17:27
smoserhm...... yeah.17:27
ajorgbut if he's on CentOS he's got an older version, probably. CentOS and RHEL are not aligned for cloud-init last I checked.17:27
smoseryou're right.17:27
smoseryeah17:28
cesarjorge_Version 0.7.9 for centos 7.417:28
ajorgOh, maybe they fixed that. They used to be on 0.7.5.17:29
ajorgI assume it checks for lots of other clouds though, and any of those takes time?17:30
cesarjorge_I just tried using a image with line datasource_list: [ OpenStack ]. Inside virtualbox works good. But inside OpenStack fail17:31
cesarjorge_Only if I boot the image without using no cloud task. Simply starting VM17:32
cesarjorge_Question: What tasks does the None datasource do?17:37
cesarjorge_This datasource is executed if no find any?17:38
ajorghttps://cloudinit.readthedocs.io/en/latest/topics/datasources/fallback.html17:41
smosernone datasource doesnt do much. yes. basically generates ssh keys. will probably add the default user. and might lock its password (you could change that in config)17:43
smoserfrickler, just for your later reference17:45
smoser https://bugs.launchpad.net/nova/+bug/171895417:45
ubot5Ubuntu bug 1718954 in OpenStack Compute (nova) "network_data.json contains default routes for 2 interfaces" [Undecided,New]17:45
cesarjorge_If I lock password, in config, then when I launch in openstack not work with ssh keys17:46
smoser?17:46
smoserif you want a user that is already in the image and will always be accessible, just create one.  you can put ssh keys in it or not and set a password or not. cloud-init will not make any changes to that user.17:47
smosername it 'superdude' or something.17:48
cesarjorge_If I launck in openstack, cloud-init modify the file /etc/ssh/sshd_config removing all passwordauthetication yes17:51
cesarjorge_For all users17:52
cesarjorge_If insert a specific line Match ssh user passwordauthentication no, then, does same thing, remove this line17:53
smoseri'm going to go through fix-commnitted bugs now and mark fix-released for all in 17.117:58
smosercesarjorge_, you can set that.17:59
smoseri am not aware of ssh user passwordauthentication. you're saying that  is a sshd_config setting that you can set per-user stuff ? i didnt know and tis quite possible that cloud-init gets confused by that.17:59
smoseryou can tell cloud-init to either always enable password auth or not mess with it.18:00
smoserssh_pwauth: <yes/no/unchanged>18:00
cesarjorge_In summary: I try to use same image for a cloud environment or isolate environment. In cloud environment I use cloud-init with ssh keys. In my isolate environment, i use one user with password, dont need the work for configurate extra things. Then, when the image works in cloud, dont work in isolate environment, and backwards18:00
cesarjorge_The result in isolate env when I do ssh: no authentication method available, because cloud-init change this passwordauthentication in sshd config18:04
cesarjorge_But, for openstack, I need this variable to do ssh public key for all users18:05
cesarjorge_I can configure virtualbox for use ssh public key, but complicate the configuration for users than only need work with an isolate VM, using passwords, without extra configuration18:09
smosercesarjorge_, so you'd like for it to leave password authentication unchanged when running on a cloud18:15
smoserbut turn it off when running local18:15
smoserer.. leave unchanged (off) when running on a cloud. but when run locally enable it.18:16
smoseryou can kind of do this i think if you backed config for NoCloud into the image that had its own config there.18:17
cesarjorge_Passwordauthentication no, when cloud, passwordauthentication unchanged when no cloud18:17
smoserwait.18:17
smoserright18:17
cesarjorge_Or, better, not execute nothing nothing if no cloud18:17
smoseryeah. so you could do this by provding inside the image NoCloud config that would end up getting always found (in the event that it was not on a cloud)18:17
cesarjorge_Better write: not change nothing in the instance if no cloud18:18
smoseri think what you want is mostly how Ubuntu in 17.04 and later is set to work18:19
smoserif cloud-init finds its not in a cloud, it disables itself entirely.18:19
smoserso it should be acheivable with centos too. but i'm not sure how well the systemd-generator stuff is integrated tehre.18:20
smosercesarjorge_, i'm sorry, i can't spend any more time on this now.  i think what you're after is either doable or not far off.18:21
cesarjorge_Workaround for centos? The RH/centos take a lot of tima in upgrade official versions18:21
smosercesarjorge_, you definitely need newer cloud-init. from trunk-ish18:22
smoserwe have copr builds18:23
smoser https://copr.fedorainfracloud.org/coprs/g/cloud-init/cloud-init-dev/18:23
smoserthose are of trunk18:23
cesarjorge_Thanks, I will try this trunk version. If you encounter a workaround for 0.7.9,, i would be grateful18:25
=== robjo_away is now known as robjo
robjoblackboxsw: thanks18:51
blackboxswnp robjo18:52
robjoon the schema, I guess the basic question would be do we want to validate everything18:52
robjothat would imply  that yes we'd have to document everything at https://en.opensuse.org/openSUSE:Standards_RepoInfo18:53
robjobut that appears overkill to me18:53
robjoand of course total duplication18:53
robjoblackboxsw: ^^^^^18:55
blackboxswrobjo: yeah it also forces you into a high-maintenance world where cloud-init was out of date as format moves on18:55
robjoyes, thus it would be much nicer if the validation can somehow throw up it's hands and say "Ok, I know you need "baseurl" for everything else I don't care"18:56
robjois that an option?18:57
blackboxswas you saw with the config example, the permissive approach would be the following:                 'config': {18:57
blackboxsw                    'type': 'object',18:57
blackboxsw                    'description': 'Any supported zypo.conf key is written to /etc/zypp/zypp.conf'18:57
blackboxsw                }18:57
blackboxswyeah per the repos structure it could be the following if all you care about is baseurl18:57
blackboxswone sec, will paste18:57
robjoAnd then the "id" is required becauase we cannot validate "any_random_name:" right?18:59
blackboxswhttp://pastebin.ubuntu.com/25594124/18:59
blackboxswyeah like this robjo18:59
blackboxswyeah otherwise jsonschema can't describe the subschema under <any_random_name>: {...}19:00
blackboxswI will take an action as I keep adding more schema though to see if there is a sensible way to describe that in jsonschema19:01
blackboxswand if so, to send a patch and ping you... admitedly I'm still a newbie at jsonschema19:01
robjoWell we need multiple ids though such that a user can add as many repos as they want19:02
robjoso repos is really repos :{ [id, baseurl,....],[id baseurl,...],[id, baseurl,....]}19:03
robjoI am OK with calling it id, as this is an incompatible change we just need to nail it down and then leave it, whatever it is19:04
robjoSo how do we express the list behavior?19:05
blackboxswrobjo: oops type in the schema.. one fixing the paste19:06
blackboxswwill account for that19:06
robjoand what does it look like in yaml?19:06
ajorgrobjo: I'm missing some context (sorry for jumping in here). What are you working on?19:10
robjoTrying to figure out what the repo definition shoud look like, https://code.launchpad.net/~rjschwei/cloud-init/+git/cloud-init/+merge/33114919:11
blackboxswhttp://paste.ubuntu.com/25594201/19:13
blackboxswok I'm looking over the following ^ as a potential it defines repos as a list w/ min items 119:13
blackboxswand declares that each item must have baseurl and id in it.19:13
blackboxswother attributes are allowed19:13
ajorgrobjo: interesting. I thought the spec was identical for zypp and for yum?19:15
ajorgjust the file location was different?19:15
robjoblackboxsw: that works for the schema I don't think this can be expresed in yaml19:16
robjoajorg: the repo description is different, and there is the desire to change things, i.e. th ecurrent implementation for RHEl is not what we want to do19:17
ajorgokay, cool19:17
robjoblackboxsw: That works for schema validation, but cannot be expressed in YAML, I think19:18
ajorgreminds me i have a patch that helps make sure yum config is correct, but it's currently buried in another patch, need to tease that out19:18
blackboxswrobjo: drawing up an example and testing w/ your branch19:18
robjoThe point of the <arbitrary_name>: is to give yaml a separator and each is unique thus the result is a dict with {arbitrary_name1:{....], arbitrary_name2:{....}}19:20
robjobut if we say items: then there's no way to differentiate for the yaml parser and the result is undetermined19:21
blackboxswrobjo: like this? http://pastebin.ubuntu.com/25594260/19:22
blackboxswcan't your module validate 'id' on each object is unique?19:23
blackboxswor this http://pastebin.ubuntu.com/25594275/19:25
robjoyaml bitches at that, looking at the error19:25
blackboxswhmm here's on my side http://pastebin.ubuntu.com/25594296/19:28
robjoyes, without the {} I got it to work as well19:29
blackboxswahh checking the {} again to see if I can get that working19:29
robjoBut that works, so I'll run with that19:30
blackboxswrobjo: yeah less characters than the other way19:32
blackboxswhere's the other http://pastebin.ubuntu.com/25594320/19:32
blackboxswhad to fix a bunch19:32
robjoThanks, I like the - better I'll use that as example ;)19:34
blackboxswI'm still trying to get the suggestion for your schema to work... I iterate w/ python3 -m 'cloudinit.cmd.main devel schema --doc' and ... devel schema -c <sample-cloud-config>19:34
blackboxswand initial patch  for schema http://paste.ubuntu.com/25594361/19:40
blackboxswrobjo: ^19:41
blackboxswyou'll also need to git fetch; and get rebase origin master as we put in a docs fix related to schema yesterday19:41
blackboxswthat helps rendering19:41
robjoblackboxsw: great thanks, I'll get that included and hopefully will get the test written yet his afternoon, for another full review19:42
blackboxsw+119:42
robjonext week is SUSECon I'll have little to no time....19:42
blackboxswI'd imagine, we're heading for a sprint next week too so response times may be slow19:43
smoserblackboxsw, welll.. comments on https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/33011519:44
smoserrobjo, i think my invitation to SUSECon got lost in the mail.19:44
robjosmoser: and Prague is such a nice place19:45
smoseryeah.19:45
smoserblackboxsw, i commented on your json file stuff19:47
blackboxswthanks smoser will look at what we think should be done there19:48
blackboxswsmoser: good points, yeah I stopped work on this when we were trying to get 17.1 stuff in. Forgot that I didn't get back to work out the standardized top-level keys vs datasource blobs20:01
blackboxswI had debated about iterating on standard/nornmalized metadata keys in instance-data.json on a followup branch. But, I guess we can implement low-hanging fruit in this branch. The problem with normalized/general keys is that we may have to have a ds.normalized_metadata  function that each datasource may have to implement to surface the common named keys if they don't already have it in meta/user-data20:06
smoseragreed20:09
robjohow do I run just one test? while I am working on the tests for zypper_add_repo I do not really want to run the whole test suite over and over again20:19
robjoand next question how do I populate the tmp location with a file that can be read by a test?20:20
smoserrobjo, fastest thing is to use ./tools/tox-venv20:25
smoser$ ./tools/tox-venv py3 python3 -m nose tests/unittests/test_util.py20:25
smoserif you just want to run your tests and dont want to use tox-venv or it didnt work for you20:25
smoser$ tox -e py3 tests/unittests/test_util.py20:25
smosertox-venv skips the "install" phase which is slow.20:26
smoserto populate a tmp location...20:26
smoserprobably easiest is, if youre subclass of CiTestCase20:26
smoser tmp = self.tmp_dir()20:26
robjoright now, i.e. in the pending MR it is: class TestConfig(helpers.FilesystemMockingTestCase):20:27
smoser helpers.populate_dir(tmp, {'etc/passwd': content_for_that, 'usr/file1': more_stuff})20:27
robjogreat, thanks20:28
smoseryou want to do the populating before you patchUtils()20:28
smoseror it gets in the way20:28
smosererr... rather than patchUtils20:29
smoserprobably patch.reRoot() is what youw ant20:29
smoserbut do your pouplation of things *before* that20:29
blackboxswmeh all systemd dhcp lease parsing content/handlers are defined in internal header files.20:46
blackboxswprivate dhcp options are parsed and added to internal lease objects20:47
blackboxswbut I don't yet see a path to expose that content20:47
blackboxswFilesystemMockingTestCase subclasses from CiTestCase so self.tmp_dir() tmp_path are available there too20:49
blackboxswhrm per systemd: sd_dhcp_client_get_lease might be what I want20:51
robjosmoser: is there already a utility function in the test infrastructure to confirm that warning messages get written or do I need to do that via @patch?21:17
blackboxswsmoser: rharper  :) http://pastebin.ubuntu.com/25594875/21:25
blackboxswI think we can get to systemd custom dhcp options21:25
blackboxswbusctl FTW21:25
blackboxswchecking other instance types21:26
rharperblackboxsw: whoa21:26
rharperbusctl needs a --json *so* bad21:27
rharperI've not looked at it yet, but there is python systemd module21:27
rharpermaybe there's some easy access to the systemd dbus21:28
blackboxswyeah it's nasty21:28
blackboxswwith custom types etc21:28
rharperoh, that's NetworkManager21:29
rharperorg.freedesktop.systemd121:30
blackboxswyeah unfortunately /org/freedesktop/network1 gives us nothing of use. it describes the systemd network files used, but nothing as far as dhcp or network related config settings21:59
smoserblackboxsw, but that comes from networkmanager22:46
smosernot systemd22:47
smosersystemd-netwokrd22:47
blackboxswyeah, looking at extending systemd-networkd to expose options22:47
blackboxswyeah, looking at extending systemd-networkd to expose dhcp-options22:47
blackboxswjust like NetworkManager does. it's a bit of a lift.... and my C is rusty22:47
smoserhoray for change for the sake of change!22:47
blackboxswheh22:47
smoserwe'd all be out of work otherwise.22:47
smoserwhat would i have accomplished from 14.04 to 16.04 if not for systemd.22:48
smosernothing22:48
blackboxswheh22:48
blackboxswgotta stir up some dinner22:48
blackboxswhave  a good weekend folks22:48
robjosmoser: https://code.launchpad.net/~rjschwei/cloud-init/+git/cloud-init/+merge/331149 ready for another review.22:54
robjoHave a nice weekend everyone22:54

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