/srv/irclogs.ubuntu.com/2018/02/07/#cloud-init.txt

enlethHi there. I'm trying to write a simple network-config for a VM running on an OVH dedicated server, with a public IP for the VM. The problem is, OVH's IP assignment is kinda wonky and requires using a gateway from a completely different subnet than the machine's IP.05:05
enlethThis is a working network config I set manually: https://paste.q3k.org/paste/6VsfMrhe#DWJwJjp+6nlZCcd5aGvqWolB7VXzqr8FztVi2cJgHPQ05:06
enlethyes, it works, yes, it uses a gateway address in a subnet different than the interface address, yes, the interface has no address in the gateway's subnet - and it must not have one05:07
enlethso, how do I define a link-scope route in network-config?05:07
LaborejoGuest9hi there, it there any module doesn't listed in /etc/cloud/cloud.cfg?10:28
LaborejoGuest9since I didn't found document says every module belongs to which stage10:29
mgerdtsI submitted a merge proposal the other day and needed to make some updates.  After I made the updates, I deleted the remote branch and pushed my squashed changes to a branch of the same name.  1) was this the right way?  2) Do I need to do anything else to alert reviewers that it was updated?13:49
mgerdtshttps://code.launchpad.net/~mgerdts/cloud-init/+git/cloud-init/+ref/bug-174660513:49
smosermgerdts: i'll review. i'm sorry, just beenbehind. always am.14:22
smosermgerdts: you can basically do 1 of 2 ways14:23
mgerdtsno worries.  I've made other changes aside from the commit message as well.  Those changes are not in the same files as were in the original commit.14:23
smosera.) push up original merge proposal, get feedback, add commits that say 'address feedback', rince and repeat14:23
smoserrinse14:23
smoserb.) push up original, get feedback, git commit --amend, git push --force14:24
smoseri do both14:24
smoserwhen we pull, we squash and use the commit message from the merge proposal14:24
smoserso the "address feedback" comments get tossed.14:24
mgerdtsok, thanks for clarifiying.14:25
smosermgerdts: so, in the 'Set commit message' there14:26
smoserput a good git commit message14:27
smoser Summary:14:27
smoser blank14:27
smoser mer stuff14:27
smoser blank line14:27
smoser LP: #174660514:28
ubot5Launchpad bug 1746605 in cloud-init "DataSourceSmartOS needs locking and retries" [Undecided,New] https://launchpad.net/bugs/174660514:28
smosermake sense ?14:28
smoseryour 'Description of change' is reasonable, just format in summary and body, and < 74 chars wide.14:28
mgerdtsI think when I ran tox the first time around I must have done it as a non-root user because I wasn't seeing serial failures.  If it doesn't have write access to the serial port, it skips that test.  My updates this time around (aside from commit message) were to add pyserial and fix a bug with deb package creation.14:29
smoseryou sould not have to run tox as root14:30
mgerdtsI updated the commit message in the changeset.  Are you saying I was supposed to do that in LP?14:30
smoserit should mock anything that needs.14:30
smoserhttps://code.launchpad.net/~mgerdts/cloud-init/+git/cloud-init/+merge/337106 right ?14:30
mgerdtsAs the comments in the new test explain, that's not really possible.14:30
smoseri just see one commit, with a one line message.14:30
mgerdtsthat's stale14:31
mgerdtsI don't know how to tell it that I have replaced that changeset.14:31
mgerdtsthat is, I deleted the branch then pushed again.14:31
mgerdtsperhaps this request needs to be closed and refiled?14:32
smoserok. hm.. lets just do that.14:32
smoserhttp://paste.ubuntu.com/26536015/ <-- just to not lose that14:32
smoserso now go https://code.launchpad.net/~mgerdts/cloud-init/+git/cloud-init/+ref/bug-1746605 and propose for merging14:33
smoseris 37ea241 your tip ?14:33
mgerdtshttps://code.launchpad.net/~mgerdts/cloud-init/+git/cloud-init/+merge/33727114:34
mgerdts67cd602d14:34
mgerdtsoh wait...14:34
mgerdtsyeah, you got the right one14:35
mgerdtsI was in a different branch when I gave you the bogus response14:35
smoser:)14:36
smosermgerdts: do you think you have fixed 1667735 also ?15:03
mgerdtsNo, I have a separate fix for that just about ready.15:04
smoserok15:04
mgerdts@smoser if the test isn't a good fit for unit tests, I can remove it.  Since this (and the fix for 1667735) depend on behavior that is specific to serial ports, I'm unsure of if/how any automated tests can be written.15:33
smosermgerdts: yeah... i know. you end up having to mock a lot of infrastructure15:35
smoserwrite a "pretend mock server" sort of thing.15:35
mgerdtsIf Linux had something like FreeBSD's nmdm (null modem) driver that could be used.  Unless I'm missing something, any attempt to mock a serial port with a pipe or socket will result in invalid tests.15:36
mgerdtspipes and serial ports will create one stream (thinking of solaris, don't know the linux implementation details) that ensure there is no cross-talk.15:36
smoseryeah.15:36
mgerdtsAlso, there's no guarantee that the VFS ops related to locking with non-serial ports are representative of those used on serial ports.15:37
smoseryou'd just have to fabricate the crosstalk15:37
smoserbut yeah. i know . its a lot of pain.15:37
smoseri'll ask blackboxsw to have a think also.15:38
mgerdtsok.  I guess I need to come up to speed on mock so that I can maybe be a bit more imaginative in coming up with test strategies.15:41
enlethI'm having a problem getting network-config to work with nocloud local ds15:59
enlethhttps://paste.q3k.org/paste/tbFmVALJ#N1adKr6domaWXz-ayWaK7phn3aRzxoUNFkbc5I1Y0if - here's my configuration and the error I'm getting15:59
enlethmeta-data, user-data and network-config are packed into an iso file attached to a VM16:00
enlethhostname and user are being set up correctly16:00
enlethgoogling for the error message suggests that cloud-init detected the network-config file but for some reason parsed it as an empty (?) config16:01
smoserenleth: i need a key to read that.16:01
enlethsmoser: the key is in the URL, it's the anchor16:01
enlethneeds JS to work, decrypts it in the browser16:01
enlethI can re-post it to a regular pastebin16:02
enlethhttps://pastebin.com/1jKntbhx16:02
enlethsmoser: ^16:03
enlethif I run this without the network-config file, it just runs DHCP on the intherface as expected and everything else works too16:03
smoserenleth: well, it says "could not decrypt data (Wrong key?)16:04
smoserso... i dont know. i'm just using firefox and no js disabled or anything16:04
enlethno matter, use the second link16:04
enlethif that's of any importance, the iso file is generated like this: genisoimage  -output seed.iso -volid cidata -joliet -rock user-data meta-data network-config16:07
smoserenleth: i'msorry.. pulled away. can you file a bug ?16:29
enlethis there anything I can check now to actually get it over with and continue my work?16:42
smoserenleth: well, i suggest trying the network config v116:46
smoserwhich is a bit more explicit16:46
enlethsmoser: how does matching by MAC address work there? what I hoped to achieve was a shared config ISO for several VMs, with interface entries for each of them matching by MAC - so that the correct one would be used to set a static IP on first boot and the rest would be ignored16:49
enleththe docs for v2 explicitly say this is how it works16:49
enlethbut it's not so clear for v1, where the interface name is described as the primary piece of data16:49
enlethmaybe let me rephrase my question - if I define several interfaces in v1 config format, with names that don't match any default network adapter names assigned by kernel/udev (like, say, "ethpub1", "ethpub2", etc. instead of ethX or enoX or whatever) and define their MAC addresses, will it simply match one of those to an existing interface by MAC, rename it and ignore the rest?16:53
smoserenleth: i'm sorry, not really all the way here righ tnow.  i can look some later.17:04
blackboxswper the cloud-init status bug rharper, you mentioned checking results.json presence, but that file could also exist already if we are running some non-local stage of cloud-init via cli too. so I think I'll have to check both, presence of result.json & no stage in status.json with a non-zero start and no finished time.17:16
rharperblackboxsw: hrm, generally I don't think cloud-init status would react to anything after cloud-final as completed and result.json is written17:19
rharpercloud-init cli invocations are not asynchronous , they're blocking17:19
rharperhttps://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/174796517:22
ubot5Ubuntu bug 1747965 in cloud-init (Ubuntu) "cloud-init status reports done before boot is finished" [Undecided,New]17:22
blackboxswhttp://paste.ubuntu.com/2653681817:33
blackboxswrharper: ^ that's the status example on ec2 where a stage that's never going to offically get run is leaked/written into status.json17:34
rharpermodules-init should be ignored AFAIK, smoser ?17:35
blackboxswmaybe it's worth us ensuring modules-init isn't written17:35
blackboxswyeah17:35
rharperthat said, how is that stage related to reporting 'done' early ?17:35
blackboxswrharper: status logic used to say if any stage didn't have a start time report 'running'17:36
blackboxswnow logic says if start != null and finished == null RUNNING17:36
blackboxswbut we really could just simply rely on result.json existing and no incomplete (started but not finished) stages in status.json17:37
blackboxswor we could look at ps :) but this feels like overkill17:37
rharperI think the result.json parsing would be best,17:38
rharpererr, status17:38
blackboxswnot much to parse there, but ..17:38
blackboxswahh17:38
blackboxswright status.json17:38
blackboxswalso one things status didn't take into account is stage: != null means we are in flight on a given stage17:39
blackboxswbut as a stage completes I believe that always gets set back to null before starting the next stage. so there are gaps where cloud-init status would mistakenly represent 'done'17:40
blackboxswso anyway, I'll work it and ping you with a branch on this17:40
rharper cool17:44
smoser"ignored" ?17:52
smoseryeah, we shouldnt write that to status17:52
smoseronly the stages that we run.17:52
enlethsmoser: FYI v1 config loads properly17:52
enlethshame it can't do wildcard matches on the MAC17:52
blackboxswso how it looks as far as status.json. cloud-init modules --mode=init will write a start and finished time for that stage when running those 'modules-init'  modules if we run on the commandline17:52
enlethor can it? the docs don't say17:53
blackboxswduring normal system startup/config of cloud-init we don't explicitly run modules --mode=init17:53
blackboxswso that will always have null/null for start/finished times17:53
smoserenleth: ok. let me loop at your issue again.17:56
blackboxswthose modules-init modules are run during cloud-init's init(network) stage.  the cloud_config_modules are run during modules:config stage17:56
smoserenleth: so https://pastebin.com/raw/1jKntbhx is actually waht you put in ?17:57
smoseri dont understand "wildcard"17:57
blackboxswso in terms of status.json, the "init" section represents modules-init during typical system startup and cloud-init configuration17:57
enlethsmoser: not related to the issue, I just wanted to use "match: macaddress: 52:*" for another interface which is why I tried v217:58
enlethsmoser: yes, the pastebin shows my entire cloud-init config17:59
enlethdidn't paste the user-data file but it only contains the users entry with my ssh keys and stuff17:59
smoserenleth: this is fixed in trunk. i'm pretty sure.18:00
enlethwhen I converted the config to v1, it loads and works18:00
enlethsmoser: you mean v2 not being loaded?18:00
smoserso your v2 would work with 17.1 or 17.2 release.18:00
smoseryeah.18:00
enlethwonder when debian releasing publishing openstack images with cloud-init upgraded to that version18:02
enleth*s/publishing//18:02
smoseri'd be itnerested in knowing for sure18:03
smoseryou can build a deb gfrom trunk easily enough, or probably just ggrab it from18:03
smoserhttps://code.launchpad.net/~cloud-init-dev/+archive/ubuntu/daily/+packages18:03
smoserand patch your image18:03
enlethare those going to work on debian?18:06
smoseri do not know that they dont.18:06
enlethI was under impresion that some ubuntu packages do work with debian but it's more "by accident" than anything deliberate that can be depended upon18:08
smoserenleth: i'm not suggesting you use a daily build for anything production.18:08
smoserjust to test if it is fixed.18:09
enlethsure18:09
enleththe network interface name changes need cloud-init to run on every boot, right?18:29
=== r-daneel_ is now known as r-daneel
enlethI tried creating /etc/cloud/cloud-init.disabled after the first boot so that existing VMs don't break when I do something stupid to the config in the datasource, but the interfaces are no longer getting renamed so whatever got created in /etc/network/interfaces.d/50-cloud-init.cfg no longer works at all18:31
smoserenleth: hm..18:38
smoserenleth: is that ifupdown ?18:38
smosercloud-init writes udev rules to make that work18:38
smoserbut *it* might not support the 'match' if you're using that.18:39
enlethdebian9, ifupdown18:39
enlethnothing in /etc/udev/rules.d/18:39
enlethusing v1 config right now18:40
smoserreally.18:40
smoserit really should write /etc/udev/rules.d/70-persistent-net.rules18:40
enlethis there a "verbose" mode I can enable to see what it does and when?18:41
enlethah, there's quite a bit of logs in /var/log/cloud-init.log18:44
enlethok, I did a clean boot - it set the runtime interface names correctly18:46
enleth/etc/udev/rules.d/ empty18:47
enlethgrep rules /var/log/cloud* comes up empty18:48
enlethsame for udev (save for a mountpoint list)18:48
enlethsmoser: https://pastebin.com/Y1m5PxRx this is the most interesting part I found18:50
enlethother refernces to "network" in the log are accidental or just refer to the network-config file being found at the beginning18:51
smoserenleth: so in newer cloud-init you'll get https://hastebin.com/kaxelapipo18:55
enlethis that just a matter of an old version in debian?18:56
smoseri think so yes.18:57
enlethsomething's not right, I grepped /usr/lib/python3/dist-packages/cloudinit/ for "persistent-rules" and two hits come up18:59
enleththe code is there18:59
enlethyes, the code to use netrules_path and write to it is definitely there19:08
enlethI'm trying to figure out why wouldn't it run19:09
=== r-daneel_ is now known as r-daneel
enlethah, so19:26
enlethdistro/debian.py initializes the Rendered with 'netrules_path': None19:27
enlethwhy would anyone do that?19:33
mgerdtsI thought that https://mail.python.org/pipermail/python-dev/2013-September/128287.html would mean that the development branch of cloud-init wouldn't need to support Python 2.6.  Sigh.19:43
enletheh, setting netrules_path correctly for debian works19:57
enlethI'm at loss as to why it was set to None19:58
smosermgerdts: we're still supporting centos 6. which is python 2.619:58
Odd_BlokeUntil November 2020, apparently.20:00
Odd_BlokeThough RHEL 6 is also 2.6, and supported until 2024. :p20:01
enlethsmoser: OK, thanks for all the help, for now I've jury-rigged a patch to support udev rules on debian with the old version I have and switched to v1 network config, I'll upgrade whenever debian starts shipping the new version20:10
blackboxswrharper: https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/337306 for cloud-init status cmdline fix21:57
rharperblackboxsw: thx, will look at it22:06
jchevalierpaulmey: Hi, I'm sorry I'm that long to answer, I have out of sync work hours!23:55
jchevalierSo I tried to add the .cfg file to my vm before to make it a image23:56
jchevalierbut then the image never spawns23:56
jchevalierthe boot fails in Azure dashboard23:56

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