/srv/irclogs.ubuntu.com/2015/03/31/#cloud-init.txt

=== harlowja_ is now known as harlowja_away
fish_hi10:44
fish_I'm building a ubuntu AMI from scratch and use cloud-init. when finished building the AMI, /var/lib/upstart is there but after I boot it's gone and I don't have any upstat logs. wondering if this might be related to cloud-init10:45
Odd_Blokefish_: Do you mean /var/log?10:46
fish_Odd_Bloke: ehh sorry, yes sure /var/log/upstart10:48
Odd_Blokefish_: I would be surprised if cloud-init were doing anything to /var/log/upstart, but smoser could probably tell you more.10:49
fish_Odd_Bloke: hrm okay, any ideas what might cause it beside cloud-init?10:50
fish_I found this: https://bugs.launchpad.net/ubuntu/+source/cloud-init/+bug/990102 - unfortunately (and a great example why important) it doesn't mention the commit this was fixed10:50
Odd_Blokefish_: Well, that wasn't a cloud-init bug, it was a problem with the cloud images.10:52
Odd_Blokefish_: Which was fixed ~3 years ago. :)10:53
fish_Odd_Bloke: I know, I just ask here because cloud-init is the only thing I *expect* to change stuff on the system on first boot :)10:53
fish_but yes, there is probably something else tampering with /var/log on first? boot10:53
Odd_Blokefish_: Are you sure /var/log/upstart is actually included in your image?10:54
fish_Odd_Bloke: I know the bug is old, but I suspect it's the same root cause as in my cause (they tried the same - building AMIs)10:54
fish_Odd_Bloke: yes, I'm I double checked that10:54
Odd_Blokefish_: Out of interest, why not build your image based on the images at cloud-images.ubuntu.com?10:55
fish_Odd_Bloke: well, I want to actually build the images (vs starting a instance and snapshotting) - I actually wrote a few words about why (+how) here: http://5pi.de/2015/03/13/building-aws-amis-from-scratch/ but tl;dr10:56
fish_I want the AMIs small and a clean separation between run and built-time10:57
Odd_Blokefish_: Right, but why not take the images from there and modify them by mounting them?10:57
fish_Odd_Bloke: that's an option.. deboostrap seemed more straight forward. do you think there are advantages in using the cloud-images directly? also worried about security updates because I want the amis to be pretty much immutable (well, at least I don't want to run config management etc on top to keep things up to date)10:59
fish_but I just realize that I'm wrong, the resulting image indeed has no /var/log/upstart.. now I'm confused since I added a 'mkdir /var/log/upstart' to my build process which failed because it was there already.. looks like something during the build removes it11:00
Odd_Blokefish_: Well, using the Ubuntu images would (probably) have saved you from this bug, for example.11:01
Odd_BlokeAnd you presumably have the same problem with security updates whoever is building the images?11:01
Odd_BlokeIn your modification process, an "apt-get -y update; apt-get -y upgrade" would pull in any security updates the same as installing from scratch.11:02
fish_hrm yes that's true.. well, I simply used debootstrap because it seemed like the right tool to use. but yeah, it's definitely a good option to use the cloud-images, will consider that11:03
smoserfish_, generally speaking, i really dont think you should build your own images.12:57
smoserany more than i think you should build your own kernel, or your own python or elibc.12:58
smoseryou're certainly welcome to do it, and tools are availalbe to do so.  but doing so means you get to re-discover bugs which are fixed.12:58
smoserthe process that I would recommend, is12:59
smoser * download cloud image12:59
smoser * mount-image-callback --system-mounts --system-resolvconf $IMAGE -- chroot _MOUNTPOINT bash -s < your-update-script13:00
smoserand 'your-update-script' does things like: 13:00
smoser apt-get update13:00
smoser apt-get install foo13:00
smoser apt-get clean13:00
smoserthe above does require root, which is less than ideal, but 13:01
smosera.) if you don't trust the ubuntu images, you're kind of SOL anyway13:01
smoserb.) you can just run that in a VM to alleviate potential mount based attacks.13:01
fish_smoser: yes, the more I think about that the more it makes sense. for now, things are working and I'm about to roll that out, but in the next iteration I'll definitely look into that13:15
fish_I use a intermediate "base" image to avoid running a fresh deboostrap for every update anyways, so it should be fairely easy to use a cloud-image instead13:16
smoserfwiw, the maas-images build process does essentially the above.13:20
=== zz_gondoi is now known as gondoi
=== gondoi is now known as zz_gondoi
=== harlowja_away is now known as harlowja_
harlowja_claudiupopa i think we might have to remove the channel from https://review.openstack.org/#/c/169293/16:46
harlowja_its gonna be hard to get an operator in this channel without kicking everyone out (which nobody has the permission to do)16:46
harlowja_so might have to just skip that part16:46
harlowja_years ago i think we all forgot to setup this channel with an operator and its pretty hard to do it post-creation16:47
harlowja_*afaik*16:49
smoserharlowja_, why didn't you ever add 'tar' to the write_files. and http:// 16:52
smosers/you/me/16:52
harlowja_hmmm16:52
harlowja_or was that me?16:52
harlowja_idk16:52
harlowja_haha16:52
smoserie, would be nice to have write_files either read content from a url16:52
smoseror read a tarball from url and extract it into a target dir.16:53
* harlowja_ looking16:53
smoserhttp://paste.ubuntu.com/10691441/16:53
smoserthat is what i have, but having those 2 big blobs as 'path: http://' would have been nice.16:54
smoserand then also:16:54
smoser path: http://16:54
smoser format: tar16:54
smoser extract-dir: /writable/user-data/cloud-init16:54
smoseror something16:54
harlowja_hmmm, ya why did we do that, ha16:54
harlowja_msg: ":::::: Hi Mom :::::::"16:56
harlowja_lol16:56
harlowja_hmmmm16:56
harlowja_seems like we should just do that... (allow url stufF)16:57
harlowja_and tar16:57
harlowja_guess maybe we just didn't think of it ?16:57
smoseryeah, i think we just didnt. 17:09
smoserthe inline makes sense.17:09
smoseras you may not have networking at that point.17:09
smoserbut if you do have networking, then http:// makes good sense.17:09
smoserand tar is just a nice archive format :)17:09
harlowja_:-P17:17
harlowja_shall i code that up or u want to?17:17
harlowja_pop out the codes17:17
harlowja_lol17:17
harlowja_smoser ^17:37
harlowja_smoser https://code.launchpad.net/~harlowja/cloud-init/write-files-fetch-from-somewhere/+merge/25481619:12
harlowja_ok thats part 1 (no tar)19:12
harlowja_should be mostly ok, ha19:12
smoserpython3... 19:13
harlowja_ya, durn it19:13
smoserpre_content comes as binary... pretty sure (or we ant to make sure it is)19:13
smoserand then we want to write content without conversion19:13
harlowja_will make sure19:14
harlowja_load_tfile_or_url does that i guess19:14
smosertfile loads text19:14
smoserew want blobs of unadulterated raw data19:14
harlowja_kk, let me check here19:14
harlowja_stupid stff19:14
harlowja_lol19:14
harlowja_*stuff19:14
* harlowja_ goes and builds up my 3.4 venv19:15
smoserharlowja_, see why i said i hate pypi19:19
harlowja_lol19:19
harlowja_ya19:19
smoseroh darn, some dude's cable modem is out19:19
smoserpypi fail19:19
harlowja_lol19:19
harlowja_ok dokie; added some tests and stuff; seems to work as expected19:47
harlowja_at least under basic tests19:48
harlowja_smoser check that out if u want19:51
smoserharlowja_, thanks.19:57
harlowja_np19:58
Odd_Blokesmoser: Am I right in thinking that vendor-data simply isn't a thing in the version of cloud-init in precise?20:19
smoserright . not at all.20:28
smoserOdd_Bloke, i'd sponsor an sru20:28
harlowja_precise is 12.04 right?20:28
Odd_Blokeharlowja_: Yeah.20:28
harlowja_k, can't ever remember the codenames, lol20:28
=== harlowja_ is now known as harlowja_away
tmclaugh[work]I want to set hostname to the aws instance ID.  Is there a var available for doing that ot do I have to use some commands during bootcmd to handle this?22:07
=== harlowja_away is now known as harlowja_

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