/srv/irclogs.ubuntu.com/2015/07/28/#cloud-init.txt

=== 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
minfrinQuick 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
minfrin...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:11
smoserminfrin, you're limited by size i gather ?16:14
smoserthe CustomData on azure can be gzip compressed inside there. that will buy you some.16:14
smoseralso, you can use '#include' style to consume data from elsewhere.16:14
smosersee https://help.ubuntu.com/community/CloudInit16:15
smoserthen your user-data can effectively be anything you can fit inside the content of a url16:15
minfrinGzip 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
minfrinHow do you secure data coming from an URL?16:19
smoserminfrin, as in put secret data there? or as in secure against MIM16:35
smoserit can read over https so that secures transmission16:35
smoserfor secret data you can use '#include-once' with a url to a long one time hash16:35
smoserbut if you want to run stuff after boot, you can16:35
smosercloud-init single --frequency=always --name=<that-module-name>16:36
minfrinI 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
minfrinWe'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:40
cboltsmoser: is there a way to make cloud-init reformat a drive on every boot?16:48
cboltcurrently getting an error stating the filesystem is already mounted16:48
smoserminfrin, you can run the stage again 'cloud-init init' or 'cloud-init config'16:48
cboltfirst 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 mounted16:48
smosercbolt, probably want/need to take it out of /etc/fstab . at least that could work.16:49
smoseryou can probably configure 'mounts' to not automatically mount it.16:50
smoserminfrin, do you have sensitive data in the user-data ?16:50
smoseris that why you're adverse to urls ?16:50
smoseryou could put the sensitive data (assuming it fits) into the body of the CustomData and #include large code hunks16:50
cboltok thanks, ill come up with a workaround for this16:51
smosercbolt, http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/doc/examples/cloud-config.txt#L17416:51
smoseri think if you feed it user-data that says 'mounts: [ephemeral0, null]'16:51
smoserthen it wont getm ounted. and that shoudl fix your reboot issue16:51
cboltyea but then ill need to come up with a solution for mounting it16:52
smoseroh. yeah. ok.16:53
cboltreally i shouldnt be having to force cloud-init to reformat the drive on every reboot16:53
minfrinYes on the sensitive data - it's all private keys for the machines.16:53
minfrinIf I was to add an additional cloud-config script, what command would I run? In other words: [additional-cloud-init-command] cloud-init-with-keys16:53
cbolti need to fix the underlying issue16:53
smoserminfrin, what is the size limit ?16:54
smoserjust really curious. i didnt' remember there was one. (initially there wasnt, thats how we implemented custom-data there without azure's knowledge :)16:54
minfrinTo 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
smoserhm.16:55
smoserhave you raised that to them ?16:56
smoserfor "custom cloud-config script" above, what did you mean ?16:56
smoseryou want to add a config module and run it ?16:56
minfrinYes. 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:56
smoserthe 64kb sucks as a limit.16:58
smoseron ec2 its 64k16:58
smoserbut its binary16:59
smoseris theirs 64kb of mime-encoded (so it can be shoved safely into xml body) ?16:59
minfrinWe 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]").16:59
smoserok. i think maybe i udnerstand.17:00
smoserif you can run stuff, then17:00
smoserlet azure boot,17:00
smoserrun command taht does: rm -Rf /var/lib/cloud/ /etc/cloud/cloud.cfg.d/*azure*17:00
smoserthen populates /var/lib/cloud/instance/nocloud/seed/17:01
smoseror... possibly simpler.17:01
smoserlet azure boot17:01
smoserhm..17:01
smoserwell, ^ above shoudl work.17:02
minfrinWe'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
smoserah.ok.17:02
smoserwhat is the user-data (what format) that you'd normally send to cloud-init ?17:02
smoseris it cloud-config ?17:02
minfrinNormally #cloud-init. It was all working great up to the point where we added the private key.17:03
minfrinSorry, #cloud-config.17:03
smoserok. if its all cloud-config i think you should be able to:17:05
smoser * let azure boot as it would17:06
smoser * run some program that does:17:06
smoser   * rm -Rf /var/lib/cloud/instance/17:06
smoser  * put your #cloud-config data into /etc/cloud/cloud.cfg.d/your-data.cfg17:06
smoser * reboot or run the stages of cloud-init manually17:07
minfrinLet 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
smoseryeah, i dont know how that works at all17:08
smoserOdd_Bloke, around ?17:32
Odd_Blokesmoser: In and out.17:33
smoserhttp://paste.ubuntu.com/11954733/17:34
smoserdoes that make sense on top of https://review.openstack.org/20353317:35
openstackgerritMerged stackforge/cloud-init: Implement a DictRegistry.  https://review.openstack.org/20309417:40
openstackgerritMerged stackforge/cloud-init: Use a registry to configure reporting handlers.  https://review.openstack.org/20309317:44
openstackgerritMerged stackforge/cloud-init: Make reporting handlers configurable.  https://review.openstack.org/20353317:53
Odd_Blokesmoser: Without context, it looks like a pointless change...17:56
smoserah. acutally never mind. you're right17:59
smoseri didnt'realize you were using event. in the getLogger call18:00
smoserso its not pointless its broken18:00
Odd_BlokeOh, also true. :p18:00
Odd_BlokeGreat review from me there. >.<18:00
smoseri was trying to avoid getLogger and join on every publishEvent18:00
Odd_BlokeAh, I see.18:10
=== zz_natorious is now known as natorious
=== natorious is now known as zz_natorious
smoserOdd_Bloke, http://paste.ubuntu.com/11955467/19:46
smoserany reason you use unittest and cloudinit.tests.TestCase ?19:47
Odd_Blokesmoser: Force of habit?  (No. :p)19:48
smoserthats fine. was just looking at cloud-init 0.7 for this19:48
* harlowja prefers 'cloudinit.tests.TestCase'20:08
harlowjamakes it easier to add new base functionality if needed20:08
harlowjaand/or compat stuff20:08
openstackgerritScott Moser proposed stackforge/cloud-init: tests: use cloudinit.tests.TestCase everywhere  https://review.openstack.org/20668820:09
smoserharlowja, ^20:09
harlowjacool20:09
smoserhey, you want to take over my "main" ?20:09
harlowjahmmmmmmmmm20:10
smoserhttps://review.openstack.org/#/c/202743/20:10
harlowjaone does not take over main, lol20:10
harlowjaone does not just takeover main, lol20:10
openstackgerritScott Moser proposed stackforge/cloud-init: add cloud-init main  https://review.openstack.org/20274320:13
smoserwhy would flake8 blow up20:16
smosernot like my ordering ?20:16
harlowjasmoser http://docs.openstack.org/developer/hacking/#imports20:22
harlowja'Do not import objects, only modules'20:22
harlowjamight complain, might not20:22
harlowjamaybe we turned that check off, not sure20:22
smoseroh.20:22
smoserwell, i couldnt get H306 to fail20:22
smoserharlowja, http://paste.ubuntu.com/11955830/20:55
smoserthoughts ?20:55
smoserOdd_Bloke, ^20:55
smoseri dont want to pas a handle around everywhere20:58
Odd_Blokesmoser: We could do a stack, but that's pretty brittle.21:10
harlowjahmmm21:11
Odd_Blokesmoser: 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
harlowjaprobably 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 over21:12
harlowjabut this is the cost of that level of tracing :-P21:12
harlowja*event emission*21:12
Odd_Blokesmoser: harlowja: Immediate example of a stack failing: parallel data-source discovery.21:12
harlowjayup21:12
harlowjathread-local stacks21:12
Odd_Blokeharlowja: If that's how we implement parallel discovery, maybe.21:13
harlowjadepends how u want to do it, without all the async stuff, paralleism probably just easier via spawning threads imho21:13
Odd_BlokeBut I don't know that I want event reporting to dictate how we parallelise the code which does the actual work. :p21:13
harlowjaagreed21:14
Odd_BlokeAlso, given that we expect the output of this to be computer-readable, we need it to be super-hard to break.21:14
Odd_BlokeHumans can cope with the occasional weird log message; computers, not so much.21:15
harlowjaya, got me, if u want a stack, u probably need a stack structure somewhere :-P21:16
harlowja*stack like output21:16
harlowjaor u have to use the call-stack as the stack, not many other options, ha21:16
Odd_BlokeThis 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
Odd_Bloke(e.g. all of those instances will _know_ that they are doing ds-search, so can just use that as their event name)21:17
Odd_Blokes/instances/examples of calls/21:18
harlowjasure21:18
Odd_BlokeSo I also wonder if this is a YAGNI situation.21:18
harlowjapossibly, lol21:18
harlowjahttps://github.com/jek/blinker doesn't seem to support stacks either21:18
harlowjaso my guess maybe we overthinking it21:18
harlowjaeither does https://github.com/openstack/taskflow/blob/master/taskflow/types/notifier.py (my event  like thing)21:20
=== zz_natorious is now known as natorious

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