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:44 |
---|---|---|
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 '' | 05:48 |
=== shardy is now known as shardy_lunch | ||
=== shardy_lunch is now known as shardy | ||
=== rangerpbzzzz is now known as rangerpb | ||
Raboo | hello | 14:45 |
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:46 |
Raboo | will it look at /user-data /meta-data? | 14:47 |
Raboo | or hmm | 14:50 |
Raboo | is it possible for cloud init to use user-data and meta-data from local filesystem? | 14:51 |
Raboo | perhaps i can just create the a file with meta-data and user-data in /etc/cloud/cloud.cfg.d? | 14:54 |
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:57 |
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:58 |
Raboo | rharper i'm thinking baremetal, not kvm | 14:59 |
rharper | either works | 14:59 |
Raboo | ok | 14:59 |
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:00 |
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:01 |
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:02 |
Raboo | and the qcow2 image didn't have a /var/lib/cloud folder | 15:03 |
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:04 |
smoser | or cloud-localds also | 15:05 |
smoser | withoutput tar | 15:05 |
Raboo | ok | 15:06 |
Raboo | why is there 3 different hostname in meta-data? | 15:06 |
smoser | ? | 15:07 |
Raboo | hostname, local-hostname, public-hostname | 15:07 |
Raboo | and which one do i need? | 15:07 |
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:08 |
Raboo | i don't have openstack. | 15:09 |
Raboo | i'm using foreman and trying to build a image deploy function for it. | 15:09 |
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:10 |
Raboo | the user-data contains hostname and fqdn. So i'm wondering if i need meta-data also. | 15:11 |
Raboo | https://github.com/number5/cloud-init/blob/master/doc/examples/cloud-config-datasources.txt#L28 | 15:12 |
rharper | Raboo: AFAIK, you only need an instance-id: XXXX in meta-data | 15:13 |
Raboo | rharper ok | 15:13 |
Raboo | taken our discussions, this is what i ended up with: http://pastebin.com/PmRcY7hK | 15:17 |
Raboo | rharper, smoser thanks for the input. | 15:18 |
smoser | Raboo, but how will you give it user-data ? | 15:18 |
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:19 |
Raboo | 2. node pops up in foreman, and i press provision. | 15:20 |
Raboo | 3. node reboots with a small image the runs a bash script that curls |dd of=/dev/sda | 15:21 |
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:22 |
Raboo | 4. node boots from hdd and runs cloud init to configure the machine and run chef. | 15:23 |
smoser | Raboo, generally speaking that should work. | 15:25 |
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:32 |
Raboo | smoser foreman has so called Provisioning tempaltes, intended for preseed, kickstart etc etc.. | 15:40 |
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:41 |
rharper | smoser: magicalChicken: were either of your looking to bring in a curtin.net module update to cloudinit.net ? | 15:44 |
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:47 |
smoser | Raboo, how does the small linux image get booted ? | 15:48 |
smoser | just curious. is it initramfs ? | 15:48 |
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:50 |
Raboo | discovery and deploy | 15:51 |
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:07 |
smoser | Raboo, well, you have an instance-id in that. | 16:13 |
smoser | if the instance-id changes, it will do the per-instance things again | 16:14 |
magicalChicken | rharper: yes | 16:18 |
magicalChicken | I was planning on working to combine the two modules into one code base | 16:18 |
magicalChicken | I am still writing a doc for that, I'll send it out this weekend | 16:19 |
rharper | ok | 16:26 |
=== rangerpb is now known as rangerpbzzzz |
Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!