/srv/irclogs.ubuntu.com/2020/03/26/#cloud-init.txt

faahello, maybe someone has an example debian double network interface?00:29
=== tds1 is now known as tds
johnsonshirharper: As discussed previously, cloud-init's swap file module runs before the mount module. Cloud-init swap create also does not ensure that it has a path to the file, thereby throwing an exception. https://bugs.launchpad.net/cloud-init/+bug/186911401:21
ubot5Ubuntu bug 1869114 in cloud-init "swap module runs before mount module" [Undecided,New]01:21
=== tds2 is now known as tds
faahelp required, debian, may cloud-init write file (/etc/network/interfaces.d/enp0s0) previous network stage? datasource NoCloud iso08:44
andras-kovacsimho by default it makes a config for your interface but what is the problem you are facing right now?08:54
faadebian if interface not status link up, cloud-init ignor this interface (only write config) require restart network08:58
faalog https://pastebin.com/gv6HgpjY first interface link up in image template09:04
andras-kovacs enp0s1 |  True |         127.0.0.1 that's strange, doesn't it?09:05
andras-kovacsare you using NetworkManager?09:05
faaip changed, not standart debian 10 service, with wery old cloud-init09:07
andras-kovacssorry, I can't follow you09:13
andras-kovacsif you have problems with the old network.service try to disble it and use NetworkManager instead (but I'm not 100% surre how it looks like in Debian nowadays)09:13
faait's minimal server install without external packages09:15
nrajasekharHello09:24
nrajasekharI need some help with cloud-init usage on suse09:26
nrajasekharI want to change the password on first login after creating the aws instance09:26
nrajasekharHow can I achieve it09:27
nrajasekharany help here is much appreciated09:28
andras-kovacsdo you want to change only or store it in a meta service somewhere?09:29
andras-kovacsI would change it with a runcmd command maybe09:30
nrajasekharchange and save it09:31
andras-kovacsI think you can find a whole solution with google for that09:31
nrajasekharyes, I have tried all the available options. none of them worked for me09:32
nrajasekharI have referred the link that I am pasting here : https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux_atomic_host/7/html/installation_and_configuration_guide/setting_up_cloud_init09:32
andras-kovacsI would call a simple shell script which would set up a new password ,encrypt it with my ssh pubkey and upload it to the meta data server09:32
andras-kovacsfirst things first, are you trying to make it work with Atomic?09:33
nrajasekharsorry but I am not sure what that option mean from the link.09:34
andras-kovacswhich option?09:34
nrajasekharpassword: atomic09:35
andras-kovacsthis how-to while looks perfectly good for me I think it's a general one and not for AWS exactly09:35
nrajasekharoh ok09:35
nrajasekharfrom open build service, I have taken sample template and modifying to achieve it09:36
nrajasekharbut none of the options worked09:36
andras-kovacsI don't know that one09:36
nrajasekharcould you please suggest any method or example from a link?09:37
andras-kovacsbut we should know that what do you want to achieve09:37
nrajasekharhttps://build.opensuse.org/09:37
nrajasekharok let me explain09:37
nrajasekharwe generate Appliance in the OVA format09:38
andras-kovacswhy?09:38
andras-kovacsI mean why in ova? do you use virtualbox or what?09:38
nrajasekharthat's the way we deliver it to customers09:39
nrajasekharrecently my team has decided to deploy our product on to AWS09:40
andras-kovacsidk but ova ususally means virtualbox which also means IDE attached disks09:40
nrajasekharupon googling I found that OVA can be used to create AWS ami and an instance09:40
nrajasekharhttps://docs.aws.amazon.com/vm-import/latest/userguide/vmimport-image-import.html09:41
nrajasekharI could able to successfully deploy OVA and create an instance out it and access my application09:42
andras-kovacsthan what's the problem?09:42
nrajasekharbut in the OVA, we have hardcoded the root password09:42
andras-kovacsdo you want to randomize some passwords?09:42
=== vrubiolo1 is now known as vrubiolo
nrajasekharnow we want to make sure on first login, the user changes the password and save it09:43
andras-kovacsfinally! :D09:44
andras-kovacsso this is what you want here09:44
nrajasekharyes :-)09:44
andras-kovacsyou just need to expire the password of that account I think and that's all09:45
andras-kovacshttps://www.tecmint.com/force-user-to-change-password-next-login-in-linux/09:45
andras-kovacsyou can put it in a runcmd command also but I would set it in the "ova" before I upload it to AWS.09:46
andras-kovacsI mean you can do it without cloud-init also09:46
nrajasekharok09:47
nrajasekharout of curiosity, Is there any option in clou-init?09:47
nrajasekhar*cloud-int09:48
nrajasekhar*cloud-init09:48
andras-kovacshttps://cloudinit.readthedocs.io/en/latest/topics/modules.html#users-and-groups09:50
andras-kovacsanything else you want there is runcmd for that09:51
nrajasekharsure I will give a try.09:52
nrajasekhar@andras-kovacs: thanks for all the help and info.09:52
andras-kovacsywc!09:55
Gonerithe CI is broken because of https://github.com/gabrielfalcao/HTTPretty/issues/39713:36
Goneria 1.0.2 release has just been pushed.13:36
Odd_Blokenrajasekhar: You should consider whether having a password in a cloud environment is appropriate at all, but https://cloudinit.readthedocs.io/en/latest/topics/modules.html#set-passwords will allow you to set passwords and by default they should require resetting on first login.13:37
Odd_BlokeGoneri: I've just restarted the CI for your PR.  Assuming that new version has been released, we should pick it up automatically.13:38
Odd_Blokeandras-kovacs: (Thanks for helping out!)13:38
Gonerithanks13:39
Odd_BlokeAnd yep, it's got past the point it failed before.13:40
GoneriOdd_Bloke, once this patch is merged, I will clean up cloudinit/sources/DataSourceNoCloud.py to remove the OS specific code we use to build devlist.13:52
Goneriit should be in cloudinit/util.py13:52
Odd_BlokeOK, nice!13:52
Goneriand the find_devs() method should be in cloudinit/distros/13:52
Gonerisince it's OS (and distro) specific13:53
=== hjensas_ is now known as hjensas
eggbeanIs there a vs code extension for #cloud-config?14:26
eggbeanCan't find anything14:27
andras-kovacsit's not so complex IMHO14:30
andras-kovacs# vim:syntax=yaml14:31
andras-kovacsso just use yaml syntax and that's all14:31
eggbeanandras-kovacs: yeh okay.  It's just that as I am new to it, autocomplete would have been useful to remind me of the exact keys14:36
andras-kovacsI see :D14:37
amansi26Hi, I have a doubt . I am using ConfigDrive as datasource and deployig a DHCP network. netcfg.get('config') in stages.py is coming to None. Distro is rhel and cloud init version is 19.1.14:44
amansi26can someone lease guide me14:44
amansi26please*14:44
andras-kovacswait a minute14:50
andras-kovacsso it's rhel 8, right?14:50
andras-kovacsin 7 the latest is 18.5 as I remember14:51
amansi26it is rhel 7.714:52
andras-kovacsoh wow14:59
amansi26It is just failing for DHCP network. Static is working fine15:02
andras-kovacsI'm not sure I understand why do you need to "pull" the DHCP config15:02
andras-kovacsthe DHCP server doesn't supply the necessary data?15:03
andras-kovacsI mean I don't get the deploy part. Cloud-init makes a dhcp config for your interface and that should work.15:04
amansi26Didn't get your last message15:04
Odd_Blokeeggbean: I'm not aware of any such extension.  There is JSON Schema for some of the cloud config modules, you might be able to do something with that?16:22
Odd_Blokerharper: You still have requested changes on https://github.com/canonical/cloud-init/pull/147, which I believe are all addressed.  Could you either dismiss your review or do enough to give it an Approve?17:09
rharperlemme look17:15
robjorharper: what file contains the more or less complete jsonschema for network and routing configuration?17:15
rharperwe've no schema written for network config v1;  netplan (v2) I think has schema in source;17:15
robjoOK, I guess I have to keep winging it :(17:16
rharperOdd_Bloke: maybe I'm missing something, but on conversation page, I see my requested changes/comments, there's a 'view changes' button, which almost always ends up on a 'whoops can't find your changes' page ...  what is that supposed to do?17:19
blackboxswOdd_Bloke: approved (but needs rebase) https://github.com/canonical/cloud-init/pull/278/files18:15
Gonerirharper, is there anything else I need to adjust? https://github.com/canonical/cloud-init/pull/14718:37
=== tds2 is now known as tds
rharperGoneri: thanks, I'm re-reviewing18:49
bwatsonAnyone have any luck bootstrapping a RHEL 8.1 or CentOS 8 generic cloud image (kvm) via cloud-init on VMWare?  I add the *.iso as a virtual CD-ROM to the machine and power it on, but the only thing I see on screen is: Probing EDD (edd=off to disable)... ok18:55
bwatsonor is EL8 just not ready for this yet?  I've been using this technique with EL 6/7 and Ubuntu 16/18 for some time now18:56
Gonerirharper, thanks. I'm testing a fix.19:02
Gonerirharper, https://github.com/canonical/cloud-init/pull/147/commits/02694900dd656b94ed056a03952eeab276aa269419:24
Gonerirharper, I don't default on DHCP anymore.19:24
=== tds8 is now known as tds
rharperGoneri: ok, dhcp on just one interface then ?19:28
rharperdhcp_interfaces() does this  ever return more than one ?19:29
Goneriit depends on the metadata19:29
Goneriso yes you can get more than one, in this case the defaul route will be indeed important19:30
Goneribut it's not different to what we do we FreeBSD or NetBSD.19:30
GoneriI would say, we cannot fix the network environment for the user.19:31
rharperwell,  they don't have control over it in a cloud19:32
rharperin Azure, for example, you have to DHCP on primary nic, and secondary nics can also DHCP but the route can break the primary nic configuration;  so we ensure the network-config we write to the OS has a metric value that's lower priority for non-primary nics19:33
Odd_Blokerharper: My guess is that a force-push means that the commits references are no longer present.19:34
rharperOdd_Bloke: yeah; I was thinking that;  seems like if a force push happens the message should go away since its not a great experience;19:35
Gonerirharper, if you've got two DHCP network without a default route, bad things will happen.19:35
rharperno, they * both* have a default route19:35
Goneribut it's already the case with the other BSD. I'm not sure how I can fix that.19:35
rharperthey may even point to the same router; but the question out of which interface does the packet egress19:35
rharperon Azure for example, packets destined for the internet may *only* come from eth0;19:35
rharperthey are dropped otherwise19:35
rharperso the routing table entries matter19:35
rharpermulti-nic DHCP needs help since the platform network metadata is imprecise (they just say DHCP on all of the nics)19:36
Odd_Blokeblackboxsw: Thanks for the review!19:36
rharpercloud-init helps out here by ensuring that we don't clobber the default route for the primary interface19:36
rharperon AWS, this can happen as well and on OpenStack19:36
rharperI would prefer to *skip* multi-nic DHCP until we know that we won't break primary nic networking configuration19:37
Gonerirharper, so basically,: if NIC is not primary and default_route_exists, then ignore default route19:37
rharperyes; the preference is to assign a route metric of lower priority for all nics but primary19:38
rharperor you can use route-tables19:38
Goneriok FreeBSD and NetBSD need to be adjusted too then.19:38
GoneriCould we put that aside for now and merge the current patch. I will prepare a set-up to test the setup that you describe.19:39
Goneriand come with a new patch that address this problem.19:39
rharperGoneri: I think that's reasonable since it's a general fix for all BSD networking19:39
GoneriI would also like to push a fix to clean up the devlist mess.19:39
rharperhttps://github.com/aws/ec2-net-utils/blob/master/ec2net-functions19:40
rharperthis is linux specific, but it may be of help to understand how it's solved on Ec219:40
GoneriYes, understood.19:41
rharperOdd_Bloke: I'm +1 on 147 now, with the note that Goneri will follow up to handle multi-nic DHCP (and other cleanups)19:42
Odd_BlokeNice, thanks!19:42
Odd_BlokeGoneri: #147 landed! \o/20:08
Goneriahah!20:08
GoneriI will refresh https://bsd-cloud-image.org/ later today.20:08
Gonerithanks meena Odd_Bloke and rharper for the review.20:22
blackboxswOdd_Bloke: sorry about missing the build recipe failures a few days ago, I had mistakenly thought it was just focal. but as you pointed out, xenial has been failing for a wihle.20:24
blackboxswso I stopped at fixing focal as I saw bionic eoan were fine. I forgot to look through xenial20:24
blackboxswworking that now20:24
blackboxswshould be minor20:24
rharperblackboxsw: that was me poking you on that ... I'm subscribed to the recipe failures20:31
Odd_Blokerharper: I poked him in privmsg because I was going to take a look if he wasn't already.20:31
rharperah20:32
rharperOdd_Bloke: thanks! =)20:32
blackboxswrharper/Odd_Bloke right. I fixed focal a few days ago, didn't realize that xenial patch was broken too20:32
blackboxswso that did fall through the cracks until Odd_Bloke pinging me pvt20:32
Odd_BlokeI'm not sure why I'm not getting those emails TBH.20:32
blackboxswprivately20:32
Odd_BlokeMaybe I'm filtering them, let me check.20:32
blackboxswOdd_Bloke: rharper so, we use SRU_BLOCKER/RELEASE_BLOCKER comment in cloud-init to give us a heads up about something that needs attention during the next SRU or RELEASE. I have to quilt refresh a number of patches at the moment on xenial, and I was wondering if either of you have a suggestion on a common comment prefix we can also use for resolved SRU/RELEASE blocker differences.20:50
blackboxswa common prefix would allow us to easily see in an ubuntu series if there are things patches that will remind us of differing behavior on other series20:51
blackboxswsince I have to refesh multiple debian/patches now it'd be nice to start instrumenting that "SRU_RESOLVED" maybe?20:52
blackboxswSRU_FIX?20:52
* blackboxsw goes with SRU_FIX unless there are firm objections20:53
blackboxswput up https://github.com/canonical/cloud-init/pull/28420:58
blackboxswfor review20:58
blackboxswI'm thinking we probably should also queue bionic and eoan with new-upstream-snapshot --skip-release just so we'll have a common changeset to look at once we actually do perform an SRU to those series in the future20:59
blackboxswwhat do you folks think? do this for bionic and eoan as well so daily recipes are building the same 'snapshots'20:59
blackboxsweven though build recipes aren't failing there20:59
* blackboxsw queues those for review pending discussion21:00
Odd_Blokeblackboxsw: The daily recipes merge master in, so they'd be building the same snapshot regardless, I think?21:00
blackboxswOdd_Bloke:21:00
* Odd_Bloke nods sagely in response.21:00
blackboxswI think so right. so functionally may not make a difference on finished deb.21:00
blackboxswhah21:00
blackboxswthough it'll make for vastly different xenial vs bionic/eoan on our next SRU21:01
Odd_BlokeWell, we'll still merge in master at that point to each branch.21:01
blackboxswbecause current fixed xenial  will have snapshotted up until today21:01
blackboxswyes bionic/eoan won't do that until we actually try to perform the next SRU21:01
Odd_BlokeWe aren't releasing these branches anywhere, we're essentially just fixing merge conflicts.21:01
blackboxswnot releasing, but at SRU time, we will review a PR like 284 for xenial and it'll be way different from the PR for bionic/eoan21:02
blackboxswbionic/eoan will be a lot bigger and will include what we will be pushing the upstream/ubuntu/xenial today21:02
Odd_BlokeWe don't really review those PR diffs, though, we basically just confirm that the uploader hasn't fat-fingered using the tooling.21:03
rharperblackboxsw: I think that's fine, we run the same tools on each branch21:03
Odd_Bloke(i.e. I'm not reading through that xenial diff, I'm reviewing it by performing the actions locally.)21:03
rharperso they can vary, but my output should match the PR21:03
rharperOdd_Bloke: exactly21:03
rharperI end up diffing my local branch against the PR21:04
rharperand the delta should be timestamps and names21:04
blackboxswahh roger21:04
blackboxswin that case it doesn't matter, for future of bionic/eoan21:04
blackboxswfor this xenial branch you'll see my diffs as well for the manual quilt refresh changes as I changed the patches a bit with the SRU_FIX prefix21:05
blackboxswI went through https://github.com/CanonicalLtd/uss-tableflip/blob/master/doc/ubuntu_release_process.md#when-the-daily-recipe-build-fails21:05
blackboxswrharper: are we ok with this response? https://github.com/canonical/cloud-init/pull/284#issuecomment-60469217621:20
blackboxswalso should I put up a doc PR  against uss-tableflip suggesting the use of SRU_FIX in patch comments ?21:20
blackboxswfor when we add new patches (like netplan eni priority in the near future)21:20
rharperblackboxsw: it wasn;t clear to me if you added any strings or just ran the steps from the docs ?21:33
rharperblackboxsw: I don't want to add any markers in the patches or code;  I'm just not going to remember to look21:33
rharperI just want to run the tools and compare branches21:33
blackboxswright rharper, but once https://github.com/canonical/cloud-init/pull/267 lands we need another patch and it'd be nice if that patch represented that it omitted content from ubuntu/bionic branch to retain original behavior21:35
blackboxswkindof like the existing requirements.txt patch comments that we aren't adding jsonschema deps to avoid changing behavior21:35
blackboxswexcept that comment and text currently is unstructured, so breadcrumbs are hard to find.21:36
blackboxswAlso we need to have some structure/procedure to track in cloud-init source certain features that we don't want to accidentally release into stable releases. And that convention currently is loosely SRU_BLOCKER in comments and no uss-tableflip documentation that says, hey make sure you double check during next sru that you aren't leaking unintented behavior21:37
blackboxsw*unintended behavior*21:37
Odd_Blokeblackboxsw: I can find that requirements.txt comment by looking through d/patches, I don't need to grep for it.21:38
Odd_BlokeIs it true of all the other modifications we make that they're in d/patches?21:39
blackboxswOdd_Bloke: good point. so maybe no prefix required on patched files21:39
Odd_BlokeIf so, then I think that's a better catalogue of changes than any manually managed prefix is going to give us.21:39
rharperblackboxsw: I suspect before adding the strings, we need a complete use-case and walk through what it will actually improve.   I can see a use-case for documenting behavioral differences between releases ...21:42
rharperbut let's set out with that in-mind and design a tool/process with the goal in mind;21:42
blackboxswOdd_Bloke: it's not a whole set of patches as we directly have adapted cloudinit/settings.py and debian/cloud-init.templates per release to enable datasources after the release goes stable21:44
blackboxswand there may be others.  but mostly debian/patches captures the majority of the functional differences in cloud-init source. not packaging diffs21:45
blackboxswrharper/Odd_Bloke: good points. so shall I leave the debian/patch comments untouched then. and just manually merge as best I can to avoid any other diff introduced by SRU_FIX prefix?21:47
blackboxswI have one approve at the moment21:47
blackboxswbut can alter that approach to keep the debian/patch diff smaller21:47
Odd_Blokerharper: blackboxsw: If either of you are looking for some small reviews to do, I've opened 4 small PRs that cleanup some more Py2 support code I found.21:56
blackboxswIm all about the smalls21:58
blackboxsw:)21:58
rharperblackboxsw: I would prefer to leave them untouched;  when you say "merge as best you can" what do you mean?22:05
blackboxswok rharper sorry force pushed 284. without comment changing liberties22:13
blackboxswdiff from yours should be smaller now22:13
blackboxswrharper: I meant manually merging the existing patch because quilt failed to update22:14
blackboxswnothing generally should be dropped, but it presented me with an opportunity I thought to standardize comments. But, I'm good not doing that. it's of limited use anyway22:15
blackboxswin manually merging a patch conflict, there really shouldn't be any changes unless upstream changed some subset of the exact lines of the patch file and there could be a possibility that the patch refresh author needs to make the appropriate manual decision on what functionally should remain after the patch (like if we have a variable renamed or something). So "merge as best you can" meant being smart about your22:17
blackboxswmanual choice when resolving that quilt patch update22:17
blackboxswrharper: I forgot to ping you again earlier on the netplan proiritization branch https://github.com/canonical/cloud-init/pull/267   do you think it needs a cloud_test to install ifupdown on focal to confirm behavior?22:19
blackboxswor shall we just chalk that into a manual one-off SRU/release test22:20
blackboxswI thought at standup I had missed review comments from you, but I don't see anything new there.22:20

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