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

=== shardy_afk is now known as shardy
=== evilissimo|afk is now known as evilissimo
=== hatchetation_ is now known as hatchetation
smosermnaser, mgagne a couple things:14:45
smosera.) kernel resize of online disk is orders of magnitude faster with newer kernels . that got magically fast ~ 3.5 i think.14:47
smoserb.) backgrounding the resize ends up not being all that useful on the older kernels.  It should background, but it is extremely IO intensive and halts most other things.   it should work correclty, but everything will be slow.14:47
mnasersmoser: i notied that, also it doesnt seem like it background cloud-init .. if nothing else in cloud-init is setup to run, it won't really be backgrounded14:48
smoserit shoudl bacground14:50
smosermnaser, is the call to util.fork_cb just broken ?14:51
smoserit looks right14:52
mnasersmoser: so what was happening is that it was saying "Backgrounding resize" but it was still blocking14:52
smoserhm.. i really doubt its broken.14:53
mnaserand the proof to that even more is that the "part" that does resizing would say "took 180 seonds" let's say and it was blocked there14:53
smoserhm..14:53
mnaserbut this is cloud-init of CentOS 614:53
mnaserso maybe that's not been tested14:53
mnaseralso i recall14:53
smoseri dont know what is in centos 6. i'm just looking at trunk14:53
smoserbut it *is* crazy io intensive14:53
mnaserthere was an error14:53
smoserand so is boot14:53
smoserso originally when i did this, i found it to be almost useless.14:53
mnaserwith the callback being a NoneType or something14:53
smoserhm..14:54
smoserlet me look at that again14:54
mnaseralso this is 10x ssd drives in raid-10 so it's pretty fast14:55
smoseryou're right14:56
smoserits busted14:56
mnasersmoser: Jul  7 12:34:20 localhost [CLOUDINIT] util.py[DEBUG]: backgrounded Resizing took 41.487 seconds14:56
mnaserJul  7 12:34:20 localhost [CLOUDINIT] util.py[DEBUG]: cloud-init mode 'init' took 41.799 seconds (41.80)14:56
mnaserand then it continues afterwards14:56
smoser:-(14:56
smoserand i broke it when i added the util.log_14:56
smoseropen a bug ?14:56
mnaserperhaps14:56
mnasersure14:56
mnasersmoser: https://bugs.launchpad.net/cloud-init/+bug/133861415:01
smosermnaser, try: http://paste.ubuntu.com/7760542/ ?15:06
smoserare you able to easily try that ?15:06
mnaserhm15:06
mnaseri think i can spin up a new vm with cloud config disabling resize15:07
mnaserthen patch it and run the module manually15:07
mnaseri assume if i run it manually it should background as well15:07
mnaserheck, let me try to patch one that is already running because it's failing to fork resizefs anyways15:08
smoserit should work, yea.15:10
smosermnaser, thank you.15:10
=== evilissimo is now known as evilissimo|afk
mnasersmoser: fyi in the cc_resizefs.py file15:11
mnaser'args': (resize_cmd, log)) should be 'args': (resize_cmd, log)}15:11
smoseryeah15:12
mnaserdoesnt give that warning anymore... now to test if it's actually properly backgrounding will take a bit longer15:12
mnaserbut let me do it, solving this will be very usefu15:12
smosermnaser, it was calling fork_cb completely wrong.15:14
smoserso i'm trying to just fix how it calls it, by adding a fork_cb_kwargs and calling that one, and making fork_cb backwards compat and call the fork_cb_kwargs.15:14
smosermy concern is that fork_cb might not be completley backwards compat15:14
mnaserand maybe other parts thats rely on it might be broken now15:16
mnaserright so just made a new vm that was not resized automatically15:16
mnasernow i'll do the patch for it, delete all the cloud init stuff, reboot and *hopefully* it'll background15:17
mnaseror should i just run it manually in the shell after patching and it'll be okay, smoser ?15:17
smoserrm -Rf /var/lib/cloud15:18
smoserand reboot15:18
smoserand see15:18
smoserthat'll be more complete at least15:18
smoserthere is only one other caller though15:19
smoserso i could just patch it too15:19
mnaseralright so its patched up now15:19
mnaserrebooting15:19
mnaserits only going to do a resize from 20gb to 40gb but i think it'll still show15:20
mnaseroh, it didnt do the resize again beacuse it read the user data (configdrive) and that says not too15:21
mnaserhm15:21
smoserah. rihgt.15:22
smoserand you can't easily override that. 15:22
mnaserJul  7 15:22:03 resize-test [CLOUDINIT] cc_resizefs.py[DEBUG]: Skipping module named resizefs, resizing disabled15:22
mnasereven if i force it to run15:22
mnaserfrom the shell15:23
smoserwell if you tell it to run it still reads config15:23
mnaseri guess what ill do is15:23
mnasertake a snapshot of this server15:23
mnaserand boot another one15:23
smosermnaser, just put 'resize_root = NOBLOCK'15:24
smoserright before that15:24
smoserie, force it on15:24
smoseractually..15:24
mnaserbefore where exactly?15:24
smoserif you run it manually you *should* be able to pass it in15:24
mnasercloud-init --debug single -n resizefs15:24
mnaserthis didnt run it manually15:24
smosercloud-init --debug single -n resizefs noblock15:25
smosertry that15:25
mnaseri'll take a snapshot and boot from it a much larger machien so we have a feel of what it's like15:25
mnaserso if anything else is disturbing, we'll see it15:25
smosermnaser, it is crazy slow.15:26
smoseri have done resize on spinning disk from 2G to 2TB15:26
mnaseroh ill make 20G to 80G resize15:26
smoserand it took > 1 our i think15:26
mnaseryeah i know that pain :P15:26
smoser1 hour15:26
mnaserssd, 20G to 1.2TB was 10 minutes15:26
mnaserstill al ot15:26
smoseryeah.15:26
smoserand it is crazy magic fast in 3.515:26
smoserits 1000x faster15:26
mnaseroh well, centos :-(15:27
smoseryeah15:27
mnaseralright, got snapshot, booting it now15:27
mnasersmoser15:34
mnaserJul  7 15:31:57 resize-test [CLOUDINIT] util.py[WARNING]: Failed forking and calling callback log_time15:34
mnaserJul  7 15:31:57 resize-test [CLOUDINIT] util.py[DEBUG]: Failed forking and calling callback log_time#012Traceback (most recent call last):#012  File "/usr/lib/python2.6/site-packages/cloudinit/util.py", line 224, in fork_cb_kwargs#012    child_cb(*args, **kwargs)#012TypeError: log_time() argument after * must be a sequence, not NoneType15:34
smoserboo.15:37
smosermnaser, http://paste.ubuntu.com/7760686/15:38
smosertry that15:38
smoserand i apologize15:38
smoseri wondered about that15:38
mnaserno worries15:38
mnasernow i can easily rename and reboot :p15:38
mnaserbtw smoser 15:40
mnaserbackgrounded Resizing = Backgrounded resizing15:41
mnasercannot imagine how much that bothered me in logs :-P15:41
smoser?15:41
smoseroh. i see. capitalize :)15:42
mnaseryes :p15:42
smoserwell, the 'R' makes sense.15:42
smosersort of 15:42
smoserin my world15:42
smoseras the 'Resizing' in the non-backgrounded path.15:42
mnasersmoser: really silly15:42
mnaserbut15:42
smoser(so grepping for 'Resizing' would get either)15:42
mnaserwhy not just do this15:42
mnaserdef fork_cb_kwargs(child_cb, args=[], kwargs={}):15:42
smosermnaser, generally, http://satyajit.ranjeev.in/2012/01/12/python--dangerous-default-value-as-argument.html15:46
mnaseraah15:47
mnaserthat's good to know15:47
smoserhttps://docs.python.org/2/tutorial/controlflow.html#default-argument-values15:47
mnaserrebooting15:47
smosersee the 'important warning' there15:47
mnaseralways learning something new15:48
mnaserJul  7 15:48:46 resize-test2 [CLOUDINIT] util.py[WARNING]: Failed forking and calling callback log_time15:49
mnaserJul  7 15:48:46 resize-test2 [CLOUDINIT] util.py[DEBUG]: Failed forking and calling callback log_time#012Traceback (most recent call last):#012  File "/usr/lib/python2.6/site-packages/cloudinit/util.py", line 229, in fork_cb_kwargs#012    child_cb(*args, **kwargs)#012  File "/usr/lib/python2.6/site-packages/cloudinit/util.py", line 1830, in log_time#012    ret = func(*args, **kwargs)#012TypeError: 'str' object is not callable15:49
mnasersmoser ^15:49
mnasertho15:49
mnaseri think i should ahv esaid this earlier15:49
mnaserrunning cloud-init 0.7.4 not trunk15:50
mnaserso maybe this has to do with it15:50
smosermnaser, i'll stop bothering you and i'll just make sure it works on trunk before asking again.16:01
smoserk?16:01
mnasersmoser: no problem, thank you so much :)16:34
=== harlowja_away is now known as harlowja
harlowjasmoser u might want to respond to http://lists.openstack.org/pipermail/openstack-dev/2014-July/039514.html :)19:04
harlowjasee last line ;)19:04
cloudnoobharlowja: I emailed you about cloud-init-dev over the weekend?19:11
cloudnoobI will paste my email into irc :)19:11
harlowjacloudnoob howdy19:11
cloudnoobIt looks like the default configuration of cloud-init on Ubuntu 12.04 LTS causes a new RSA key & fingerprint to be generated when an existing (root) EBS volume is attached to a new instance[1]. I'd like to avoid this behavior on some of my instances.  After some poking around, I think removing 'ssh' from cloud_init_modules list in /etc/cloud/cloud.cfg will prevent this from happening[2]. Can a cloud-init-dev@'er confirm this is t19:12
cloudnooboh hmmm19:12
cloudnooblooks like I hit a limit19:12
cloudnoob1/ It looks like the default configuration of cloud-init on Ubuntu 12.04 LTS causes a new RSA key & fingerprint to be generated when an existing (root) EBS volume is attached to a new instance19:12
harlowjathat would seem fine to do19:12
cloudnoob2/  I'd like to avoid this behavior on some of my instances.19:12
harlowjatake ssh module out19:12
cloudnoob3/ After some poking around, I think removing 'ssh' from cloud_init_modules list in /etc/cloud/cloud.cfg will prevent this from happening19:12
cloudnoob4/ Can a cloud-init-dev@'er confirm this is the case, and that this is a safe/secure thing to do for existing systems which have already been through once-per-instance setup? I'm also open to advice or suggestions on better approaches.19:12
cloudnoobsee http://serverfault.com/questions/294039/rsa-fingerprint-changed-after-moving-ebs-and-eip-to-new-instance for a similar writeup19:13
cloudnoobalso my understanding is based on the assumption that 'ssh' in this list corresponds to executing the handler defined in 'cc_ssh.py'.19:13
harlowjacloudnoob i think u can also place ssh_genkeytypes: [] in userdata19:13
harlowjato avoid it doing any extra key creation19:13
cloudnoobok19:14
harlowjaor adjust it in /etc/cloud/cloud.cfg19:14
cloudnoobis that better than removing from cloud_init_modules?19:14
harlowjadisabling ssh makes it impossible for any user keys to come in, if they ever want19:15
harlowjai think u are hitting http://bazaar.launchpad.net/~cloud-init-dev/cloud-init/trunk/view/head:/cloudinit/config/cc_ssh.py#L91 which the ssh_genkeytypes: [] should just stop19:15
cloudnoobah19:15
harlowjaaka, no more generation, but if people provide them that code path will work19:15
cloudnoobokay cool19:15
cloudnoobI'll try it19:15
cloudnoobthere are existing keys so yeah, just don't want to overwrite them19:16
cloudnoobthanks for the suggestions19:16
harlowjanp19:16
cloudnooband thanks for the software of course19:16
cloudnoobteh useful19:16
harlowjanp19:16
harlowjathx for using it :-P19:17
smoserharlowja, thanks for the heads up. responded19:29
harlowjasmoser cool19:29
harlowjai'm not touching that question ;)19:30
harlowjau can, haha19:30
harlowja*not the ipv6 question, the lets get rid of metadata service19:36
harmwcan't we just ditch ip6?19:39
harmwfar easier19:39
harmweverything just works with ip419:39
harmwlets keep it that way19:39
ijwyo19:44
ijwSince I'm here, I wanted to ask: has anyone thought about a generic format for network information (rather than the /etc/network/interfaces file that Openstack likes to template, badly, and then inject)?19:45
harlowjaijw yes19:52
ijwHow much thinking so far?19:52
harlowjaijw http://bazaar.launchpad.net/~harlowja/cloud-init/better-todo/view/head:/TODO.rst (this is updated with this, although its been thought of for a long time, ha)19:53
harlowjasmoser u should merge that branch :)19:53
ijw  I have an MTU problem that is really not going to fit in with the current mechanisms19:53
harlowjaijw i don't think its cloud-init that would have the biggest problem with changing, its the other things that write the format :)19:53
ijwWin7 doesn't advertise for MTU on DHCP, and Linux has Opinions on how big the MTU can be19:53
harlowjaijw https://fedorahosted.org/netcf/ has been discussed (although its xml, eck, haha)19:54
ijwGiven that the in-page example is a bridge it's more complex than we strictly need anyway19:55
harlowjasure19:55
ijw(also, you can't specify data by eth0/1/2 since they're assigned by the OS)19:55
harlowjaijw the issue is that other surronding projects need to get away from writing this format also, this imho is the harder part :)19:55
harlowja*neutron/nova in openstack19:55
harlowjaijw ideally someone really needs to own that format change and push it through the various openstack projects19:56
harlowjathe cloud-init work i don't think would be that much19:56
harlowja*at least to do the basics19:57
smoserharlowja, we have a fail safe datasource.19:57
smoserijw, yeah, mtu sucks.19:57
harlowjasmoser damn gotta change that in the todo, no longer a todo then, ha19:57
smoserijw, from my perspective, it needs to be specified by the "provider" in one way or another.19:58
ijwIt's not even a format change - it's an additional file on the web server or config drive that could happily be ignored by anything that didn't know about it19:58
smoserdhcp is reasonable for dhcp . but ideally it'd be available if not dhcp.19:58
harlowjaijw sure, just write "network.xml" (or something)19:58
ijwAnd I think if it had interface, optionally with VLAN/v4(s)/v6(es)/mtu that would be sufficient19:58
smoserthis advertising needs to be more part of the network imo19:58
harlowjaand cloud-init will use it if it exists (or if not look for the old way)19:59
smoserbut maybe not.19:59
smoserit is very problematic19:59
smoserand we're hitting it here too.19:59
ijwsmoser: DHCP in either the v4 or v6 forms has various issues advertising MTU.  The client needs to know, and v6's spec is written with a pedantic respect to the fact that ethernet doesn't standardise packet sizes >1500 bytes (so making bigger MTUs is hard)20:00
ijwAssuming YAML wouldn't make people cry, the spec could be very straightforward, in fact20:01
* ijw finds an etherpad20:01
harlowja:), bb, meeting20:02
smoserit just seems really odd that this isn't sovled20:02
smoserharlowja, merged. dont say i never did anything for you :)20:03
=== mnaser is now known as Perk
=== Perk is now known as mnaser
=== harlowja is now known as harlowja_away
=== gondoi is now known as zz_gondoi
=== harlowja_away is now known as harlowja
harlowjasmoser woot :-P22:08
ijwBy sheer coincidence someone's just talked to be about bonding, too...23:06

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