[05:44] <adi1992> Hi , I have some doubts on using cloud-init without a  cloud platform like openstack with a kvm hypervisor on ubuntu 14.04 machine ? Where should I post it ?
[05:48] <adi1992> http://blog.oddbit.com/2015/03/10/booting-cloud-images-with-libvirt/   : In this link the " virt-install -n example -r 512 -w network=default \   --disk vol=default/fedora-21-cloud.qcow2 --import \   --disk path=config.iso,device=cdrom " command did not work for me .
[05:48] <adi1992> the command that I tried virt-install -n cld_int -r 512 -w network=default --disk vol=/home/aditya/scienaptic/Fedora-Atomic-25-20170106.0.x86_64.qcow2 --import --disk path=config.iso,device=cdrom gave this error : ERROR    Error with storage parameters: Couldn't lookup volume object: Storage pool not found: no storage pool with matching name ''
[14:45] <Raboo> hello
[14:46] <Raboo> if i specify datasource_list: [  NoCloud, None ] and don't have any seedfrom or fs_label
[14:46] <Raboo> where will cloud init try to get user- & metadata?
[14:47] <Raboo> will it look at /user-data /meta-data?
[14:50] <Raboo> or hmm
[14:51] <Raboo> is it possible for cloud init to use user-data and meta-data from local filesystem?
[14:54] <Raboo> perhaps i can just create the a file with meta-data and user-data in /etc/cloud/cloud.cfg.d?
[14:57] <rharper> Raboo: NoCloud will look for either a directory in the image (/var/lib/cloud/seed/nocloud-net/{user-data,meta-data}  or if you have an ISO attached with the label 'cidata' ;
[14:58] <rharper> Raboo: on ubuntu, the 'cloud-image-utils' package provides a tool, 'cloud-localds' which helps create such an iso and shows how to attach to a local kvm instance
[14:59] <Raboo> rharper i'm thinking baremetal, not kvm
[14:59] <rharper> either works
[14:59] <Raboo> ok
[15:00] <Raboo> rharper i also just realized i can just put the user-data and meta-data in /etc/cloud/cloud.cfg.d i think.
[15:00] <rharper> some config can be set there;  I suggest populating /var/lib/cloud/seed/nocloud-net/
[15:01] <smoser> you can put user-data and meta-data in /etc/cloud/cloud.cfg.d/ also
[15:01] <smoser> the NoCloud's datasource config allows you to just put it there.
[15:01] <rharper> cool
[15:02] <Raboo> rharper i built an image with openstack's disk-image-create:
[15:02] <Raboo> DIB_CLOUD_INIT_DATASOURCES=NoCloud disk-image-create ubuntu baremetal dhcp-all-interfaces -o my-image
[15:03] <Raboo> and the qcow2 image didn't have a /var/lib/cloud folder
[15:04] <rharper> you have to populate that;  you can use mount-image-callback from the cloud-image-tools to mount up and modify;  or as smoser suggested, you can put the config in /etc/cloud/cloud.cfg.d/  if that dir is already there
[15:04] <rharper> mkdir -p /var/lib/cloud/seed/nocloud-net etc.
[15:05] <smoser> or cloud-localds also
[15:05] <smoser> withoutput tar
[15:06] <Raboo> ok
[15:06] <Raboo> why is there 3 different hostname in meta-data?
[15:07] <smoser> ?
[15:07] <Raboo> hostname, local-hostname, public-hostname
[15:07] <Raboo> and which one do i need?
[15:08] <Raboo> my previos experience i didn't need to build a meta-data file. but that was with kvm and opennebula, most likely openneubla already took care of that.
[15:08] <smoser> you dont need any.
[15:08] <smoser> i am confused.
[15:08] <smoser> if you're building a bare metal image for openstack
[15:08] <Raboo> no, for on-premise
[15:08] <smoser> then when you deploy it with openstack, openstack should deal with providing meta-ata
[15:09] <Raboo> i don't have openstack.
[15:09] <Raboo> i'm using foreman and trying to build a image deploy function for it.
[15:10] <Raboo> is meta-data needed?
[15:10] <smoser> the easiest thing to do would probably be just to disable cloud-init . by removing it, or (if newe enough cloud-init) touch /etc/cloud/cloud-init.disabled
[15:10] <Raboo> but i want cloud-init to configure the machine first boot.
[15:10] <Raboo> set hostname, install chef, run chef..
[15:11] <Raboo> the user-data contains hostname and fqdn. So i'm wondering if i need meta-data also.
[15:12] <Raboo> https://github.com/number5/cloud-init/blob/master/doc/examples/cloud-config-datasources.txt#L28
[15:13] <rharper> Raboo: AFAIK, you only need an instance-id: XXXX in meta-data
[15:13] <Raboo> rharper ok
[15:17] <Raboo> taken our discussions, this is what i ended up with: http://pastebin.com/PmRcY7hK
[15:18] <Raboo> rharper, smoser thanks for the input.
[15:18] <smoser> Raboo, but how will you give it user-data ?
[15:19] <rharper> looks like writing out to cloud.cfg.d/
[15:19] <smoser> are you planning on writing user-data to the image and then deploying it?
[15:19] <Raboo> my plan is this:
[15:19] <Raboo> 1. unknown node boots via pxe and loads a discovery image.
[15:20] <Raboo> 2. node pops up in foreman, and i press provision.
[15:21] <Raboo> 3. node reboots with a small image the runs a bash script that curls |dd of=/dev/sda
[15:22] <Raboo> 3b. the small image mounts /dev/sda to /mnt, writes /mnt/etc/cloud/cloud.cfg.d/[that file from pastebin, but rendered with hostname..]
[15:22] <Raboo> 3c. reboot
[15:23] <Raboo> 4. node boots from hdd and runs cloud init to configure the machine and run chef.
[15:25] <smoser> Raboo, generally speaking that should work.
[15:32] <smoser> Raboo, does foreman provide any way to provide user-data ?
[15:32] <smoser> without the ability for the user to provide some customizaiton information themselves, you kind of are very limited.
[15:40] <Raboo> smoser foreman has so called Provisioning tempaltes, intended for preseed, kickstart etc etc..
[15:41] <Raboo> basically you can have a dynamic cloud-init file as a provisioning template.
[15:41] <smoser> so how would that tie in here.
[15:41] <smoser> hmm. ok.
[15:44] <rharper> smoser: magicalChicken:  were either of your looking to bring in a curtin.net module update to cloudinit.net ?
[15:47] <Raboo> so my step 3 basically a small linux image that writes the ubuntu os image to disk and then downloads the cloud-init provisioning template from foreman and puts it in /etc/cloud/cloud.cfg.d/99-magicstuff.
[15:48] <smoser> Raboo, how does the small  linux image get booted ?
[15:48] <smoser> just curious. is it initramfs ?
[15:50] <Raboo> smoser yea, via pxe, will use this image https://theforeman.org/plugins/foreman_discovery/8.0/index.html#2.3ForemanDiscoveryImage
[15:50] <Raboo> will dual purpose it.
[15:51] <Raboo> discovery and deploy
[16:07] <Raboo> will cloud-init know that it is initialized (or will it try to run /etc/cloud/cloud.cfg.d/99-magicstuff every boot)?
[16:13] <smoser> Raboo, well, you have an instance-id in that.
[16:14] <smoser> if the instance-id changes, it will do the per-instance things again
[16:18] <magicalChicken> rharper: yes
[16:18] <magicalChicken> I was planning on working to combine the two modules into one code base
[16:19] <magicalChicken> I am still writing a doc for that, I'll send it out this weekend
[16:26] <rharper> ok