/srv/irclogs.ubuntu.com/2017/12/05/#cloud-init.txt

smoserblackboxsw: i pushed there.01:32
=== Wulf4 is now known as Wulf
ybaumymoin. how do i setup nocloud correctly? i added this datasource: NoCloud: to cloud-init.cfg but im getting an error on first boot. and on disable ec2 im getting an error too. http://paste.ubuntu.com/26116710/06:09
ybaumyversion is now cloud-init-17.1+46.g7acc9e68-1.el7.centos.noarch06:10
ybaumystrangely this didnt happen yesterday. but now i created a new vmware image template and then added a host to foreman06:11
ybaumymaybe i should use ansible to setup puppet and the rest09:00
ybaumyi was using cloud-init with openstack and that was ok. but that datasource nocloud thing i dont get09:04
smoserybaumy: i'm not sure about the first issue with ec2 disable.  there is probably something in /var/log/cloud-init-output.log or /var/log/cloud-init.log (you could pastebin the whole of both would be helpful)14:27
smoserfor nocloud you'd need to give mreo data... not sure what would cause there to be no md (metadata) on that object.14:27
smoserfor setting up nocloud, i suggest using 'cloud-localds' http://paste.ubuntu.com/26118885/14:28
smoserbut basically nocloud is a attached disk in either iso or vfat that has a 'user-data' and 'meta-data' on them. meta-data is yaml formated, and expected to have 'instance-id'.14:29
ybaumysmoser: i think i dont need all of that nocloud parameters. i only want to setup puppet and thats about it. i feel like im breaking a leg here for that to do.14:56
smoserits nto a lot of parameters.14:56
smoserinstance-id14:56
smoseri'm only suggesting using cloud-localds to get you a disk so you dont have to worry about impmlementation, and you can see a working example.14:57
ybaumyok14:58
robjosmoser: blackboxsw rharper Could I please get some feedback on the chrony support? See mailing list message dated 11/14 "RFQ chrony support" which should of course have been "RFC"15:02
smoser:-(15:03
smoseryeah, that is fair15:03
=== shardy is now known as shardy_afk
ybaumysmoser: how do i create a new instance-id for each cloned vmware image15:13
ybaumyi guess they have to be unique15:14
ybaumyhmm i could make a firstboot scripts that runs before cloud-init15:15
smoserybaumy: just attach different data in a disk, no ?15:16
smoseri'm confused.15:16
smoserinstance-id=$(uuidgen)15:16
smoserso i'm missing something for sure.15:16
ybaumyim confused as well15:16
ybaumyok let me explain what i want to do15:17
ybaumyi have a vmware template that is centos. then i want to automatically deploy this image with foreman and register it to the katello part15:18
ybaumytherefor i need puppet integration15:18
ybaumythe puppet part i still not working 100% but 90%15:18
ybaumyso i thought using nocloud datasource is the best solution when running cloud-init15:19
smoserok. so i think youa ve a couple options15:19
smosera.) vmware has an "OVF" datasource that should mostly do what you're wondering about.15:19
smoseri really have no familiarity with it  vmware though.15:20
smoserb.) when you create a new "instance" (that is 'automatically deploy') you can create a second disk and attach it with the necessary NoCloud data15:21
smoserc.) you can just put NoCloud data into each image hard coded in /var/lib/cloud/seed/nocloud-net. it will just never change, you'll have to find some other way to identify individual systems or give them specific instructions.15:22
smoserthe 'instance-id' is really just a bit of information specific to this instance.15:22
smoserit allows cloud-inti to do things that should only be done on a "new instance".15:22
ybaumysmoser: c) sounds th ebest option. since all the custom parts are run through puppet when it is setup15:22
smoserbut what does puppet use to determine what their role is15:23
smoserif 100 things come and say "hi puppet master" all at the same time, how does it decide what is supposed to do what?15:23
ybaumyforeman has hostgroups which is a customer and all those hostgroups have different parameters for puppet15:23
smoserand hostgroups are based on ?15:24
smoserhostnames ? which you're providing ?15:24
smoserhow does the instance know its hostname?15:24
ybaumyso i just create a host put it in a hostgroup which inherits all parameters for that hostgroup15:24
ybaumyhostname gets through dhcp on the first setup before customizing15:25
ybaumyhostgroups are just groups with different attributes and parameters15:25
ybaumyits really cool15:26
ybaumyi will try c) now15:27
ybaumylets see how far i get15:27
smoserare you using cloud-inti for anything else ?15:28
smoserdoes it do anything for you?15:28
ybaumynope just puppet i need15:28
smoserthen you can just disable cloud-init entirely.15:29
ybaumyok and use what?15:29
smosernothign ?15:29
smoseryou said it doesnt do anything for you15:29
ybaumywell there is the problem with proxy servers on subnets15:29
ybaumyso i need a instance i can tell which proxy server the puppet.conf should hold15:30
ybaumyproxy server=pupetmaster15:30
smoserdoes foreman provide any endpoint that the node can query to learn about itself? other than the dhcp server ?15:31
ybaumybut maybe you are right and should just script it msyself15:31
ybaumywell there is remote ssh execution15:32
ybaumyfor example15:32
ybaumyi could use ansible to register the host and setup puppet as well15:32
smoserit seems like forman kind of needs a mechanism by which a node can query its parameters15:33
smoserwhich is basically what a datasource is to cloud-init15:33
smoserthen the node would look and see what proxy settings it had and what it was supposed to do.15:33
ybaumythats what i thought yesterday15:33
smoserother wise you're just deploying dozens of clones that differ only in hostname15:34
smoserif you can provide hostnames you could manufacture them such that they indicate some information15:34
smosergroup1-name115:34
ybaumythere are clones as long as they havent contacted the puppetmaster15:35
smoserand then in code inside key off 'group1' to know the hard coded proxy server.15:35
ybaumybut you are right15:35
ybaumyi should find another way to setup servername in puppet.conf15:36
ybaumythis just doesnt work15:36
ybaumysince cloud-init.cfg is not generated15:37
ybaumydepending on the hostgroup15:37
smoseryou should convince foreman that they need a node-facing endpiont15:38
smoserand then write a datasource for cloud-init to utilize that.15:38
ybaumyit kind of lacks this feature i must saa15:39
ybaumysay15:39
smoseryou need to have *some* id for a node15:39
ybaumyhttps://theforeman.org/plugins/foreman_ansible/0.x/index.html i guess this what im trying now15:40
ybaumybut in the end its the same problem15:41
ybaumyi need a foreman_url15:41
ybaumywhich is the proxy puppetmaster in the end15:41
ybaumyi have think about it15:41
=== shardy_afk is now known as shardy
ybaumyi think i need a installtion network15:48
ybaumythen its always the same15:48
ybaumyserver15:48
ybaumyif i dont have a datasource15:49
ybaumythere is no other way i can see15:49
=== Wulf4 is now known as Wulf
smoserrobjo: https://hackmd.io/CwEwHARgbAzDDsBaArPOjhQMYEZEEMBOHQjQkeAUxgCYb9h8og==17:24
smoserblackboxsw, rharper17:24
smoseralso. interested in feedback there.17:24
robjosmoser: added some comments18:23
dojordan@blackboxsw sorry to bump, but can you take a look when you get a chance? https://code.launchpad.net/~dojordan/cloud-init/+git/cloud-init/+merge/33434118:37
blackboxswGood deal dojordan I have context on an azure deployment right now so I'll test it out and see if we can labd it today18:48
blackboxsw'land' rather18:48
dojordangreat, thanks! feel free to ping with questions18:52
dojordanalso note that the platform doesn't publicly support it yet so I've been testing the azure fabric changes in private test clusters. I have the logs from that if need be18:53
rharpersmoser: is there an easy way to modify the prposed-branche and merge-into for MP ?19:00
smoserrobjo: thanks. i responded theer.19:05
smoserwe can carry on here. also19:05
smoserrharper: ?19:05
rharperhttps://code.launchpad.net/~cloud-init-dev/cloud-init/+git/cloud-init/+merge/33473319:05
rharperthe targets need swapping19:05
smoser:)19:05
smoserrharper: so.. interestingly, i could 'resubmit' that proposal and swap the source and target19:10
smoserwhich is not really re-submitting19:10
smoserbut i only saw that i could do that after i had already submitted another.19:11
smoserso, commented there to that affect.19:11
rharperok, thanks19:11
rharperI didn't know that either19:11
rharpersmoser: ntp discuss sounds fine, you've a few isc-dhcp where I think  you mean isc-ntp;19:16
robjomore comment sin the hackmd.io document, but maye we should move the discussion here to be more interactive?19:27
smoserah. yeah. probably.19:33
smoserrobjo: yes that is fine.s orry19:33
robjoTo my last comment, my concern is primarily with the "custom image builders" and the expectation that is implied in "auto", i.e. it just works19:34
smoserrharper: fixed rthose.19:35
robjoIf we use auto and there's no other mechanism then basically the cloud-init package on SUSE would have to supply a /etc/cloud/cloud.cfg.d/00-distro.cfg19:36
robjowhich of course the "cutom image builder" can mess up more easily than having something in the cloud-init code that handle "auto" in some deterministic way that is "distro default" compliant19:37
robjoBut maybe I am overthinking the problem19:37
smoserrobjo: in your scenario, wouldnt the user have likely had cloud-init installed from a package you maintain ?19:37
smoserin which case it would have a setting not 'auto'.19:37
smoserand would Depend on the right client19:37
robjoWell it appears that lost of custom image builders decide to clobber the default cloud.cfg and thus I'd say the answer is no19:38
smoser"I changed something and broke it"19:39
smoser?19:39
robjoI see people reading teh doc, then put in their own cloud.cfg and set "ntp: enabled", done19:39
blackboxswright, I would expect this 'auto' problem only to show up on Sles/OpenSuse if the custom image builder is not installing stock sles cloud-init via yast, but rolling their own off of lp:cloud-init master19:39
rharperwouldn't the distro object itself in code have a preference?  the system config is for overriding the built-in-code preference, no ?19:39
robjowell the "in-code" preference only works if I have a "if distro.version == X:" block19:40
rharpermuch like how we set locale by default, or other distro specific settings, default in the code, but allow system settings to override;  default net renderer is another like these where code has a default preference, and allowing system config to override19:40
smoser'auto' will generally do the right thing.  You're free to have 'auto' on Suse have different "right thing" than on Ubuntu.19:40
robjowhich means I have to read os-relese file and that gets me back to my testing issue :(19:40
smoserBut I think giving preference to already installed clients versus non-installed clients is important.19:40
smoserwe can fix your tests. i agree those tests are in need of re-factoring.19:41
smoserblackboxsw or I can help with tests.19:41
robjoagreed with the preference to installed clients, and maybe that in the end is the solution19:41
rharperI'm not sure what's wrong with reading os-release?  if SLES vs OpenSuSE have different default clients for ntp; that can be accomodated in the distro classes, right?19:41
smoserit would seem quite reasonable for the 'distro' object that is instantiated to "know" more about the speficis than it does.19:42
* blackboxsw loves mocks, yeah if we want some simple targeted mock ups or unit tests on a agreed upon direction, I'm game for helping out19:42
robjoit's SLES vs. SLES, not SLES vs openSUSE19:42
smoser:)19:42
rharperah19:42
robjoSLES 12 -> ntp, SLES 15 -> chrony19:42
robjoso sles.py gets loaded and tere I have to make a decision19:42
rharperyes;  we're in similar situation Xenial will carry one preference, where as bionic will likely use something different19:43
smoseri think reading os-release is fine.19:43
rharpereven in the presence of a default installed client (timesyncd in this case)19:43
smoserin Ubuntu i'mi fine with carrying a package patch to maintain old behavior even if upstream cloud-init changes..19:44
rharperI would thnk the distro object probably already has the system_info structure which has that detail any how, right ?19:44
smoserand if someone builds their own package, or starts wiping out files installed by cloud-init or any other package when they build their image....19:44
smoseri dont really see how that is my problem :)19:44
robjoIcan build teh package such that on SLES 12 cloud-init delivers /etc/cloud/cloud.cfg.d/00-distro.cfg with system_info['ntp_client'] = ntp and on SLES 15 that's set to chrony, and that's fair, just pointing out that that was not necessary previously and is also reasonably easy to break19:44
smosermake the change in /etc/cloud/cloud.cfg19:45
smoserand if the user changes it or blows that file away, then it will default to auto19:45
smoserand auto will do the right thing19:45
smosereven including looking at /etc/os-release19:45
smoserbut pleease preferring installed clients over non-installed clients.19:46
robjorharper: system_info does not have distro version19:46
rharpermight not include release number19:46
rharperplatform.linux_distribution()19:46
rharper('Ubuntu', '16.04', 'xenial')19:46
rharper 19:46
rharperthat seems pretty specific19:47
robjoworse for me openSUSE and SLES have the same data, which is why handling flavor and distro on SLES/openSUSE is a three way ball juggling exercise ;)19:47
robjoah I was looking down the path of determining "flavor" and there we do not look at that information.19:49
robjoSo yes, platform.linux_distribution() would do the trick19:50
blackboxswsmoser: rharper    hrm, so kvm-wise, I've used mount-image-callback to install a new cloud-init deb in the cloudimage I downloaded. Though it seems that the generator hasn't run because cloud-init is no longer configured as a listed systemd dependency in xenial in this image21:14
blackboxswshould I have done something additional (beyond the mchroot dpkg -i new-cloud-init.deb)?21:14
rharperno21:14
rharperit's never listed as a dep21:14
rharperall generators in /lib/systemd/generators/* are invoked, there I think is a link to the cloud-init one21:14
rharper/lib/systemd/system-generators/cloud-init-generator21:15
rharpersystemd runs that, which in turn checks for the kernel parameters or disabled file, and if so, leaves things off; otherwise it'll run and import ds-identify stuff, which will result in cloud-init getting enabled via a dynamic link in multi-user.target.wants/21:16
rharperin /run21:16
rharper /run/systemd/generator-early I think21:16
rharperbbiab21:16
* rharper relocates21:16
smoserblackboxsw: updated https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/33351322:23
blackboxswgrabbing22:23
smoserif you agree with my suggested change then we can pull22:24
blackboxswyeah that makes sense smoser will apply and land.22:24
blackboxswjust ran into (and am fixing with a trivial) https://bugs.launchpad.net/cloud-init/+bug/173660022:25
ubot5Launchpad bug 1736600 in cloud-init "cloud-init modules -h documents unsupported --mode init" [Low,Triaged]22:25
blackboxswjust finished testing ovf with msaika's changes22:25
blackboxswlooks to work without impacted standard ovf behavior with one curiousity.22:25
blackboxswif I rm -rf /var/log/cloud* /var/lib/cloud; sudo reboot    on the kvm machine with the updated locally installed deb package cloud-init doesn't run by default, I had to cloud-init init --local; cloud-init init, cloud-init modules --mode config ... --mode final .22:26
rharperblackboxsw: did your ovf test use no-cloud ?22:28
rharperif so, you nuked your /var/lib/cloud/seed/no-cloud22:28
rharperwhich means ds-identify won't enable cloud-init22:28
blackboxswhrm yes I think I did... and I nuked seed (which contained nothing)22:28
rharperblackboxsw: aren't you working on a cloud-init clean to DTRT so we don't have to rm -rf /var/lib/cloud*22:28
rharperbut22:28
smoserugh22:28
* smoser sees22:28
smoser tests/cloud_tests/testcases/modules/salt_minion.py22:28
rharperit's presense triggers cloud-init22:28
blackboxswahhh22:29
smoserand says what is going on there ?22:29
blackboxswoops22:29
blackboxswright22:29
smoseroh. cloud_tests. silly me22:29
blackboxswand rharper yeah that branch cloud-init clean is minutes from landing22:29
blackboxsw:)22:29
rharper=)22:29
blackboxswthen I don't have to worry about shooting myself in the foot22:29
rharperI know smoser really wants to relocate seed to somewhere else outside of /var/lib/cloud22:29
* rharper relocates home22:30
rharperbbiab22:30
blackboxswmsaika is also using the seed directory for vmware's markefiles too22:30
blackboxswand that branch is emminent22:30
blackboxswhttps://code.launchpad.net/~msaikia/cloud-init/+git/cloud-init/+merge/33010522:30
smoserugh. markerfiles shoud go in /var/lib/cloud/data, no?22:30
smoserwas there  a reason for seed?22:30
smoserpowersj: or anyone who wanted22:31
smoser https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/33478022:31
blackboxswstrike that comment about /var/lib/cloud/seed ... looks like the marker files are just in /var/lib/cloud/<markerfile>22:31
powersjsmoser: thx I'll play with that next22:32
blackboxswsmoser: still time to comment that. She's around all week (per pvt msg).22:32
blackboxswsmoser: I'll suggest the path change22:32
blackboxswmarkefiles were  originally under / and I wanted something that cloud-init clean would still blow away22:33
smoseroh i see.22:37
smoseri have to read it to know what mnarker files are for. i forget in thatcontext22:37
smoseri also approved https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/33011522:37
smoserblackboxsw: did you aggree/disagree with my comment on 333513 ?22:38
* blackboxsw wonders if we should suggest the same makerpath changes for https://code.launchpad.net/~dojordan/cloud-init/+git/cloud-init/+merge/334341 dojordan is doing something kinda similary with markerfiles for azure22:39
blackboxswsmoser: right yeah vmware is using them user-provided customization scripts which run pre-and post-cloud-init network configuration in vmware's get_data() method22:44
* smoser is behind on reviews22:54
smoserand hasto run now.22:54
dojordanFWIW the marker file in my PR won't exist once the actual provisioning is completed. therefore by the time you can login and run clean, the file will be gone23:03

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