/srv/irclogs.ubuntu.com/2017/07/13/#cloud-init.txt

nilujesmoser: do you think my updates are okay?09:01
WulfHi, is there any way to rename network interface in ubuntu 16.04 on AWS back to eth0?10:30
ragechinWulf: cloud-init 0.7.9?13:04
ragechinWulf: PM me plz. I don't think it's a cloud-init issue13:04
smoserniluje, i'll take a look now. i'm sorry.15:11
nilujesorry to be oppressive :x15:12
smoserniluje, no worries.15:14
smoserblackboxsw, can you confirm that15:14
smoser 4d9f24f5c385cb7fa21d87a097ccd9a297613a7515:14
smoseris broken in the same way as15:14
smoser https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/32732515:14
smoserwas ? that path is just plain wrong?15:14
smoserWulf, https://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames/15:15
smosersee15:15
smoser I don't like this, how do I disable this?15:15
smoserniluje, you kind of have 3 unit tests in one15:18
blackboxswsmoser: checking15:18
nilujesmoser: I can split them, but usually I prefer to test a feature in a single test rather than split it into smaller tests15:19
smoserwell, but you're really testing 3 different things.15:21
nilujebecause split means having more tests, which take more time to run, and 99.9% of the time it doesn't make sense to test only a function when it works (for instance) and not when it fails15:21
smosera.) valid API / expected working case.15:21
smoserb.) no user-data and vendor-data15:21
smoserc.) local port retry15:21
smoserblackboxsw, i'd also like your opninon on the use of HTTPConnection (via requests.packages.urllib3.connection) in niluje's MP15:22
smoser https://code.launchpad.net/%7Ejcastets/cloud-init/+git/cloud-init/+merge/325740/+index15:22
nilujesmoser: so you want me to split the unittests then?15:22
niluje(won't do before monday)15:22
smoserblackboxsw, . your thoughts on ^ too ? i think generally we do want them to be more granular15:23
larskssmoser: possible 0.7.6 to 0.7.9 regression when using a config drive with a static network config; curious about your opinion: if after initial boot a config drive goes away, it looks like 0.7.6 will retain the network config while 0.7.9 will panic and replace the static network config with a dhcp config from the fallback data source.15:24
smoserlarsks, the config drive metadata service's check_instance_id() should end up saying that the cached object in /var/lib/cloud/instance/obj.pkl is still valid.15:27
niluje                                                                              │ logan-15:27
nilujeoops15:27
larskssmoser:  Looks like not, but I will check.  It looks like with 0.7.6, cloud-init.service simply fails when there is no data source, so -config and -final never run.15:28
larsksLet me take a closer look at my 0.7.9 setup.15:28
smoserlarsks, is this opssibly related to ovirt ?15:28
smoseror is it really openstack15:28
larsksNot openstack.  Right now, I'm testing locally with libvirt + config drive.15:29
smoser(ovirt uses config drive, and i think doesn't set the dmi data to the instance id, which woudl make that fail)15:29
larsksBut I think the original problem is in RHEV, which I think means ovirt.15:29
nilujei think generally we do want them to be more granular -> again I'll follow your recommendations, but for my personal projects I really feel being granular is cleaner, but it's often a pain to do (you need to do the test setup more than once) and doesn't actually help to test the code better15:29
nilujebut let me know :)15:29
blackboxswniluje: smoser yes please on the separation/simplification of unit tests to simply assert 1 or 2 things instead of compound set of assertions. We want each unit test to be representative of a single "thing" that it is testing, which makes for easier error tracking/resolution when the test fails in the future15:29
smoserright. i think that is quite likely broken, but i'm not really sure how it would work previously.15:30
nilujeokay15:30
smoserlarsks, and i'm not sure how to make it work.15:30
nilujeblackboxsw: will do, thanks :)15:30
blackboxswI think we (cloud-init) should pull together a doc on unit test writing just to capture general intent/approach/style etc.15:30
smoserhm..15:30
blackboxswthanks niluje, sorry if it feels a bit pedantic15:30
larskssmoser: the bahvior in 0.7.6 seems fine (fail if no data source).  Why does 0.7.9 try to continue in that case?  Is there a way to disable the fallback datasource?15:31
blackboxswprobably need a little addendum to the HACKING doc on cloudinit.readthedocs.io15:31
larsksIf not, should there be an option to do that?15:31
smoserthis path where it correctly identifies its the same instance id will only work on intel (as it uses dmi data, and although arm64 in theory could do dmi practice and kvm are different)15:31
nilujeif there's something else I'll fix it on monday morning, hoping we can merge the MR soon :)15:31
blackboxsw+1 niluje I'll put some eyes on the branch too today to see if I can make more concise comments15:32
smoserlarsks, it re-writes netowrk data on 0.7.9 as it doesn't know that it is not a new instance, so it goes the path of "do a dhcp on eth0 so the network datasources can find network metadata"15:32
nilujeblackboxsw: if you are interested in having a node to do some testing, I can give you access to one15:33
nilujesmoser: same15:33
larsksRight, I understand that.  But is there any way to disable that behavior if so desired?15:33
larsksThe problem is not just that it does a dhcp, but that it is actually writing a new network configuration to disk.15:33
smoserlarsks, right. but at the point where there is no config drive it can only really think that this is a new instance, or it has been snapshotted and moved to another cloud....15:38
smoserits looking for a metadata source.15:38
larsksNo, I get that.  I am just arguing that it shouldn't be writing configs if ultimately it doesn't find a valid datasource.15:39
larsksBut I understand what you're saying.  I am trying to figure out if this whole "config drive goes away" thing is standard RHEV behavior...15:40
larsks...because if it's not, "don't do that" seems like the quickest fix.15:40
smoseryou can configure "manual_cache_clean" to true15:40
smoseryeah..15:40
smoserlarsks,  so right now blackboxsw is working on moving the ec2 datasource to run at "local" time.15:41
smoserif we replaced all network-time datasources to run at local, then we could essentially decide failure at the local time frame.15:42
smoserand leave the networking in place15:42
smoserthe path would still result in cloud-init considering that a failure though15:42
smoseras it would not have found a datasource (as there is none, and the previous one is not found to be valid)15:42
larskssmoser: I wish that there was a shorter term fix when no network datasources are enabled (e.g., when datasource_list is [ConfigDrive, NoCloud]).15:45
smoserlarsks, well, 2 fixes to the platform15:52
smosera.) match the dmi data to the instance id15:52
smoserb.) do not detach the drive ever15:52
smoserboth of these things qualify as "act more like the platform that you're imitating"15:53
smoserlarsks, i do agree it sucks. several months ago someone had pointed this out to me, and that was when i asked you what you knew of ovirt15:54
smoseri considered raising an issue there.15:54
smoserjust kind of ran out of time/motivation15:54
smoser:-(15:54
smoserlarsks, if there is other unice id in dmi information on that platform, we could adjust the check_instance_id() to have stored that bit too and ccompare that it is not new15:56
larskssmoser: which dmi field are we checking?15:57
smoserand another option that might make sense would be to allow vendor_data to declare manual_cache_clean15:58
smoserif the cached obj.plk had manual_cache_clean=True, then we could trust it15:58
smoser(rather than requiring that to come from system config)15:58
smoserthe field looked at is system-uuid15:58
smoseri do recall that they had a unique id somewhere in their dmi data15:59
larsksThanks. Let me look into that a bit.16:00
blackboxswsmoser: that 4d9f24f5c385cb7fa21d87a097ccd9a297613a75 is a completely different failure on my end than what was fixes in my gce mock branch. I'm seeing a magic number traceback in 4d9f24f5c385cb7fa21d87a097ccd9a297613a75. Will peek at that (as well as getting my gce-mock-fix branch pushed)16:02
blackboxswhmm PEBKAC. issue was on my side with a stale pyc file. checking now.16:03
smoser:)16:09
blackboxswsmoser: same failure mode which the branch I have fixes.16:09
smoseryou see failure ?16:10
smoserbecause i do not16:10
smoser(and neither does c-i)16:10
blackboxswsmoser: not a failure, I add a pdb here16:10
blackboxswhttps://www.irccloud.com/pastebin/pP1aE6ZT/16:10
blackboxsw.tox/py3/bin/python3 -m nose --tests tests/unittests/test_datasource/test_gce.py:TestDataSourceGCE.test_get_data_returns_false_if_not_on_gce -x -s16:10
blackboxswand this tox line gets to that pdb which it shouldn't16:10
blackboxswbecause platform_reports_gce should be mocked to return False in that case16:11
smoser(fwiw, i dont think its valid to call python3 like that... you wont get the virtualenv installed things)16:11
smoser(that is what ./tools/tox-venv does. ./tools/tox-venv py3 python3 -m nose --tests ...)16:12
blackboxswsmoser: here too :) tox -e py3 -- --tests tests/unittests/test_datasource/test_gce.py:TestDataSourceGCE.test_get_data_returns_false_if_not_on_gce -s16:13
smoser(and you can run that way by just tox -e py3 tests/unittests/test_datasource/test_gce.py:TestDataSourceGCE.test_get_data_returns_false_if_not_on_gce)16:14
smoserbut ok. let me look.16:14
blackboxswahhh good good, I was getting tired of all the extra typing on those --16:14
smoserbut tox-venv is faster16:15
smoseras it doesn't do the setup.py16:15
blackboxswsmoser: today I'm testing dhclient in init-local for aws with centos16:23
blackboxswthen freebsd (so I'm adapting that WIP branch and starting to make it actually work properly)16:24
blackboxswniluje: forgot to respond earlier about your offer to setup access to a test system for us. I think that is a good offer, we are trying to increase our test matrix coverage and this may assist in upcoming SRUs. While I don't think we have the bandwidth to integrate testing w/ your system, if it doesn't cost anything to allow us to access it. It would certainly assist us as we get a chance to login and validate16:51
blackboxswupcoming cloud-init changes.16:51
blackboxswlet me try typing that with proper grammar and punctuation.    niluje: If you can setup system access for us and it doesn't cost anything it might help us in the future when we look at expanding out test matrix.16:53
smoserniluje, i do have a scaleway account17:01
smoserregistered under smoser@brickies.net17:02
smoserblackboxsw,17:03
smoserhttps://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+ref/bug/fix-gce-test17:03
smoserthat fixes the openstack metadata service to patch / use-mock correctly17:03
blackboxswsmoser: correct and it's merged17:09
blackboxswoops17:09
blackboxswjussec17:09
blackboxswhrm smoser I landed that branch you approved in master a few mins ago17:10
blackboxswand your change is a rewrite. ok, checking it out now17:10
blackboxswsmoser: ahh I see what you did to fix it. right the start method returns the actual mocked object so subsequent changes to return_value get honored17:14
blackboxswsmoser: +1 on that change to avoid the additional decorators17:14
blackboxswyou'll have a minor conflict w/ master I presume17:15
blackboxswas I landed that other fix17:15
smoserblackboxsw, https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/32738819:01
smoseryou want to review that quick ?19:01
smoserand ack and then i'll pul it19:02
blackboxswreading it smoser19:03
blackboxswsmoser: approved https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/32738819:10
smoserblackboxsw, thanks19:17
smoserblackboxsw,19:48
smoser=False)19:48
smosersmoser@milhouse:/home/smoser-public/src/cloud-init/cloud-init$ tox-venv py3 python3 -m nose tests/unittests/test_runs/test_simple_run.py tests/unittests/test_distros/test_create_users.py19:48
smoserthat works.19:48
smoserbut dropping the test_simple_run before test_create_users will fail19:49
smoserie, its leaving some mocks or something in place making test_create_users not fail19:49
smoserpowersj, that is the only other non-jsonpatch failure in py3619:54
smoserie, it should be a failure in 3.5 but it was just hidden19:54
powersjyeah19:56
powersjtest_create_users19:56
powersjsmoser: working on kvm backend for testing. I am trying to generate SSH keys on the image, which works, but then run into ssh_deletekeys, which deletes those keys. Have a best practice for doing this?20:00
powersjshould I generate and inject the key we want to use by hijacking the user_data/cloud-config and put the key in that way?20:00
smoserso we can ssh into the system and know the keys, right?20:04
smoserits kind of invasive and system ddpendent20:09
smoserbut maybe20:09
smoserhttps://gist.github.com/smoser/b32bb1c33564d1d46971cd9ded2e847720:10
smoserwe run our own ssh on port 9999 that reads its own keys and such20:10
powersjsmoser: hmm I was hoping to stick to port 22, so that when we extend to this to cloud providers I don't have to deal with firewall related issues20:17
smoserpowersj, well, that means that you can't really test any of the system ssh20:50
powersj:\20:52

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