/srv/irclogs.ubuntu.com/2013/12/17/#cloud-init.txt

smoserharmw, well, some news. seems busted in my 0.3.2~pre1 also.01:46
smoserhm.. and interesting. it seems busted in 0.3.1 also. the partition table does get grown.01:50
=== ctracey is now known as ctracey|away
=== harlowja is now known as harlowja_away
harmwsmoser: I just filed https://bugs.launchpad.net/cloud-init/+bug/126171011:34
harmwI'll see if I can work on that tonight11:34
harmwannoying11:34
harmwhm, and why didn't I file that against cirros :|11:35
harmwthere, changed it11:37
smoserharmw, thanks.  i can't figure it out. i think something is killing the resize2fs process after it starts.13:39
smoseri changed 'resize2fs' to 'sleep 5' and it seems to die also.  also tried putting the content of the 'sh -c' in its own program. that didnt work either.13:40
smoserthe one thing that does work is removing the '&'13:40
smoserie, not backgrounding.13:40
smoseri'll put this in the bug.13:40
harmwgreat, nice14:03
harmw(-1 for that silly typo btw)14:04
smoserharmw, it seems that using start-stop-daemon does work. but i couldn't get start-stop-daemon to sanely call a 'sh' -c program15:42
smoserso had to put it in a different program15:42
harmwah great15:43
smoserharmw, want to take the fix for a spin ?16:44
smoserget cirros trunk (bzr branch lp:cirros)16:44
smoserthen16:44
smosertar -C src -cvf - sbin/resize-filesystem etc/init.d/resizefs lib/cirros/shlib | ssh cirros@$IP 'sudo tar -C / -xvf - && sudo reboot'16:45
smoserseems to work for me, and when its done you get a nice message like:16:46
smoser/dev/root resized successfully [took 43.12s]16:46
=== harlowja_away is now known as harlowja
harmwsmoser: ill give it a go in a few minutes19:07
smoserharmw, k. good. i dont really know how i feel about "fixing" it. given the 45 seconds it took to run.19:16
smoseri'm apt to put this in and then turn it off by default.19:16
harmwit kinda goes straight into the whole cirros philosophy19:22
harmwany thoughts on how to enable it if the default where to have it disabled?19:23
harmw=== cirros: current=0.3.2~pre1 latest=0.3.1 uptime=100.09 ===19:23
harmw+1 for a lightspeed cloud :>19:23
harmw=== cirros: current=0.3.2~pre1 latest=0.3.1 uptime=63.64 ===19:27
harmwand that was after the reboot + resizefs stuff19:27
harmw# grep resize e1ba8f11-097f-4bc1-bf9b-475710fee5ef/console.log 19:28
harmwwheeljack login: /dev/root resized successfully [took 92.04s]19:28
=== harlowja is now known as harlowja_away
smoserone thought on how to enable it if it were disabled is via file injection (through config drive or openstack api)19:41
smoseri think it would work.19:41
smoserif /etc/init.d/resizefs read /etc/default/resizefs.conf19:42
harmw./sem/instance.i-00000052.userdata19:49
harmw./sem/instance.i-00000052.cirros-apply-net19:49
harmw./sem/once.once.resize-rootfs19:49
harmw./sem/instance.i-00000052.check-version19:49
harmwisn't that missing the tiny touch of consistency? :)19:50
harmwcan't it be specified in user-data? a believe there already is a module to allow for this to happen19:52
harmwsmoser: perhaps have the resizefs script read /var/run/cirros/datasource/data/user-data to make the decision to run/start19:53
smoserconsistency ?19:53
smoserwell, 'instance' is that this is 'per-instance', and then the second portion is the instance id. and then the key.19:54
smoserfor 'once', there is no useful second portion19:54
smoserso i just reused the sring 'once'19:54
smoserie, the resize will only run once, ever.19:54
smoserit could be 'per-instance', and probably woudl work. but i really dont think people are "rebundling" cirros :)19:54
smoserwe could have it specified as user-data, yes. but at the moment cirros doesn't support any sort of "cloud-config" user data.19:55
smoserit only supports '#!'19:55
smoserif i had some cloud-config analog then it'd be perfect. but thats not there yet.19:55
smoserthe inject-files in the openstack api "should work" as it is right now i think. 19:56
smoserwith no other features needed from cirros except having the rc.d script source (if it exists) that file.19:56
harmwtrue19:56
smoseri agree that cloud-config like function is better long term goal19:56
harmwindeed19:56
smoserbut i'd wan to have this enable-able in 0.3.2 and want that "real soon now"19:56
harmwthough having it work based on the presence of a certain file is cool enough for now :)19:57
smoserwell, i'd have it source the file19:57
smoserif present19:57
smoserie, so the file could have:19:57
smoserenabled=019:57
smoserbackground=019:57
smoseror something to that affect.19:57
smoseror mabye just 19:57
harmwisn't it easier to just check if a (0byte) file exists?19:58
smosermode=(foreground|disabled|background)19:58
smoserexistence doesn't allow  me to do foreground and background19:58
smoserand i really do thikn the backgrounding is weird19:58
harmwright on that19:58
smosercause for race conditions19:58
smoserharmw, feel free to give this a try20:10
smoserhttp://paste.ubuntu.com/6590740/20:10
smoserbah. bad syntax.20:10
harmwdarn, I was just busy on something myself :)20:10
smoserhttp://paste.ubuntu.com/6590744/20:11
smoserharmw, sorry to get in your way, i'd love for you to particpate in cirros developement :)20:11
harmwand I should have openstack create the /etc/default/resizefs file20:11
harmwhaha np :)20:11
smoseryeah, you should be able to do somethin glike:20:12
smosernova boot --file /etc/default/resizefs=my.resizefs.txt20:13
harmwyea20:14
=== harlowja_away is now known as harlowja
harmwhm, seems my cloud is not very fond of inserting files20:19
harmwlike this: /data/openstack/nova//instances/b0471e49-094c-4eed-b8f0-7a979ed35957/disk: No such file or directory20:19
harmwNovaException: Error mounting /data/openstack/nova//instances/b0471e49-094c-4eed-b8f0-7a979ed35957/disk with libguestfs20:21
smoserharmw, i think you can turn that off. 20:22
smoserwe dont need the host to insert it20:22
smoser(i would never find that an acceptable solution)20:22
smoserthere is a way where the "inserted files" just appear in the config drive20:23
smoserand then cirros reads them and *it* inserts them.20:23
smoserharlowja, do you know how to set that ?20:23
harlowjahmmm20:23
* smoser goes to try to remember if cloud-init supports that in config drive. i thin it does20:23
harmwwell, i don't use config drive atm and enabling it causes the other vm's to fail on boot iirc20:23
smoserharmw, well, you dont need config drive. cirros should read it from the MD also20:24
smoser(the files can be inserted there too)20:24
harmwyea, i thought so20:24
harmwwas expecting that as well20:24
smoserbut clearly if you're trying to insert config for ifconfig eth0' then its probably not going to work :)20:24
harmwhehe20:24
smoserharlowja needs to write a proper cloud-init DataSourceOpenstack20:25
harlowja:)20:25
smoserthat reads from the openstck MD. we dont really ahve that now. only could reaad those files from the config drive.20:25
harlowjaone sec, let me see what the option is20:25
smoserharlowja, that really is something i'd like for 14.0420:26
harlowjahmmmm20:27
smoserproper oepnstack metadata service datasource (rather than just riding on ec2)20:27
harlowjaagreed20:29
harmwsmoser: does cirros read metadata? since then we could use a metadata key+value instead of inserting a file20:37
smoserharmw, i think it does read it in some sense.20:38
smoserin that it would write keys to files in the datadir20:38
smoserso it could pretty easiliy use that20:38
smoserthe thing i dont like about that is that i dont know that i want to support it going forward20:39
smoseri can trivially keep support for /etc/default/.... injection20:39
harlowjaharlowja i think if u make sure all 'inject_partition=0', 'inject_key=0' nova.conf values are off that will be step 120:41
harlowjaapparently this is on by default20:42
harlowjainject_key=true20:42
harlowjahttps://github.com/openstack/nova/blob/master/etc/nova/nova.conf.sample#L251020:42
harlowjabut u are hitting this code20:43
harlowjahttps://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py#L257020:43
harlowja"If we're not using config_drive, inject into root fs"20:43
harlowja:(20:43
harlowjaharmw i think u can also use the following20:43
harlowjahttps://github.com/openstack/nova/blob/master/nova/virt/libvirt/driver.py#L254420:43
harlowjainject_files and CONF.libvirt.inject_partition != -220:43
harlowjaso make inject_partition=-220:44
harlowjaweirddd20:44
harlowjaha20:44
harlowja# The partition to inject to : -2 => disable, -1 => inspect20:44
harlowja# (libguestfs only), 0 => not partitioned, >0 => partition20:44
harlowja# number (integer value)20:44
harlowja#inject_partition=120:44
harlowjaby default 120:44
harlowjacrazy20:44
harmwhehe20:45
smosersome day the default will be -220:45
harlowjaya, i hope so20:46
harmwso change to -2 and then nova boot --file should work just fine20:46
harlowjaharmw using config drive or nothing at all?20:47
harmwnope, just metadata20:47
harmwno configdrive here20:48
harlowjaso sure, then if smoser is correct and cirros understands special openstack metadata then u should be good to go20:48
harlowjanever know with that smoser  guy, ha20:49
harmwtime to find out :)20:49
harlowja:)20:50
harlowjabut ya, i should (or should get someone from y!) to write a best-impl of an openstack metadata/config-drive thing20:50
harlowja*datasource thing20:50
harlowjaas smoser  suggested20:50
smoseruh oh. 20:53
smoserit imight only do that from config-drive (not MD). hmm.20:53
smosersuck. i don tthink cirros has proper openstack metadata source either.20:53
smoserso harmw that isn't going to work :-(20:54
harlowjahmmm20:56
harmwindeed, it didn't inject the file20:58
harmwuhm, why doesn't it read the stuff from user-data again?20:59
smoserit should execute user-data21:01
smoserif it starts with '#!'21:01
smoserbut thats its only consumption of user-data at the moment.21:01
smoserand that runs after resize would have run21:01
smoserbut if you want, from that '#!' you could just *run* '/sbin/resize-filesystem /dev/root'21:01
smoserat the beginning.21:01
harmwnah, thats far to easy :)21:04
harlowjasmoser a start at this, http://paste.openstack.org/show/55206/21:18
smoserharmw, you think thats a acceptable work around for now ?21:19
smoserand then when we get either a true file insertion or "cirros-config" format in user-data we'll allow enabling it that way.21:19
smoser(in the mean time the user can enable it by actually modifying the image, or by config-drive still should work)21:20
smoserharlowja, woohoo21:20
harmwsmoser: yes, probably good enough for now21:21
harmwthough ultimately reading from user-data would be the best choice 21:22
smoseryeah. i agree.21:23
smoserhttps://bugs.launchpad.net/cirros/+bug/123223921:23
smoseris a start at that.21:23
smoserie, there is code there to read  mime-multipart21:23
smoserand since i have a json reader, we can pretty easily support a "cloud-config-archive" like thing in a similar fashion21:23
harmwnice21:25
harmwhow does this behave when I've put yaml in user-data?21:26
smoserprobably barf.21:27
smoseri only have a json parser21:27
smoserand i dont plan on a proper yaml one.21:28
smoserits easy enough to convert yaml to json before passing to cirros21:28
smoserand hard (without C programming) in cirros to write a yaml parser.21:28
harmwyou mean I should feed json user-data to nova on instance boot, or have cirros convert user-data to json upon loading/booting?21:29
smoser2 things here (kind of unrelated)21:31
smosera.) want to have cirros support "multi-part" user-data as input.21:31
smoser a.1) mime-multipart (as seen in that bug with the awk parser)21:32
smoser a.2) cloud-config-archive like multipart (cloud-config-archive is a cloud-init thing that basically just allows you to make an "archive" of parts in yaml rather than mime)21:32
smoserfor a.2, cirros would not support that being yaml, but instead just json. but same basic format.21:33
smoserb.) some of those parts could be "cirros-config" which would be a json config format similar to "cloud-config"21:33
smoserwith the same caveat of not supporting yaml, but only json21:33
smoserin the future if somehow i got a small enough yaml parser, we could just support yaml in both of those places.21:34
harmwok21:34
harmwwould've been easier to just put cloud-init in cirros :p21:35
smoser$ apt-cache show python2.7-minimal | grep -i size21:42
smoserInstalled-Size: 339921:42
smoserSize: 118753021:42
harmwye yea, bit to large21:43
smoserso 3.XMB for python-minimal.21:43
smoseri'm sure you could get stuff smaller21:43
smoserbut all of cirros is ~ 8M (the disk images are bigger because of filesystem overhead and the fact that the disk1.img file actually has *2* copies of cirros in it)21:44
smoseroh. wait. no it doesnt.21:45
harlowjasmoser i'll try to work on improving that21:52
smoserpython ?21:53
harlowja*openstackdatasource, ha21:53
harlowjanot python, ha21:53
harlowjasmoser u fix python, lol21:53
smoseri have to admit, i kind of like programming in awk and busybox sh21:55
smoserhaving python in cirros would just be no fun.21:55
harmwhehe21:55
harmwsmoser: is multipart realy required straight away? or would a simpler implementation be fine as well, for starters. To just have some json user-data beeing applied. Allowing more input in a second phase, where you implement multipart.21:59
harmwhaving it read user-data and apply any json found inside would be a nice start I'd guess21:59
harmwhowever, given there already is a multipart parser...22:00
harmwshoot, I'll just go back to do some work on the fbsd module - tomorrow22:01
smoserharmw, i dont understand what yoiure asking really.22:02
smoseri dont wanto to just overload userdata. like grepping through it to see if there is a key in it.22:02
harmwagreed22:04
smoserharmw, thanks for all your input. i will try to get a re-build of cirros and a proper "0.3.2~pre2" out.22:09
smoser(proper meaning actually available in simplestreams data and without 'local22:10
smoser and tagged and such)22:10
smoserbefore i leave for holiday (friday).22:10
harmwah excellent22:10
smoseri just pushed the configuration change.22:10
harmwill take a look tomorrow22:10
=== harlowja is now known as harlowja_away
=== harlowja_away is now known as harlowja
=== shardy is now known as shardy_afk

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