=== zz_gondoi is now known as gondoi === gondoi is now known as zz_gondoi [09:55] Hello! I am trying to use cloud-init with FOG and rackspace, but am failing miserably. It seems that my mime encoded cloudinit script is properly copied to /var/lib/cloud/seed/nocloud-net/user-data , but it doesnt appear to be run... not sure where I should look to see whats wrong... any idea? the rackspace examples I found on the web didnt work === zz_gondoi is now known as gondoi === gondoi is now known as zz_gondoi === zz_gondoi is now known as gondoi [14:23] SpamapS, yeah, i have creds to that private key. [14:23] but it is separate by design from my private key. [14:23] i'll sign it and upload [14:26] yann2: Does the script work when it's not mime encoded? [14:27] yann2: Also, there's a log file in /var/log/cloud-init.log [14:27] jclift, yes, actually I got it to run using nova client [14:28] k, so it sounds like the mime encoding is busting it somehow [14:28] yann2: I've not tried using mime encoded version [14:28] yann2: At a guess, you'll probably need to look through /var/log/cloud-init.log to see if there's anything there [14:29] trying this now http://pastealacon.com/34262 - I think the problem is that rackspace only tries to get cloud init files from config disks by default and not from /var [14:30] jclift, the only error seem to be unrelated and linked to a "ubuntu" user that is not found.. the rest seems to be rackspace stuf [14:31] 2014-04-07 14:27:13,937 - __init__.py[WARNING]: Unhandled non-multipart userdata ' < maybe that [14:31] yann2: Hmmm, I don't use Ubuntu so no idea there [14:31] Yeah, that warning could be significant [14:32] yann2: Are you able to put your proper #cloud-config file on a webserver somewhere, and then point to it using an #include? [14:32] yann2: This is what I use as a #cloud-config file: https://forge.gluster.org/glusterfs-rackspace-regression-tester/glusterfs-rackspace-regression-tester/blobs/raw/master/remote_centos6.cfg [14:32] There is also this file in /etc/cloud/cloud.cfg.d/90_dpkg.cfg that contains this datasource_list: [ ConfigDrive ] [14:33] so I assume my only way to include additional cloud init config would be via the configdrive... [14:33] yann2: I pass that remote_centos6.cfg in to the local VM via config drive, and then cloud-init goes and retrieves the external URLs itself [14:34] yann2: Is the mime-encoded script showing up in /var/lib/cloud/instance/user_data ? [14:34] Or /var/lib/cloud/instance/user_data.i ? [14:35] jclift, cf my last paste, I am now trying to see if I can pass the cloud init file directly to the config file, a bit like the nova client does here http://developer.rackspace.com/blog/using-cloud-init-with-rackspace-cloud.html [14:37] yann2: I'm using cloud-init with Pyrax in rackspace [14:37] but otherwise, yeah, when i used to copy files using personality, the file showed up mime encoded at the right place ('/var/lib/cloud/seed/nocloud-net/user-data' ) but I think cloud init is not configured to read it [14:38] jclift, and where do you put the cloud init configuration? [14:38] Unfortunately, it's not documented (so I should write up some docs for it to help the next guy) [14:39] yann2: Are you ok with Python? [14:39] I can read, yes, but I need ruby [14:40] k. This might be helpful for reading then. It's kind of spagetti code atm though... I need to clean it up. But it works. https://forge.gluster.org/glusterfs-rackspace-regression-tester/glusterfs-rackspace-regression-tester/blobs/master/create_servers.py [14:40] yann2: Line 179 is where the new server instance is created [14:41] yann2: One of the parameters to the call which creates the new server is "userdata". [14:41] thanks a lot for your help, I ll read this :) [14:41] yann2: I provide the #cloud-config file to that, which passes it automatically to cloud-init using config drive [14:41] (note that I have config_drive=True as another parameter) [14:42] yann2: The #cloud-config file I use, is that "remote-centos6.cfg" thing [14:42] So, when cloud-init starts up, it gets given that remote-centos6.cfg file. It reads that, noticing it starts with #include, then goes and gets the URLs on the next two lines. [14:43] Those URL contain what actually needs to be done [14:43] The first is a proper #cloud-config thing [14:43] The seconds is a script to execute after the #cloud-config thing has fully run [14:43] s/seconds/second/ [14:44] so you use config_drive as well [14:44] and userdata = ci_config... should be very similar to what I m doig... [14:45] yann2: As a thought, when I was getting my head around cloud-init for the first time last week, I spun up the various VM's remotely (like you), then logged into them to try and figure out wtf was happening [14:45] yann2: Yeah, it sounds similar [14:45] so ci_config is not mime encoded, nor base64 encoded [14:46] Correct. Have you logged into a VM, and mounted /dev/xvde to a temp spot to see what's being passed via config_drive? [14:46] yann2: The userdata= argument here can actually be just a newly opened file handle. You don't even need to read in the contents. [14:46] nope, good idea [14:47] yann2: Yeah, mount /dev/xvde to a temp spot, and take a look through it's structure [14:47] yann2: Helps to get a better conceptual understanding of wtf is going on :) [14:47] indeed.. its xvdd here, where would my userdata be? [14:48] Ahh yeah. xvdd is right [14:48] xvde is the data drive [14:48] Sorry [14:48] Been using xvde a lot over the weekend :) [14:49] mhhh [14:49] so I have a xvdd with bunch of jsons, and no xvde [14:49] That just means you're using a VM type without an additional data disk [14:49] eg 512 Standard or 1GB Performance [14:50] Don't get hung up on xvde thing. That was my mistage [14:50] mistake [14:50] ok [14:50] My typing sucketh today ;) [14:50] cant see my config copied anywhere on the config disk though [14:50] yann2: Is this similar to what you're seeing? http://fpaste.org/92259/96882152/ [14:51] yep [14:52] is my user_data supposed to be copied somewhere there? [14:52] yeah [14:52] New paste: http://fpaste.org/92262/13968823/ [14:53] That shows the same mount, but also shows the user_data file that was pulled in by the userdata= parameter in my Pyrax call [14:54] That file gets placed into /var/lib/cloud/instance/user_data [14:54] After the remote urls are grabbed, the result is /var/lib/cloud/instance/user_data.i, which is then run/processed/whatever [14:54] yeah your ci_config variable actually contains the content of the file [14:54] Yeah [14:54] so this file is a cloud init config file [14:55] Yeah [14:55] and if i read it right you do not base64encode it nor is it mime encoded [14:55] Correct [14:55] I ll show you my script give me a sec [14:55] I don't base64 or otherwise touch it [14:55] k [14:57] http://pastealacon.com/34263 [14:58] Does it work like that? [14:58] I dont have a user_data in openstack/latest though [14:58] nope [14:59] I mean it runs and creates the vm, but no userdata in the config disk [14:59] maybe its a question for fog... [14:59] What happens if you try "userdata" instead of "user_data" ? [14:59] * jclift noticed some inconsistency in naming around user_data and userdata [15:00] Some parts of Nova require "user_data" [15:00] But Pyrax definitely needs it as userdata [15:00] https://github.com/fog/fog/blob/f531f0bdd715e6f0e3008b35535834ad8e854ec1/lib/fog/cloudstack/models/compute/server.rb [15:00] seems to be an alias, lets try it.. [15:10] still no success :'( [15:10] Damn [15:10] Hmmm, maybe time to ask the Fog guys then [15:10] yep.. [15:10] Do they have an example of working Fog code with userdata you could copy to experiment with? [15:12] dont know, I just asked on #ruby-fog [15:15] found this, but its old http://pastebin.com/n6fRuF0C :D [15:18] yann2: Heh, well "Good Luck" I guess. I'm not into Ruby... hopefully the Fog guys can help. :) [15:19] yeah thanks, I think it's supported by the openstack compute but not the rackspace one... [15:20] I ll try my luck with a bug report [15:25] opened a bug there https://github.com/fog/fog/issues/2824 let's wait and see [15:53] jclift, trying my luck patching fog, wish me luck ;) [15:58] :) [15:58] Definitely good luck! [16:00] yeah man, epic skills here :) I ll do a pull request this evening [16:11] :) [16:35] i am using cloud-init for the first time. using it with EC2. i created a very simple user-data #cloud-config file (see here http://pastebin.com/gE8C0M1d). i am using centos6.4 AMI's from cloudmarket.com that say "with cloud-init installed". when I do "ec2-run-instances -f myuserdata.yaml", it boots up fine, i can see cloud-init is installed, but my user-data file was not taken into consideration. anyone know why? [16:55] sauce, what is the version of cloud-init ? [16:57] https://github.com/yannh/fog/commit/e335084b200e88263f739a867366afd97fc6b0cb jclift , for what its worth [16:57] testing a bit more before sending my pull request :) [16:57] smoser so when we switching cloud-init to git? ;) [16:59] harlowja, i try to avoid flamewars. [16:59] lol [17:04] smoser: cool. I just fetched the key from keyserver.ubuntu.com and it does not have your signature on it. [17:04] really any signatures on it [17:05] https://github.com/fog/fog/pull/2826/files now just need a nice soul to merge it and I should be good [17:06] SpamapS, i can sign it. thats fine. the thing i didn't know is what i should sign. [17:06] its a subkey [17:08] alright, off for today, thanks a lot for all your help jclift that was immensely useful [17:08] have a nice day/evening [17:20] SpamapS, i signed now. and put onto keyserver.ubuntu.com . === ctracey|away is now known as ctracey [17:29] smoser: sign the main key. The point is to allow downloaders to verify the key without prayer. ;) [17:30] SpamapS, yeah. i did, right? [17:38] smoser: indeed, well done :) [17:45] smoser cloud-init-0.5.15-68.el6_bashton1.noarch [17:47] smoser nevermind, cloud-init did run. i tried it with some low level stuff like touch /tmp/file1 and it did. now i gotta figure out why the puppet module didnt work [17:47] while i am here, whats the best way to add a host to /etc/hosts with cloud-init? [17:50] sauce, that is old [17:51] i really dont know what support there would be in something called that version. [17:51] without looking. so that i'd be my first guess. [17:51] wrt /etc/hosts, you can modify the apprpriate template file with a boothook. [17:52] smoser: note that it would be quite useful now if you started either signing the images, or producing SHA256SUMS [17:52] smoser: MD5 is broken [17:53] i am signing the images. [17:53] http://cloud-images.ubuntu.com/releases/streams/v1/com.ubuntu.cloud:released:download.sjson [17:53] thats the preferred way. [17:53] preferred by who? [17:54] 0.5.15, woah [17:54] err.. wait. bad link. [17:54] I can use jq to grab those sha256sums tho .. so that works [17:54] sauce u are on rhel6? [17:54] http://download.cirros-cloud.net/streams/v1/net.cirros-cloud:devel:download.sjson [17:54] 6.4, about 1 year old [17:54] http://repos.fedorapeople.org/repos/openstack/cloud-init/ should be newer :) [17:55] although i thought u could install a newer one [17:55] 0.7.2 is much better ;) [17:55] smoser: color me old fashioned.. but a .asc file for each image would be um.. a bazillion times preferrable to that for scripting. :-P [17:55] smoser: but I can work with it. :-P [17:56] i agree that having FILE.asc is simpler for scripting. [17:57] jq has at least made json available to bash [17:59] smoser: would be quite helpful if this format actually had a _list_ for the products. :-P [18:00] list ? [18:00] its a dict [18:00] because the products is a key [18:01] smoser: so to find latest version, I should still use /version/released ? [18:01] smoser: Yeah, but I have to sort the keys to find the latest. :-P [18:01] * SpamapS will call the whambulance [18:01] smoser: just whining. :) [18:02] sauce: There's modern cloud-init in EPEL isn't there? [18:03] jclift im just being lazy and using someone elses AMI [18:03] rather than create my own [18:03] SpamapS, http://paste.ubuntu.com/7218123/ [18:03] Heh. Doesn't seem to be working for you in this instance. :( [18:03] that is secure and allows you to easily point it at a mirror if you want. [18:03] and '--max=1' does the sorting for you. [18:04] sauce i'd recommend at least upgrading the AMI cloud-init version :) [18:04] $ sstream-query [18:04] sstream-query: command not found [18:04] smoser: no package suggestion. :( [18:05] smoser: also I have a really giant set of Fedora users so I have to be mindful of hard it will be for them to use. [18:05] $ dpkg -S `which sstream-query` [18:05] simplestreams: /usr/bin/sstream-query [18:05] SpamapS, that giant set of users installs random garbage from pip all the time. [18:06] so... not being packaged isn't a *huge* thing. [18:06] bad users [18:06] smoser: oh we're quite happy to abuse pip :) [18:06] so i should get a simpelstreams into pip. [18:07] ubuntu's official EC2 ami's use: 0.6.3-0ubuntu1.10 [18:08] smoser: yes. but for now, jq will suffice [18:08] jq ? [18:10] http://stedolan.github.io/jq/ [18:10] those bash people [18:10] lol [18:11] --===/o/ [18:11] lol [18:11] its C ? [18:11] smoser: also, you have files that are '.gpg' but they have .asc content in them [18:11] smoser: yeah tiny little utility, we use it everywhere to process json [18:12] thats nice. [18:14] SpamapS, i dont think i started that. [18:14] the little i know came from modelling ubuntu [18:14] http://cdimage.ubuntu.com/ubuntu-server/daily/current/MD5SUMS.gpg [18:14] sure [18:14] they did it wrong too :) [18:15] it confuses gpg, you have to tell it that it is ascii armored detached [18:16] i left my ascii armor at home :-/ [18:17] SpamapS, well that sucks. [18:17] my damned ignorance keeps getting in the way. [18:17] the sstreams code only really handles the inline signed anyway. [18:28] smoser: Yeah, and the inlined signed is kind of hard to use w/ jq.. as I have to strip off the signature.. :-P [18:29] right. so we need to improve jq for inline signed json [18:31] smoser: jq example: [18:31] $ jq '.["products"]["net.cirros-cloud:standard:0.3:i386"]["versions"] | keys | sort | max' net.cirros-cloud\:released\:download.json [18:31] "20140317" [18:32] see how hard that is. :-P [18:33] $ jq '.["products"]["net.cirros-cloud:standard:0.3:i386"]["versions"]["20140317"]["items"]["disk.img"]["sha256"]' net.cirros-cloud\:released\:download.json [18:33] "f0803c2d179c8a02d029239d35fc3e752cc81ad3436ea52b757e11685ca7c074" [18:34] see how much easier it was with the tool i gave you ? [18:35] smoser: is it on pypi yet? [18:35] its not. i can put it there, although i've never done that before. [18:36] so again with the damned ignorance getting in my way. [18:39] smoser: I've got a jq solution. It's not horrible. But if/when you do get it on pypi, please let me know so I can switch. [18:39] SpamapS, are you looking to put that into devstack ? [18:39] or elsewhere [18:42] devstack is dead to me :) [18:42] but it should go there too yes [18:42] smoser: TripleO devtest yes [18:42] smoser: https://review.openstack.org/#/c/83347/ [18:44] well, its interesting actually. both of them are. [18:44] from the "continuous integration" perspective. [18:45] in that I can randomly change / break things. === gondoi is now known as zz_gondoi === zz_gondoi is now known as gondoi [19:00] where can i get full cloud-init docs other than http://cloudinit.readthedocs.org/en/latest/? the Modules section is empty, and i feel that the examples don't list everything. [19:01] i.e. it's not clear how to add a 3rd party apt repo [19:02] i would even settle for code to look through. where are the modules stored? [19:08] sauce, you get docs for the version you'r using in the package you're using. [19:09] the config modules are stored in cloudinit/modules/cc_* [19:09] (except they might be different in 0.5.x) [19:09] to add a 3rd party apt repo is trivial [19:09] and is shown at http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/doc/examples/cloud-config.txt#L21 [19:10] SpamapS u say devstack is dead?? [19:10] intersting [19:16] SpamapS u know u want to use anvil, lol [19:23] harlowja: I say that devstack is dead _to me_ [19:24] harlowja: we use devtest.. because multi-node matters. :) [19:24] lol [19:24] ya [19:34] thanks smoser ! [19:34] smoser you say the docs come with the package, i have no man cloud-init though [19:36] sauce, in ubuntu they're in /usr/share [19:37] in centos or whatever, id' rpm -qa | grep -i doc [19:42] thanks sir [19:43] i switched to ubuntu for now. i want to learn cloud-init in ubuntu first, then i'll go to centos [19:48] or just stay on a sane OS :) [19:49] although, to be fair, 2.6.18 was a good kernel. === gondoi is now known as zz_gondoi === zz_gondoi is now known as gondoi [20:07] sauce, i was making fun of centos. [20:07] i know i know [20:07] :) [20:07] we are working on building a new app at work, and i have the opportunity to choose the linux distro [20:08] i want to use ubuntu, but that's just the kid in me talking [20:25] hey smoser, i'm gonna paste somethin in chan, forgive me [20:25] apt_sources: - source: deb http://apt.puppetlabs.com $RELEASE main dependencies [20:25] keyid: 4BD6EC30 # GPG key ID published on a key server [20:25] filename: puppetlabs.list [20:26] i can't get that to work. i troubleshooted down to the "keyid" line. if i comment it out, cloud-init works [20:32] sauce, indentation is important. [20:32] youc an see that what you're going to get is sane by just doing somethin glike: [20:33] python -c 'import yaml, pprint, sys; pprint.pprint(yaml.load(open(sys.argv[0])))' my.file [20:33] also maybe yamllint.com ? [20:34] http://paste.ubuntu.com/7218786/ [20:34] sure. [20:36] yamllint.com says the yaml is OK but outputs it vastly different than it appears in examples [20:36] lemme try python [20:39] i don't think indentation is the problem here [20:44] sauce, its not that its valid or not. [20:44] its that the result is int he right format [20:44] i hear ya [20:44] apt_sources is a list of dictionaries [20:44] i don't see how i can be messing up the indentation [20:44] its just a few spaces, everything is lined up [20:44] i deleted the line and rewrote it char by char [20:45] "filename" works with the same indentation [20:45] keyid doesn't [20:45] hm. [20:45] i know right [20:45] pastebin /var/log/cloud-init.log ? [20:46] absolutely hang on [20:47] welp there ya go: Apr 7 20:42:26 ip-10-30-4-54 [CLOUDINIT] cc_apt_update_upgrade.py[WARNING]: Source Error: deb http://apt.puppetlabs.com precise main dependencies:failed to get key from keyserver.ubuntu.com [20:49] sauce, its actuall preferable from both security and reliability perspective to insert the full key [20:49] running this again, lemme check [20:50] smoser ok i will try that [20:50] http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/doc/examples/cloud-config.txt#L120 [20:50] hte example there. [20:50] its more reliable because you dont depend on the keyserver [20:51] and int his case all you're really using it for is a object store to map to [20:56] i gotcha. i pasted the key block and it validated as yaml. running it now. [20:57] many ec2 instances have died at my hand stoday [20:57] hands today [20:58] sauce, for playing, you can use lxc or kvm [20:58] lxc you can use quite performantly inside a ec2 instance [20:58] see example here: http://ubuntu-smoser.blogspot.com/2013/08/lxc-with-fast-cloning-via-overlayfs-and.html [20:58] while this is running i have another question: can i specify the order that things are run? i.e. i want to install puppetlabs repo, then use the puppet module [20:59] nice the key worked!! [20:59] and it installed in the right order, that was a 50/50 chance probably right? [20:59] well, no. :) [20:59] puppet module runs after apt_config [20:59] and that is by design [20:59] you can specify the order of things [21:00] just define the list in your user-data [21:00] http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/config/cloud.cfg [21:00] the easiest thing to do is just re-define the whole list [21:00] cloud_init_modules runs first, then cloud_config_modules, then cloud_final_modules [21:01] nd the listst there in order. [21:01] you really should take a look at that blog post, it makes testing this stuff really easy and much faste rthan waiting on instances in amazon [21:02] awesome smoser [21:03] just awesome [21:06] thanks. [21:22] why do i even need puppet, if i have cloud-init? === harlowja is now known as harlowja_away === harlowja_away is now known as harlowja === gondoi is now known as zz_gondoi