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

akiki installed cloud-init on centos 7.3. i provide it the cloud-config through cloud-config-url kernel parameter. the cloud-config ends up in /etc/cloud/cloud.cfg.d/91_kernel_cmdline_url.cfg but it's not executed00:48
akik/usr/bin/cloud-init init seems to get it resolved, after strange timeouts01:21
akikwhat does this error message mean? url_helper.py[WARNING]: Calling 'http://169.254.169.254/2009-04-04/meta-data/instance-id' failed [6/120s]: unexpected error ['NoneType' object has not attribute 'status_code']02:06
akikthere seems to be a timeout of 120s02:07
akikDataSourceEc2.py[CRITICAL]: Giving up on md from ['http://169.254.169.254/2009-04-04/meta-data/instance-id'] after 120 seconds02:08
akikmy cloud-config contains just one user creation and two small local file creations02:08
akikok the problem seems to be connected to those two 120s tasks that just timeout02:10
akikone waiting for http://169.254.169.254/2009-04-04/meta-data/instance-id and the other waiting for http://192.168.137.1//latest/meta-data/instance-id02:10
naccakik: fwiw, most of the devs are probably afk right now03:03
akiknacc: looks like i need to configure libcloud's datasources for the correct environment where the vm is running?09:15
akikat this time, my home :)09:15
akikit's a centos vm running in hyper-v manager in win1010:13
=== shardy is now known as shardy_lunch
akikhow do i tell cloud-init on which iaas infra it's running on?12:18
akikis it the datasource: part in /etc/cloud/cloud.cfg ?12:19
akikds= kernel parameter?12:20
=== shardy_lunch is now known as shardy
akikbc -l12:31
akikoops12:31
smoserblackboxsw, your diagnosis above is correct. but you did scare me :)12:54
smoserakik, the error there is due to falling back to the ec2 metadata service.13:01
smoserthere is unfortunately really bad swallowing of the error for the nocloud url you provided.13:02
smoserah. akik what was in the url that you put ?13:03
smoserbut in order for this to work, the rm will have to be configured already to dhcp or whatever on the correct network interface.13:05
smoserie, be already configured to "dhcp on eth0" or the equivalent13:05
akiksmoser: i used cloud-config-url= to provide the cloud-config, but the provisioning timed out trying to access those two urls13:06
akikso i waited 4 minutes, and then cloud-init was able to apply the config to the vm13:07
smoserah.13:09
smoserok. so it sounds like you're just missing one thing.13:10
smoseryou provided some cloud-config, but it did not find a datasource.  that is just "config".13:10
smoserin the config that you provide, you can also data that will be seen as a datasource.13:10
smoserlet me find13:10
akikif i understood right, the cloud-config-url provides the user-data?13:15
smoserakik, from doc/examples/cloud-config-datasources.txt ... and ammended.13:16
smoser http://paste.ubuntu.com/25527448/13:16
akiki will be moving this image to azure eventually, but i'm now testing it on my local machine13:17
akiksmoser: is that for cloud.cfg?13:18
smoserthe thing to be aware of is the networkign configureation.13:18
smoserin order to get that url.... networking has to be configured :)13:19
akikor is it for the cloud-config-url to process?13:19
smoserso cloud-config-url does not provide a datasource. it just provides cloud-config from the command line.13:20
smoserso as you saw, it gets dumped into that file13:20
smoserand cloud-config can define a datasource13:20
smoseras i did in the paste there.13:20
akiksmoser: but do i need to start that file with #cloud-config ?13:20
smoserbasically cloud-config-url is just grabbed and dumped to the file, and then cloud-config goes on its merry way.13:20
smoseri dont think it does... but it wouldnt hurt :)13:21
akikthank you13:21
smoserakik, no problem. this is not a very well ridden path, but i do think it should work.13:28
akikyes what i'm doing is quite odd too13:29
akikazure vms have two provisioning "things" that can be installed simultaneously, waagent and cloud-init13:30
smoseryeah.13:30
smoseri'm well aware :)13:30
smoserthe goal is to replace the agent entirely13:30
smoserin newaest ubuntu releases, it is gone13:30
smoser(waagent that is)13:30
akikhow well does cloud-init support centos?13:30
smoserwell, recently  much better. but there are probably still some warts.13:31
smoserhelp is always welcome too :)13:31
akiki'll try that nocloud next13:31
smoserwhere'd you get your image ?13:31
akiki create it myself13:31
akikjust finished a shell script that builds the vhd in centos13:31
dpb1SRU is through!13:36
akikoh btw i had another question about cloud-init. in azure the vm gets by default the sudo configuration NOPASSWD:. is that intentional?13:37
akikand now i mean the ubuntu server 16.04 image from azure marketplace13:37
smoserakik, literally NOPASSWD:. ?13:40
smoserthe configured user should have passwordless sudo, yes.13:40
smoseras they have no password13:40
akikyes it's just weird how it's different from other ubuntu setups13:41
akiktell that on #ubuntu and they'll crucify you :)13:42
smoserakik, well, its a design decision.13:47
smoseryou have no password for that user by default13:48
smoserand thus, you can't really configure sudo access with a password13:48
smoserso you get ssh access in and sudo as that user.13:48
smoserso access to the ssh private key essentially provides your sudo auth.13:48
akikbut cloud-init still supports having a user password13:49
smosersure. and it will let you configure the sudo stanza too if you want.13:50
akikwas there some discussion about the NOPASSWD: on the mailing lists?13:53
smoserakik, well, no. this was proabbly 7 years ago. when ubuntu first got onto a cloud14:19
smoserakik, what would you *expect* to happen?14:19
smoserif you gave it a password, i could somewhat reasonably expect that it might configure the sudo for password auth14:19
smoserbut if you dont give it a password, it has no way to convey one to you, so the only acl it possibly has is ssh key.14:19
akiki'd give the user a password14:20
smoserin config?14:22
akikyes in cloud-config14:28
smoserthen i can see an argument for saying that sudo should have a password prompt also for that user.14:38
smoserits not somethign easily changed though due to being backwards compatible14:39
akiksmoser: i'd give the user also the ssh pubkey14:56
akikthat way using ubuntu in the cloud would feel the same as using it on the desktop15:01
powersjsmoser: rharper blackboxsw: this is the merge for xkvm into cloud-init15:19
powersjhttps://code.launchpad.net/~powersj/cloud-init/+git/cloud-init/+ref/add-xkvm15:19
powersjthat should be an easy one (?)15:19
akiki used the following data for cloud-config-url= kernel parameter. this time the data didn't end up in /etc/cloud/cloud.cfg.d. is there something obvious i need to fix in the data?15:40
akiki still get the timeouts for url_helper.py15:40
akikhad a bad paste. fixed paste here: https://pastebin.com/UVZtUwDB15:45
akikthere's a slightly different syntax for the datasource here http://cloudinit.readthedocs.io/en/latest/topics/examples.html15:47
akikshould i edit the default cloud.cfg that gets installed on centos from yum? the version is 0.7.515:49
smoserpowersj, ill pull16:04
powersjsmoser: do you want the base64 functions you wrote as a separate merge? and do you want them in the integration test util file or cloud-init's util file?16:07
smoserpart of the integration is fine. cloud-init doesn't really have any  use for them.16:12
akiki'm giving this on vm boot for the kernel: "ds=nocloud-net;s=URL". i have user-data and meta-data at URL. after booting up, i see in the log "DataSourceNoCloudNet [seed=cmdline][dsmode=net]". it looks like cloud-init didn't fetch those files17:05
blackboxswsmoser: pushed apport changes, because I couldn't help myself17:34
blackboxswwrapping up chef17:34
smoser\o/17:35
smoserok. lookoing.17:35
dpb1blackboxsw: that sounds fantastic17:36
rharpersmoser: blackboxsw: anything need eyes/reviews right now18:12
smoserblackboxsw,18:19
smosercan i drop "The schema definition for each cloud-config module is a strict contract for"18:19
smoser... ?18:19
smoserhttp://paste.ubuntu.com/25529138/18:21
smoser(per schema-resizefs-bootcmd)18:21
blackboxsw+1 smoser18:22
blackboxswhttps://trello.com/c/1xfreXAe/380-branches-to-land-for-cloud-init-release.  rharper, any of the unchecked in there except chef omnibus I think as I'm not done yet18:25
* blackboxsw is lunching 18:25
rharperk18:25
smoserblackboxsw, ok. i'm going to do that18:25
blackboxswOk thanks smoser18:26
smoserand also fix a vertical space in some tets18:26
dustymabehey team - i just submitted a PR for xfs issue on cloud-init19:10
dustymabehttps://code.launchpad.net/~dustymabe/cloud-init/+git/cloud-init/+merge/33070119:10
dustymabethis is my first PR, let me know if there is anything else i need to do19:10
powersjdustymabe: thanks for the PR! Do you recall if you signed the contrib agreement?19:12
dustymabepowersj: i don't remember signing anything19:12
dustymabei signed in using ubuntuone account (which i created a few years ago to try out the ubuntu phone stuff)19:13
dustymabeso... the answer is maybe, but not recently19:13
dustymabe:)19:13
dustymabethere should be some sort of blockchain that lists any terms you ever sign19:14
dustymabebillion dollar idea, there you go world19:14
dustymabepowersj: any tips on how to move forward?19:15
powersjdustymabe: yeah sorry was looking for the link19:15
powersjTake a look at: https://www.ubuntu.com/legal/contributors19:15
rharperpowersj: dustymabe: this is the boilerplate we'll put into the MP; http://paste.ubuntu.com/25529398/19:17
dustymaberharper: ok. what is the MP?19:18
rharpersorry, Merge Proposal (what you submitted)19:18
dustymaberharper: ahh. MP == PR19:18
dustymabecool19:18
rharpersimilar to Pull Request;  we suffer from launchpad  bzr language19:19
dustymabei'll read through the agreement and get back with you guys.19:19
rharperI'm added that;19:19
rharperin general, the fix looks good, commit msg looks sane; solid fix19:19
rharperthanks for submitting19:19
dustymaberharper: thanks :)19:19
dustymabei'll get back to you guys in the ticket about the agreement. i have to step away for a bit right now and i'll be back later19:20
rharperdustymabe: great, thanks19:21
smoserblackboxsw, if you're bored. . i was looking at that branch. i tried to take the duplicated FakeExtendedTempFile19:34
smosertake it out.19:34
powersjsmoser: if you can get to the string merge today, I can rebase the KVM merge and get another round of testing on it. https://code.launchpad.net/~powersj/cloud-init/+git/cloud-init/+merge/33053519:46
smoserpowersj, ok.19:48
akikhere's an improvement suggestion to the documentation. in http://cloudinit.readthedocs.io/en/latest/topics/datasources/nocloud.html it should be mentioned that ds=nocloud-net and seedfrom= should be separated with "\;". if you just use ";" the kernel parameter loses everything starting with ";"19:49
smoserakik, i think that proably not true19:51
smoserprobably your shell is eating it19:51
akiksmoser: i just tested it19:56
akikon centos 7.319:57
smoserakik, can you show how you did that ?19:58
akikfirst i entered ds=nocloud-net;seedfrom=URL as the kernel parameter. ;seedfrom=URL was cut20:00
smoser"entered"20:00
smoserwhere20:00
akikthen i entered ds=nocloud-net\;seedfrom=URL and it stayed. in grub20:00
smoserwell, its probably grub that is eating it then. or if its grub-2 , possibly some of the magic make-menu stuff20:01
akikit's grub220:01
smoserbut i'm pretty sure the kernel doesnt care about a ';'20:01
akikon centos it's split there without \20:02
=== nacc_ is now known as nacc
akikthe rest goes *poof*20:02
rharperit feels worth a Note or something in case it happens to someone else; ie, you may need to escape the semi-colon if your distro uses scripts to update the grub command line ?20:03
akikrharper: no i mean for the *current* boot20:03
akikpress e to edit, ctrl-x to boot20:03
rharperoh, that's grub itself20:03
rharperthe note may still apply (live editing or distro config tools)20:04
rharperbut as smoser said, the *kernel* doesn't care about semicolons20:04
rharperthe kerenl isn't running at the time you're editing the grub command line20:04
smoserso yeah. in grub2, you're typing20:05
smoserlinux /something root=foo key=val ds=nocloud-net;other stuff20:05
akiksmoser: yes20:05
smoserand grub p robably prints an error quickly and goes on as it read your ; as end of a command20:05
smoserso it probably tried to execute 'other stuff'20:05
smoserand failed20:05
smoseri'd be surprised if you can't do:20:05
smoser linux /boot/kernel 'root=.... ds=;other stuff'20:06
akiki checked /proc/cmdline after boot and it just had "ds=nocloud-net"20:06
smoseryeah. grub ate it.20:06
smosersame as if you type in a bash prompt20:06
smoser$ echo foo;other stuff20:06
smoserfoo20:06
smoserother: command not found20:06
akiki'm not talking about shell. it's not the same20:07
rharperhttps://www.gnu.org/software/grub/manual/grub/grub.html#Shell_002dlike-scripting20:07
naccakik: grub's shell is shell-like :)20:07
rharperactually it is20:07
smoserit is the same :)20:07
smosergrub is parsing that and tokenizing on the ;20:07
* smoser has to step away for a bit20:08
cliffwTrying to use cloud-init to setup aliases to eth0 using network configuration, details are being passed using EC2 user-data but nothing seems to work. The docs state user-data cannot be used to setup networking, but also say networking can be setup using data sources. EC2 is a valid data source. Any ideas?21:16
cliffwubuntu 16.04 by the way.21:17
* blackboxsw lobs cliffw the examples at http://cloudinit.readthedocs.io/en/latest/topics/network-config-format-v1.html wondering if you are referring to these docs which mention aliases?21:21
rharpercliffw: for network-based datasources (like EC2); the datasource has to do the work to generate a network-config based on cloud metadata;  AWS/EC2 has this info but the DataSource is just becoming network aware; blackboxsw has been working on that;  we don't currently parse all of the EC2 metadata for generating a complete nework configuration.21:24
* rharper has to relocate21:28
cliffwIf I need to create a /etc/cloud/cloud.cfg.d/custom-networking.cfg can I do that in #cloud-config using write_files:21:29
cliffwJust tried that, the config gets written out, but no network changes occur.21:47
akikdoes cloud-init touch /etc/udev/rules.d/70-persistent-net.rules? i've set it to be immutable but the log says "failed stage init" after that. not sure if they're connected22:02
akiki see that cloud-init version changed to 0.7.9 on centos22:04
smoserakik, it does touch it yes.22:14
akiksmoser: how do i make it not touch it? i don't want the device names to change, ever22:14
smosercliffw, by the time that is read, its too late. cluod-init has already made the decision and rendered thenetworking configuraiton.22:14
smoserakik, well, what cluod-init is doing is ensuring that they dont22:15
smoserbut you can disable cloud-init networking and it wont do such things22:15
smoser# To disable cloud-init's network configuration capabilities, write a file22:16
smoser# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:22:16
smoser# network: {config: disabled}22:16
akikso cloud-init does other stuff than what i direct it to do in user-data?22:16
akikthanks for the config22:17
smoserit has some default behaviors.  generally speaking it does the right thing for configuring networking22:18
smoserthats the goal22:18
akiksmoser: if i disable cloud-init networking, is it still able to download if i use ds=nocloud-net?22:22
akikdownload the user-data from that datasource22:22
blackboxswok finally fixed up chef module unit tests and addressed review comments will await CI and then land it22:24
blackboxswgrr, smoser, so we've moved tempdir out  into cloudinit.temp_util to avoid loading a ton of util for tempfile work. Now cc_chef adds util.subp_blob_in_tempfile  which depends on temp_utils.tempdir. Where should subp_blob_in_tempfile live?22:33
blackboxsws/grr/question/22:33
blackboxsw:)22:33
* blackboxsw thinks it should remain definted in util and just locally import temp_utils.tempdir inside subp_blob_in_tempfile22:42
blackboxswahh n/m we already import temp_utils in util anyway22:42
blackboxswok /me runs away. please disregard22:43
cliffwthanks smoser23:20
cliffwLaunching the EC2 instances in question from Cloudformation, so trying to have the network setup which Cloudformation handles at the EC2 level be handled also by cloud-init, so I don't have to hardcode config files or wait for a subsequent puppet run for eth0 aliases to be established.23:25
cliffwhave an EC2 with 5 IP addresses associated with it, as a default eth0 booting with DHCP only finds the primary in Ubuntu.23:25

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