=== natorious is now known as zz_natorious === zz_natorious is now known as natorious === natorious is now known as zz_natorious === zz_natorious is now known as natorious === natorious is now known as zz_natorious [16:11] Quick question - is it possible to run an additional cloud-init script at a later point during or after boot? The reason I ask is that Azure supports cloud-init, but has severe restrictions on template sizes that make cloud init impractical to use. Azure does support a thing called a "CustomScriptForLinux" that allows us to run a script downloaded from somewhere else, and what I want that... [16:11] ...script to be is an additional cloud-init script. Is it possible to run additional cloud-init scripts after the initial one is run via some kind of command line option? [16:14] minfrin, you're limited by size i gather ? [16:14] the CustomData on azure can be gzip compressed inside there. that will buy you some. [16:14] also, you can use '#include' style to consume data from elsewhere. [16:15] see https://help.ubuntu.com/community/CloudInit [16:15] then your user-data can effectively be anything you can fit inside the content of a url [16:19] Gzip is no good for us unfortunately, the thing that is blowing our size limit are the private keys for the machines which aren't compressible in any meaningful way that makes a difference to us. [16:19] How do you secure data coming from an URL? [16:35] minfrin, as in put secret data there? or as in secure against MIM [16:35] it can read over https so that secures transmission [16:35] for secret data you can use '#include-once' with a url to a long one time hash [16:35] but if you want to run stuff after boot, you can [16:36] cloud-init single --frequency=always --name= [16:40] I tried out cloud-init single, but it forces us to choose a --name option, and I've interpreted that as meaning we are only able to run one single module in our additional cloud-init script. What I need to do is run all modules, is this possible? [16:40] We're trying to find a solution that doesn't involve too many hacks given the number of hacks we've had to apply to work around Azure's size limits. :( [16:48] smoser: is there a way to make cloud-init reformat a drive on every boot? [16:48] currently getting an error stating the filesystem is already mounted [16:48] minfrin, you can run the stage again 'cloud-init init' or 'cloud-init config' [16:48] first boot, it takes the unformatted drive and formats it properly. when i reboot the box it attempts to reformat it but mkfs.ext4 fails stating the drive is already mounted [16:49] cbolt, probably want/need to take it out of /etc/fstab . at least that could work. [16:50] you can probably configure 'mounts' to not automatically mount it. [16:50] minfrin, do you have sensitive data in the user-data ? [16:50] is that why you're adverse to urls ? [16:50] you could put the sensitive data (assuming it fits) into the body of the CustomData and #include large code hunks [16:51] ok thanks, ill come up with a workaround for this [16:51] cbolt, http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/doc/examples/cloud-config.txt#L174 [16:51] i think if you feed it user-data that says 'mounts: [ephemeral0, null]' [16:51] then it wont getm ounted. and that shoudl fix your reboot issue [16:52] yea but then ill need to come up with a solution for mounting it [16:53] oh. yeah. ok. [16:53] really i shouldnt be having to force cloud-init to reformat the drive on every reboot [16:53] Yes on the sensitive data - it's all private keys for the machines. [16:53] If I was to add an additional cloud-config script, what command would I run? In other words: [additional-cloud-init-command] cloud-init-with-keys [16:53] i need to fix the underlying issue [16:54] minfrin, what is the size limit ? [16:54] just really curious. i didnt' remember there was one. (initially there wasnt, thats how we implemented custom-data there without azure's knowledge :) [16:55] To explain the background, Azure supports customData of up to 64kb in size. Their templates are however constrained to approx 320k in size before failing on deployment. We have 21 machines to deploy as a unit (and climbing), and a customData script of anything bigger than 7k causes the deployment to crash. [16:55] hm. [16:56] have you raised that to them ? [16:56] for "custom cloud-config script" above, what did you mean ? [16:56] you want to add a config module and run it ? [16:56] Yes. Took them a while to figure out the cause was a size limit, we were getting "internal server error" for a while which told us nothing of what was wrong. [16:58] the 64kb sucks as a limit. [16:58] on ec2 its 64k [16:59] but its binary [16:59] is theirs 64kb of mime-encoded (so it can be shoved safely into xml body) ? [16:59] We want to run cloud-init twice - once on boot using their normal process, and a second time at some point after boot using their "CustomScriptForLinux" feature, which while being URL based can be secured. "CustomScriptForLinux" allows us to specify a file to download (which is the cloud-init script in theory) and a command to run (which is in theory "cloud-init [options]"). [17:00] ok. i think maybe i udnerstand. [17:00] if you can run stuff, then [17:00] let azure boot, [17:00] run command taht does: rm -Rf /var/lib/cloud/ /etc/cloud/cloud.cfg.d/*azure* [17:01] then populates /var/lib/cloud/instance/nocloud/seed/ [17:01] or... possibly simpler. [17:01] let azure boot [17:01] hm.. [17:02] well, ^ above shoudl work. [17:02] We're getting nowhere near the 64kb size limit, the limit we're hitting is the total size of their deployment template. In theory we're told it is 1MB - itself very small, but we're then told that a UTF8 to UTF16 halves the effective size of the template to 512k, and there are further unspecified limits we hit, bringing the size where we hit the wall to about 320k-ish. [17:02] ah.ok. [17:02] what is the user-data (what format) that you'd normally send to cloud-init ? [17:02] is it cloud-config ? [17:03] Normally #cloud-init. It was all working great up to the point where we added the private key. [17:03] Sorry, #cloud-config. [17:05] ok. if its all cloud-config i think you should be able to: [17:06] * let azure boot as it would [17:06] * run some program that does: [17:06] * rm -Rf /var/lib/cloud/instance/ [17:06] * put your #cloud-config data into /etc/cloud/cloud.cfg.d/your-data.cfg [17:07] * reboot or run the stages of cloud-init manually [17:08] Let me give this a play and see what I am limited to - I still need to see exactly how the CustomScriptForLinux works and what restrictions are imposed on us. Thank you for confirming the cloud-init steps, I appreciate it. [17:08] yeah, i dont know how that works at all [17:32] Odd_Bloke, around ? [17:33] smoser: In and out. [17:34] http://paste.ubuntu.com/11954733/ [17:35] does that make sense on top of https://review.openstack.org/203533 [17:40] Merged stackforge/cloud-init: Implement a DictRegistry. https://review.openstack.org/203094 [17:44] Merged stackforge/cloud-init: Use a registry to configure reporting handlers. https://review.openstack.org/203093 [17:53] Merged stackforge/cloud-init: Make reporting handlers configurable. https://review.openstack.org/203533 [17:56] smoser: Without context, it looks like a pointless change... [17:59] ah. acutally never mind. you're right [18:00] i didnt'realize you were using event. in the getLogger call [18:00] so its not pointless its broken [18:00] Oh, also true. :p [18:00] Great review from me there. >.< [18:00] i was trying to avoid getLogger and join on every publishEvent [18:10] Ah, I see. === zz_natorious is now known as natorious === natorious is now known as zz_natorious [19:46] Odd_Bloke, http://paste.ubuntu.com/11955467/ [19:47] any reason you use unittest and cloudinit.tests.TestCase ? [19:48] smoser: Force of habit? (No. :p) [19:48] thats fine. was just looking at cloud-init 0.7 for this [20:08] * harlowja prefers 'cloudinit.tests.TestCase' [20:08] makes it easier to add new base functionality if needed [20:08] and/or compat stuff [20:09] Scott Moser proposed stackforge/cloud-init: tests: use cloudinit.tests.TestCase everywhere https://review.openstack.org/206688 [20:09] harlowja, ^ [20:09] cool [20:09] hey, you want to take over my "main" ? [20:10] hmmmmmmmmm [20:10] https://review.openstack.org/#/c/202743/ [20:10] one does not take over main, lol [20:10] one does not just takeover main, lol [20:13] Scott Moser proposed stackforge/cloud-init: add cloud-init main https://review.openstack.org/202743 [20:16] why would flake8 blow up [20:16] not like my ordering ? [20:22] smoser http://docs.openstack.org/developer/hacking/#imports [20:22] 'Do not import objects, only modules' [20:22] might complain, might not [20:22] maybe we turned that check off, not sure [20:22] oh. [20:22] well, i couldnt get H306 to fail [20:55] harlowja, http://paste.ubuntu.com/11955830/ [20:55] thoughts ? [20:55] Odd_Bloke, ^ [20:58] i dont want to pas a handle around everywhere [21:10] smoser: We could do a stack, but that's pretty brittle. [21:11] hmmm [21:12] smoser: I don't think there's going to be a good way to do this that won't (a) break unexpectedly, or (b) fail to expand to the next use case we think of. [21:12] probably better to use a stack, put it in a thread-local variaible, then have most of this reporting be decorators and not explict calls imho, at least hide the calls to start/end all over [21:12] but this is the cost of that level of tracing :-P [21:12] *event emission* [21:12] smoser: harlowja: Immediate example of a stack failing: parallel data-source discovery. [21:12] yup [21:12] thread-local stacks [21:13] harlowja: If that's how we implement parallel discovery, maybe. [21:13] depends how u want to do it, without all the async stuff, paralleism probably just easier via spawning threads imho [21:13] But I don't know that I want event reporting to dictate how we parallelise the code which does the actual work. :p [21:14] agreed [21:14] Also, given that we expect the output of this to be computer-readable, we need it to be super-hard to break. [21:15] Humans can cope with the occasional weird log message; computers, not so much. [21:16] ya, got me, if u want a stack, u probably need a stack structure somewhere :-P [21:16] *stack like output [21:16] or u have to use the call-stack as the stack, not many other options, ha [21:17] This also feels like we might actually only use it in one or two places, and it might be easier for those places to manage it. [21:17] (e.g. all of those instances will _know_ that they are doing ds-search, so can just use that as their event name) [21:18] s/instances/examples of calls/ [21:18] sure [21:18] So I also wonder if this is a YAGNI situation. [21:18] possibly, lol [21:18] https://github.com/jek/blinker doesn't seem to support stacks either [21:18] so my guess maybe we overthinking it [21:20] either does https://github.com/openstack/taskflow/blob/master/taskflow/types/notifier.py (my event like thing) === zz_natorious is now known as natorious