ashishjain a newbie here .. trying to use cloud-init with libvirt07:59
ashishjainhowever data injection is not happening :(07:59
ashishjaincloud-init.log gives some errors like "Failed at attempted import of DataSourceNone"08:01
ashishjainNo local datasource found etc08:01
ashishjainI am using cloud-init 0.7.508:02
ashishjainKindly help.08:02
ashishjainany samaritan here  who can help me10:49
arkinashishjain: what with?11:55
arkinAh no, thats outside of my expertise11:55
ashishjainarkin: cloud-init with libvirt11:57
ashishjaincloud-init with kvm12:00
smoserashishjain, what is it you're wanting ?12:57
smoserexplain how yu're try;ing to do it.12:57
ashishjain@smoser: Data injection does not work for me12:57
smoserand look in cloud-init.log for WARN12:57
ashishjainHere is what I do12:57
ashishjainI have got a base ubuntu image say base.img and a iso say init.iso.12:58
ashishjainthis init.iso has been created using genisoimage using user-data and meta-data files12:58
ashishjainNow I have tried using virt-manager as well as virt-install to create a vm, while my VM is created fine but it does not pick any data from init.iso12:59
ashishjainI am not sure if thei is some field which is not being correctly passed12:59
ashishjainI will paste the command which I use13:00
ashishjainsudo virt-install -r 1024   -n test   --vcpus=1  --import --disk vol=test-pool/coe-lab-002-Backup.img,format=vmdk,bus=virtio --boot hd --disk vol=test-pool/init.iso,bus=virtio13:02
ashishjainhere test-pool is the custom pool created by me13:03
ashishjain.img file is of type vmdk13:04
=== mfisch is now known as Guest61243
smoserashishjain, its probably the type of data you're putting on it.13:32
smoseri suggest you use cloud-localds13:32
smoser(or look at what it does)13:32
smoserthe type of the disk should not matter, but the label on the volume must be 'cidata'13:33
ashishjain@smoser: This is the command I use to generate the iso which has got cidata13:42
ashishjaingenisoimage -output init.iso -volid cidata -joliet -rock user-data meta-data13:42
ashishjain@smoser: How to use cloud-localds?13:44
ashishjain@smoser: Is their a binary which can be invked13:44
smoserapt-get install cloud-image-utils13:45
smosercloud-localds (see the help there)13:45
* smoser has to reboto13:45
ashishjain${0##*/} my-seed.img my-user-data my-meta-data13:45
ashishjainya I could see here13:45
ashishjainwhat is "${0##*/}"?13:45
smoserashishjain, basename $013:59
smoserif you have ubuntu, just apt-get install it and use it.13:59
ashishjain@smoser: Yes I got ubunutu I will  try it out and let you know.14:00
ashishjain@smoser: It does not help I still have the same issue14:31
ashishjainkvm -net nic -net user,hostfwd=tcp::2222-:22 -drive file=coe-lab-002-Backup.img,if=virtio -drive file=init.iso,if=virtio14:31
ashishjain@smoser: I used the following command14:32
ashishjaincloud-localds init.iso user-data meta-data14:33
smoserand you're booting a ubuntu image ?14:34
ashishjainyes ubuntu trusty14:38
ashishjaincan it be a cloud-init bug14:38
ashishjainthis is my user-data and meta-data14:40
ashishjainsome messages in my cloud-init.log are as follows:14:43
ashishjainFailed at attempted import of "DataSourceNone" due to: No module named DataSourceNone14:45
ashishjainNo local datasource found14:45
ashishjainone bug which I found just now https://bugs.launchpad.net/cloud-init/+bug/135685514:49
smoserashishjain, can you log in and get /var/log/cloud-init.log ?15:00
smoseryou can "backdoor" the image with 'backdoor-iamge' easily so you'll be able to log in15:00
ashishjainaah google search helps a lot15:03
smoserright. basically it just ads a user and a password , makeing sure you can log in15:03
ashishjainI am able to log-in15:03
ashishjainbecause the base image has got a username and password15:04
ashishjain@smoser: I am able to login but no idea how can copy the log file :(15:28
ashishjainthe login is possible only through virt-manager console or kvm UI15:28
ashishjainbut none of these interfaces are allowing me to copy the log file15:28
smosersudo apt-get install pastebinit15:29
smoserpastebinit /var/log/cloud-init.log15:30
smoserif you have networking then you can scp it out too.15:30
smoseror, you can use 'mount-image-callback'' and mount the image and get it that way.15:30
smosersudo mount-image-callback /path/to/that/image.img -- sh -c 'cat $MOUNTPOINT/var/log/cloud-init.log'15:31
ashishjain@smoser: here is the complete log http://paste.openstack.org/show/472903/15:40
smoserashishjain, i think you have some config that tells it only to look for datasource none15:44
ashishjain@smoser, here is one  bug https://bugs.launchpad.net/cloud-init/+bug/135685515:45
ashishjainwhich says cloud-init always looks for some particular datasource15:45
ashishjain@smoser: Any ideas where  this configuration can be?15:46
smoser$ cat /etc/cloud/cloud.cfg.d/90_dpkg.cfg15:47
smoser# to update this file, run dpkg-reconfigure cloud-init15:47
smoserdatasource_list: [ NoCloud, ConfigDrive, OpenNebula, Azure, AltCloud, OVF, MAAS, GCE, OpenStack, CloudSigma, SmartOS, Ec2, CloudStack, None ]15:47
smoserthat is what you'd normally see, and you can configure it by (as it says) running dpkg-reconfigure15:47
smoseri suspect somewhere in /etc/cloud/cloud.cfg.d or /etc/cloud/cloud.cfg you have 'datasource_list' defined15:48
ashishjainIn 90_dpkg.cfg I have only one entry " datasource_list: [ None ]"15:51
ashishjain@smoser: I configure it to have all the entries I will try it now15:53
ashishjainthanks for this pointer15:53
smoserfor this purpose you only need NoCloud . fwiw. and you shoudl always enable 'None' as fallback.15:53
ashishjain@smoser: voila !!15:59
ashishjain@smoser: It worked.15:59
ashishjain@smoser: thanks a lot for your time and help16:00
smoserno problem.16:08
ashishjain@smoser: One more question is their a python api to automate the creation of disk for cloud-init...same as what is done by genisoimage or cloud-localds16:09
smoserthere is not. i'd just use cloud-localds and subprocess.16:12
arkinHi all, I've just started getting this error on my provider— __init__.py[WARNING]: Unhandled non-multipart (text/x-not-multipart) userdata: 'hostname: skasu2\nfqdn: s...'16:19
arkinits preventing the server from being setup, can someone help me get past it ??16:20
ashishjain@smoser: Thanks, are their any other alternatives to inject data into a VM..something whcih is done by openstack by hosting on a
smoserarkin, '#cloud-config' at top.16:22
smoserits ignoring your data by design16:22
smoseryou need to tell it it is for cloud-init.16:22
smoserashishjain, https://gist.github.com/smoser/1278651/16:23
arkinsmoser: I have that— https://www.dropbox.com/s/08nduxrxsh0dwia/Screenshot%202015-09-21%2017.23.22.png?dl=016:23
smoserarkin, that would seem like it shoudl be ok16:24
arkinIt was working, I thought it was something about my host updating cloud-init :/16:24
arkinmaybe it had to be changed, I guess not16:24
ashishjain@smoser: Thanks for that link. I will look into it.16:24
arkinsmoser: I'll debug whether #cloud-config gets passed as I do replacements on the {{ alias }} etc16:25
smoserarkin, yeah, i wonder if your templter is stripping that as a comment16:26
arkinsmoser: You are spot on actually, I recently added that16:26
arkinsmoser: Trimming the config files before uploading them ;)16:26
smoserarkin, you can view what cloud-init saw inside by:16:27
smoser at /var/lib/cloud/instance/user-data.txt16:27
arkinsmoser: perfect, thanks16:28
arkinsmoser: don't suppose you are any good at regex ? :D16:28
smoseri can try quickly16:28
smoserbut only quickly :)16:28
arkinsmoser: I have no issues coming up with ^\s*#.+$ to strip comments16:28
arkinI want to add an exception for cloud-config using a negative lookahead16:29
smoserdo you have a build-your-own template engine ?16:29
smoserrather than cheetah or jina or something16:30
arkinsmoser: Yeah only needs to be super simple16:31
smoseri dont know.16:31
smoserif you know that you're always producing cloud-config,16:31
smoserone thing that you coudl do is just let the renderer render16:32
smoserand then add the cluod-config16:32
smoserand then you could also verify that the renderer produced valid yaml (which is oftne non-obvious016:32
smoserby just verifying: yaml.load(that_rendered_text)16:32
arkinsmoser: good suggestion actually, thanks. I'm new to yaml16:32
arkinsmoser: and thanks for your help/advice16:34
sputnik13hah, sweet17:56
sputnik13just thought I'd try and see if cloud-init had a channel, of course it does :-D17:56
harlowjasputnik13 whats uppp17:59
harlowjai know u!18:00
harlowjaharlowja is everywhere!18:00
sputnik13yes, yes you are18:00
sputnik13when do you start the harlowja for president of the universe campaign18:00
harlowjaoh, i already won that18:01
sputnik13cloud-init doesn't support lvm resizing right?18:01
harlowjai don't think so,18:01
sputnik13disk-image-builder has a -l option to set up the root volumes on lvm18:02
harlowjahttps://github.com/stackforge/cloud-init/blob/0.7.x/cloudinit/config/cc_resizefs.py#L78 resize stuffs/module18:02
harlowjai may or may not have touched that code at some point18:02
sputnik13but such images fail to resize at boot for the obvious reason that cloud-init don't handle it :)18:02
harlowjadamn cloud-init18:03
harlowjasmoser might know more about all this though, if he's around18:03
smoseri know all about all18:08
smosercloud-init does not due lvm resizing18:09
smoserwhy do you build images with lvm ?18:09
harlowjasputnik13 why did u do such a thing????!!!?18:09
smoser(im not opposed to supporting that)18:09
harlowjaOdd_Bloke smoser sputnik13 is a taskflow-core, so can also be bugged about taskflow18:09
harlowjawe are all about cross-pollination, ha18:10
sputnik13uh oh18:30
* sputnik13 goes in to hiding18:30
sputnik13smoser: mine is not to ask why, mine is to do or die...  in other words I was told make lvm work :)18:31
sputnik13for the time being we're probably going to use some custom scripts or whatever at boot time via userdata, but I was holding out hope that there's some hidden feature in cloud-init that solves all my problems18:32
sputnik13and makes me coffee and a corned beef hash with poached eggs for breakfast18:32
sputnik13looks like I'm not getting any of those :(18:32
smosersputnik13, i think have to add that support to growpart18:33
smosercloud-initm ight be trying to run resize2fs correctly18:34
smoserbut if nothing made the root volume any larger, then that doesn't do anything.18:34
smoserand the thing that does that on non-lvm is growpart18:34
harlowjacorned beef module isn't merged yet, lol18:39
sputnik13can it make me corned beef hash too?18:39
sputnik13doh, beat me to the punch :)18:39
sputnik13so growpart normally does parted or something similar yes?18:40
sputnik13for lvm support, the partition probably needs to be resized, then pvresize, vgresize, and lvresize18:40
sputnik13or some combination thereof18:40
smosergrowpart uses sfdisk18:41
smoserso yeah, growpart would have to recognize that this was an lvm volume and use those tools18:41
sputnik13hmm, so I would expect that at least the partition resize to still go OK, but growpart fails with the following... http://paste.openstack.org/show/473343/22:01
sputnik13ahhh, need to run partprobe to re-read partition table but growpart is failing and reverting because sfdisk is returning an error22:18
sputnik13orrrr, not23:17
* sputnik13 is confused23:17
sputnik13errr orrr yes...  yes, it is failing and reverting23:20
harlowjahmmm, that seeems bad23:24
harlowjadon't do that23:24
sputnik13I think what I want is for it to do a partprobe, re-read the part table, and if it's not what it should be then attempt a revert23:26
sputnik13it's not that the update actually failed, sfdisk isn't doing a partprobe for you, so it returns an error saying you need to do it23:26
sputnik13I think23:26
sputnik13too many "i think"s here for my comfort23:26

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