/srv/irclogs.ubuntu.com/2016/03/22/#cloud-init.txt

magicalChickensmoser, rharper: Hey, I have fallback configuration working in (what I believe) is a mostly sane way06:29
magicalChickenlp:~wesley-wiedenmeier/cloud-init/net-fallback06:29
smoserreading06:29
magicalChickenCurrently I am not attempting to rename the device to eth0, as that fails usually, but the code to do that is in place, a parameter just has to be changed06:29
smosermerge lines06:31
magicalChickensure, just a second06:31
magicalChickenjust pushed06:34
smoserok06:34
smosersitll ther ei think06:34
magicalChickenthere's one or two that kidna make sense for separating sections, I can pop them out too06:35
smoserno. i'm complaining about the merge conflict lines06:35
magicalChickenoh, whoops06:35
smoser:)06:35
magicalChickenhaha sorry about that i'm pretty tired :)06:35
smoserok, so comments on what is see there.06:36
smoserfind_fallback_network_device()06:37
smoserwhat id' like is somethign more like:06:37
smoser generate_fallback_config()06:37
magicalChickensure, that makes sense06:37
smoserand that would simply return {'config': {....}, 'version': 1}06:38
smoserthe dictionary06:38
magicalChickenokay, and we could generate the .link in distros.debian?06:38
magicalChickenit might be okay to just omit the .link file for now until we can figure out the veth naming thing06:39
smoserright!06:39
magicalChickenhaha awesome, okay06:39
smoserhere... let me show you the diff i have.06:39
smoserhttp://paste.ubuntu.com/15470570/06:40
smoserso basically we call init.apply_networking()06:40
smoserand it decides which networking source to look at (via find_networking_config)06:40
smoserselects the right one, and then calls the distro's "apply" for that.06:41
magicalChickenyeah, that makes sense06:41
smoserthe transfer stuff is sort of unrelated06:42
magicalChickenis that from trunk?06:42
smoserthat diff is versus  my net106:42
magicalChickenah, okay06:42
magicalChickeni can merge in from there and apply the rest of the diff06:42
smoserdont worry about grabbing my paste that isnt in my branch yet06:43
magicalChickenokay sure06:44
smoseryou get 'fallback_config()' to just return the config06:44
magicalChickenokay06:44
smosermake sense ?06:44
magicalChickenyeah, I'll get that done real quick06:45
smoseroh. and magicalChicken yrou return value should be a dict with 'config' and 'version'06:53
magicalChickenOh, right yeah06:53
magicalChickenI've got the change made but something went wrong and the file didn't get written, so debugging rn06:53
smoserk06:54
smoseryou had started taht from my net1 branch, right?06:57
magicalChickenyeah, but from around 1191, I think I merged at 1199 though06:58
smoserwell, the one thing we wanat from your branch right now is the fallback_config()07:04
smoserso if you want to just quick re-do that, that'd be fine.07:05
magicalChickenjust pushed, I think it has everything07:05
magicalChickenI renamed the function, and it generates the config fully formatted with the 'config' and 'version' keys07:05
smoserok. i'll get it pulled into my branch and then push up. i will drop some of the other changes though for now.07:08
magicalChickenAwesome okay07:08
magicalChickenyeah, some of the other stuff was mainly for testing07:08
magicalChickenit was cool to see it boot and get a dev configured without the timeout, that'll be pretty nice in the future07:09
smoseri think you need to push07:10
smoseroh. i needed rto reload07:10
magicalChickenhaha yeah, sometimes launchpad doesn't show new commits for a couple minutes07:10
magicalChickenoh, wait, I'm gonna remove the merge lines, I forgot to push that07:11
magicalChickenactually nvm, I think that was just launchpad failing to generate a diff07:12
smoserhttp://paste.ubuntu.com/15470624/07:12
smoserthat is because i have enp0s2507:12
magicalChickenAah, whoops, I thought str.strip would get the ones in the middle too, but I guess it's only at the beginning and end07:13
magicalChickenI can fix that real quick07:13
smoserk07:17
magicalChickenjust pushed, it's fixed now, although the fix is kinda ugly, but I couldn't think of another way to do it on one line07:25
smoserk07:27
magicalChickenI think I'm gonna sign off for the night, that's pretty much everything I was working on done. I'll look into vmtests for this tomorrow07:29
smosermagicalChicken, thanks.07:44
smosermagicalChicken, it still needs some work, but good job07:54
smoser$ python3 -c 'from cloudinit import net; print(net.generate_fallback_config())'07:54
smoser{'config': {'routes': [], 'interfaces': {'vethVJLV0G': {'subnets': [{'type': 'dhcp4'}, {'type': 'dhcp6'}], 'type': 'physical', 'mode': 'manual', 'name': 'vethVJLV0G', 'mac_address': 'fe:15:28:38:df:27', 'inet': 'inet'}}, 'dns': {'search': [], 'nameservers': []}}, 'version': 1}07:54
smoserpulled yours into my branch07:54
smoserman...09:38
rharpersmoser: if I'm reading trunk.net1 right , now with fallback from magicalChicken , we can use nocloud-net instead of nocloud for ds mode ?13:54
rharpersmoser: which openstack did you use to get network_data via config drive ?14:22
smoserrharper, sorry. in now.16:13
smoseropenstack that reads config drive is ConfigDrive16:13
smoseri had forgotten that yesterday too.16:13
rharpersmoser: I meant which cloud16:13
smoserserverstack or canonistack will provide a config drive.16:13
rharperas you said, serverstack doesn't populate the metadata service with 'network_data' link16:13
smoserright.16:13
rharperyeah, I saw the config drive16:13
smoserso that sucks.16:14
rharperso I'm using the example json from the link16:14
smoseri dont know where i can get one....16:14
rharperbut Ideally we'd be able to test this parser out16:14
smoseryeah16:14
rharperwe'd have to standup one and enable it16:14
smoserlet me search a couple public clouds and see if we can get network md anywhere for openstack.16:14
rharperor poke around any of the stacks you have access to16:14
rharperyeah16:14
smoseri'm not sure why we dont get it16:14
rharperso, one thing, I think the routes handling in the network stuff needs an adjustment16:14
smosercan you bother someone on opentsack team to see if you can get them to make it go on serverstack ?16:15
rharperyeah16:15
rharperI need to add support to the subnets section to allow one to specify a list of routes (which we already emit the 'up route ' stanzas for)16:17
rharperthe 'networks' section in the config drive network bits is made just for that (network netmask gateway)16:17
smoserrharper, wel...16:44
smoseri got half16:44
smoserssh root@162.253.53.9416:45
smoserok. so half way good news.16:45
smoserserverstack has the network config in the MD , but not on the config drive16:46
smoserwhich is actually the same as i'm seeing on vexxhost where iw as able to launch an  instance after adding some networks.16:46
smosersuro-patz, you had some questions about networking and such, right ?16:51
suro-patzsmoser: yes regarding https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/154940317:02
suro-patzbasically I am working on MaaS equivalent in OpenStack, i.e. Ironic - and looking for configuring multiple IP (v4 & v6) on the target node through cloud-init17:02
smoserah. ok.17:04
smoseris it config drive datasource ?17:04
smoserwhere will the network info come from17:05
suro-patzsmoser: yes, config drive data source17:06
suro-patzNeutron17:06
smoserrharper, ^17:07
smoserthat is exactly what we were wanting to work on next.17:08
smosersuro-patz, so in https://code.launchpad.net/~smoser/cloud-init/trunk.net1/17:09
smoserthat branch, the code is mostly there to do this.17:09
suro-patzsmoser: I will look into the diff17:09
smoserwell at least the infrastructure.17:09
suro-patzthat would be helpful17:09
suro-patzI made some changes to get it working for RHEL for us17:10
smosersuro-patz, the thing that is missing is the ConfigDrive datasource needs a 'network_config' method (see the one in DataSourceNoCloud)17:10
suro-patzbut I would love to adhere to the infrastructure17:10
suro-patzsmoser: I will check17:10
smoserand taht network_config basically needs to return a "network config" dictionary17:10
smoserand then, in theory, it'd all "just work"17:10
smoserah.17:11
smoserthere are 3 bits of work17:11
smosera.) getting DataSourceCondfigDrive.network_config to return the right stuff.  That will require a parser/converter from openstack entworking format into 'network_config'17:12
smoserb.) some improvements to cloudinit/net/ for rendering that network config on ubuntu17:12
smoserc.) support for rendering that into Centos style networking17:12
smoserbecause i think you want centos, suro-patz17:12
smoserso now i have a question for you...17:13
smoserdo you know how to convince nvoa to put a 'network_cofnig.json' on a libvirt config drive ?17:13
suro-patzsmoser: I will work on that as I get things working end-to-end for me, I expect to start on that next week17:14
smoser--config-drive=1 gets me networking information in the metadata service but no network_data.json on the config drive17:15
suro-patznova-compute uses a template to parse using jinja217:15
suro-patzwe can pass new template/conditionally17:15
suro-patzor we can modify the template too17:15
suro-patzI had to modify some of the nova-compute code too17:15
suro-patzonce I get things working for me, which I expect by end of this week, I will work with the community to upstream17:16
smosersuro-patz, ?17:17
smosertemplate to parse?17:17
suro-patznova-compute uses a template for the content file17:18
smoseri dont want interfaces17:18
smoserhere. let me show.17:19
suro-patzsmoser:https://github.com/openstack/nova/blob/master/nova/virt/netutils.py#L7617:20
smoserhttp://paste.ubuntu.com/15473498/17:20
smosersuro-patz, so i dont want the "/etc/network/intefaces" style file.17:21
suro-patzsmoser: got your point17:21
smoseri want the more structured network_config.json17:21
smoserso the above came from an instance.17:22
smoserbut the config drive does not have that file17:22
smoser:-(17:22
suro-patzI am not aware of nova-community's argument on why we should not put network_data.json17:22
smoserthere is an argument ?17:22
smoserit really looksl ike its just busted17:22
suro-patzI am not aware of17:23
smoseri poked through the code, and it seems to be *trying* to do it.17:23
suro-patzwe can fix it17:23
suro-patzeven I felt the same17:23
suro-patzwe do process meta_data.json17:23
suro-patzbut the network config is in old format17:23
smoserright. i want to dump the old code.17:23
smosernot support the network_interfaces reading... well, leave it for dead i guess.17:24
smosertry to keep it working.17:24
smoserbut in cloud-dinit want to focus on reading the network_data.json17:24
suro-patzsmoser: will work in that direction17:24
smosersuro-patz, ggreat. one last thing...17:24
smoserfor now the target is to read and apply network information from a local data source only17:25
smoserie, config drive tells me what networking should look like, and we apply it before networking ever comes up17:25
smoserthe more complex scenario of where you need *some* networking to get to network provided network configuration is for later.17:26
smoserthat make sense ?17:26
suro-patzare you referring to metadata service sort of scenario17:26
smoserthat branch does a good job (on ubuntu at least) of enforcing the NICs dont just come up before cloud-init has had a chance to write the system config.17:27
smosersuro-patz, yes,17:27
smosermetadata service.17:27
suro-patzits like bootstrap and download further config to apply17:27
smoserie, for openstack metadata service, wed' have to first dhcp on some device (or bring up local networking) and then read the network config.17:27
smoserright.17:27
suro-patzonly catch is they should not be conflicting17:27
smoserright.17:28
smoserthe first step (config drive) is pretty easy17:28
smoserand almost done there on ubuntu. we write all the config before the OS gets a chance to bring it all up.  so we dont have to worry about changing it.17:28
smoserrharper, http://paste.ubuntu.com/15473498/ is a real world example.17:29
rharpersmoser: nice!17:47
rharpersmoser: nice and scary with 3 interfaces with dhcp =)17:49
rharpersmoser: is there a definitive markup for what will get populated there?  services is new;  would like to see bridge examples as well17:50
smoserrharper, i dont know.17:52
rharperlooks like the code17:52
rharperI looked at the above nova link, I can dig through there17:53
smoseri kind of doubt anything in openstack will be declaring bridges and such at this point17:53
rharperalmost done parsing the json into network state so we can render eni17:53
smoseroh. /me remembers17:53
smoserhow was it... jayf . works at rackspace on bare metal. they might have somethign like that.18:06
smoserrharper, JayF is going to get us some baremetal data18:11
rharpersmoser: cool!18:11
smoserand suro-patz https://bugs.launchpad.net/nova/+bug/1513267 <-- that seems to be maybe what is missing18:11
JayFJust don't mine any dogecoin while you're on the box :P18:12
* smoser googles dogecoin and assumes he should probably stop the bitcoin mining that he was doing :)18:13
JayFlol18:14
smoserrharper, jump on that box and look around.18:26
smoserJayF, mentions that the vlan stuff is patched in in baremetal18:27
smosernot in upstream.18:27
suro-patzsmoser: with "sudo rm -rf /var/lib/instances/*; sudo rm -rf /var/log/cloud-init.log; sudo cloud-init init —local' did not reconfigure network from content/0000 - I had changed the content of the file, but it did not apply18:27
smoserhm..18:28
suro-patzany trick, how can I re-run cloud-init to reconfigure network, without reboot18:28
suro-patzeven reboot also din't help18:28
smoseri dont knwo why that wouldnt have done it.18:28
smatzekrm -rf stuff under  /var/lib/cloud/data as well?18:29
suro-patzsmatzek: no, I had not done that18:30
suro-patzwill give a shot18:30
JayFsmoser: I can probably even supply the nova patch we use if oyu want18:30
smatzekat a minimum you need to take  /var/lib/cloud/data/instance-id or change the UUID in it, or cloud-init sees the UUID hasn't changed and doesn't run18:31
smatzektake > take out18:31
smoserJayF, your metdata is odd18:32
smoserthe config drive layout18:32
smoserhas 'latest/' that has network_data.json in it18:32
smoserbut the LIBERTY version (2015-10-15) does not18:32
smoseris that by design ?18:32
JayFprobably means we haven't deployed that upstream bugfix you linked me in pm18:32
smoserwell, JayF the bug was that it did not appear *anywhere*18:33
JayFoh. hm18:33
JayFI don't know why :)18:33
JayFAsking about stuff we did, at this point, 2y ago :)18:33
smoserrharper, for reference http://paste.ubuntu.com/15474058/18:36
rharpersmoser: thanks!18:37
smoserrharper, and you might as well grab config-drive.img.gz and cnonfig-drive.tar.gz of that system. just in case.18:38
rharperk18:39
rharpergot it18:39
suro-patzsmatzek: works, after removing the instance-id! Cool!18:42
smoserJayF, we're done if you want to kill that thing.19:05
randeffects__nocloud question: if I use nocloud ds on a vmware vm does the disk image have to stay attached after the initial boot?  if I reboot the vm and the disk image is not attached, cloud init runs again with ds none.19:20
smoserrandeffects__, yes19:25
smoseryou're right :)19:25
smoserrandeffects__, https://launchpad.net/bugs/155381519:25
smoserthat is fixed in trunk, and should soon be in xenial19:25
smoserbut actually the fix i added for nocloud was to only check the seed direcdtories or the kernel command line (not mounting the disk)19:27
randeffects__smoser thanks19:27
smoserso... but you can get the behavior you want. you just have to be explicit19:27
smoserand set 'manual_cache_clean' in the image or in user data19:27
smoseractually, that wont work from user-data19:28
smoseri just put a comment in that bug19:29
JayFsmoser: cool, hopefully it helped?19:38
smoseryeah. thank  you very much JayF .19:40
JayFnp anytime I can help with something like that feel free to ask19:42
vox_clamantishi all ... anyone know where to find info on configuring cloud-init to use OpenStack metadata service?20:21
smoservox_clamantis, it should "just work".20:27
vox_clamantis:) i was afraid of that20:28
vox_clamantisit always picks another like configdrive or e2c. if i specify OpenStack as the only option in datasource_list it never finds it. although i have no problem accessing with curl20:29
smoserhm.20:30
smoserdefinitely if config drive is enabled it will select it.20:30
smoserbut openstack shoudl run before ec220:30
smosercheck the order20:30
vox_clamantislet me try again. thanks for the suggestion20:31
smosermagicalChicken, around ?20:38
magicalChickensmoser: Yeah20:38
smoserhey....20:38
smosershoot. sorry to ping you .20:39
magicalChickenit's okay20:39
magicalChickenis there anything I should be working on today aside from tests?20:39
smoserheres one20:39
smoserkernel command line20:39
smoserwith your chagnes for kenrel command line in theory curtin should not need any patching of the image20:40
smoserie, the ENI should be able to be left in tact20:40
magicalChickenRight yeah20:40
smoserso you could use your kernel command line branch20:40
smoserand integrate with net120:40
smoserand then try vmtest for curtin20:40
smoserthe other thing there...20:40
magicalChickencool, okay20:40
smoserwe should no longer need persistent names20:40
smoserin the curtin xenial command line20:40
smoserthat make sense ? kernel cmdline ...20:40
smoser net.ifnames=020:41
smoseri never rememberr that string20:41
magicalChickenOkay yeah, that makes sense20:41
smoseri have to run *right now*20:41
smoseri'll check in later.20:41
smoserbye20:41
magicalChickenbye20:41
rharpersmoser: ok, I've got something that converts the 3 different network-data json into network_state, when then we can render_eni etc;  I'm looking at cloudinit/source/DataSourceConfigDrive ; where do we determine which dir of the config drive to use? for example, the network_data.json is only in latest  ;21:17
rharperopenstack helpers21:20
rharperOS_HAVANA is the latest, prolly should update that21:21
* rharper relocates21:30
smoserrharper, did you actually see it in latest ?21:31
smoserbecause i've not seen it anywhere. althought hat file sys it will be.21:31
smoseri think we should assume correct working order of the cloud though and use the LIBERTY date21:31
smoser'latest' is not really something you can use. they're explicilty stating there is a ABI. using latest/ is guaranteed to fail at some point.21:32

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