/srv/irclogs.ubuntu.com/2022/01/17/#cloud-init.txt

=== EugenMayer2 is now known as EugenMayer
=== LewisGaul is now known as SiwelG
SiwelGHey, wondering if there's any docs/pointers for setting up a cloud image for a currently-unsupported distro?17:00
SiwelGe.g. how to install/configure cloud-init17:00
minimalSiwelG: don't think there's any specific docs17:23
minimalI have my own script for creating Alpine linux disk images with cloud-init setup17:24
SiwelGthat's exactly what I'm looking to do, don't suppose you'd be open to sharing them, even if just for inspiration? :)17:24
minimalSiwelG: https://github.com/dermotbradley/create-alpine-disk-image17:26
minimalhttps://github.com/dermotbradley/create-alpine-disk-image/blob/main/lib/disk-image-functions#L1179 is where cloud-init itself is configured but there is other OS-specific stuff that needs to be done also17:26
SiwelGthanks! will take a look17:28
minimalbasically you'd need to prepare an OS image somehow (i.e. in a chroot/via Packer) and then install cloud-init there, enable the cloud-init init.d/systemd services, proably tweak /etc/cloud/cloud.cfg, and end up with a disk image/VM image that you can then deploy17:29
SiwelG"prepare an OS image somehow (i.e. in a chroot/via Packer)" could also presumably be done by manually installing from an ISO?17:30
SiwelGbut that defeats the point a bit as you'd have to configure stuff you'd normally do in cloud-init?17:30
minimalinstall where though? to a loopback device? to an actual hard disk?17:31
SiwelGhard disk17:31
minimalcloud-init cannot configure itself (and things it depends upon) so that's why someone has to create a cloud-init enabled OS image17:31
SiwelGyes, I was wondering if it would be feasible to install an ISO in a qcow2 hard disk with QEMU, then manually install cloud-init inside the booted OS such that further configuration could be performed by cloud-init on a subsequent boot?17:32
minimalpossibly but that sort of defeats the point of cloud-init - the idea (certainly for VMs and Cloud instances) is to have a base OS image which already has cloud-init as part of it17:34
minimalthat's why I use my script to also build disk images for physical machines (like PCs and Raspberry PIs) where I simply "dd" the created disk image onto the machine and then boot it for the 1st time17:35
minimalso if I want to install 3 PCs using the same disk image I just need to modify the cloud-init YAML files before 1st boot to set hostname, network info, locale, timezone, user accounts to create, etc17:36
SiwelGindeed, but it might actually be fine for my use-case... I just want a single cloud-init base image that can be used as a template with configuration based on a cloud-init config file17:36
minimalso you're agreeing with me - you want to create a "template" OS image, which is where Packer/chroot etc typically provide the means17:37
minimalwhich distro?17:37
SiwelGI was going to be looking at Alpine, but just investigating what it takes to get cloud-init set up in general17:39
minimaldon't think of cloud-init as a "normal" package that you install on any system17:41
SiwelGah ok17:41
minimalrather its a "special" package that is used to build OS images17:41
minimale,g. for Debian you can download the normal ISO/USB stick-based installer17:42
minimalhowever Debian also have "cloud" images for download which are with cloud-init preinstalled and configured17:42
minimallikewise for most distros17:42
SiwelGI'm fine with manually doing the work to create a disk image from an ISO, but I was hoping to then use cloud-init to take that qcow2 image and create different variants of it17:42
SiwelGyes I do understand what you're explaining already, possibly I've made it seem like I know less than I do :)17:43
minimalif you look at my script it is exactly for creating various variants of cloud-init enabled Alpine, e.g. Virtualbox specific, QEMU specific, AWS specific, Raspberry Pi specific, etc17:43
minimalso for example with the AWS variant the aws-cli package is installed and the AWS-specific "ena" network device kernel module is available17:45
SiwelGyeah, I was just hoping for something a bit simpler than a 6000 line script in terms of understanding what's going on aha, still not sure I understand why installing an ISO and using the package manager to install cloud-init wouldn't work?17:48
minimalSiwelG: hint, its a script to create a script :-) If you run it (with no privs) it will spit aout a 500-600 script tailored for what you specified17:54
SiwelGyah I saw :p  sorry, doing a few things at once, will try it out17:55
minimalSiwelG: typically if you use a distro's normal installer it will result in things like hostname, SSH host keys etc being created which you will then have to remove from the base image as you don't want that in it17:55
SiwelGright I thought that would be the case, and that's my point - I don't care about those things being already configured as they're not things I want to configure with cloud-init17:56
minimalwhy not just use whichever distro's own cloud image?17:57
SiwelGBecause I wanted to try Alpine or another minimal distro, or possibly old versions/uncommon architectures17:58
minimalok, there is an "official" Alpine cloud image (not done by me) but its for AWS only (currently)17:58
SiwelGyeah I saw, I don't think it's one I can use17:58
minimalBTW I'm the Alpine package maintainer for cloud-init :-)17:59
SiwelGAh nice, as in you create the Alpine cloud images, or you maintain the cloud-init package that can be installed on Alpine?18:00
minimalas in I maintain the Alpine cloud-init package and I upstreamed Alpine support to cloud-init and submit occasional patches upstream to improve both cloud-init on Alpine and cloud-init in general18:01
minimalhttps://pkgs.alpinelinux.org/package/edge/community/x86_64/cloud-init18:01
SiwelGNice work, appreciated :)18:02
minimalI don't create the "official" Alpine cloud-init download (those guys build using Package and they are not currently using cloud-init, they are using tiny-init which is an AWS-only alternative to cloud-init)18:03
minimals/Package/Packer/18:03
minimalyou might want to have a look at README.Alpine in the cloud-init-doc package18:04
minimalthat Alpine package I mean18:04
minimalaka https://git.alpinelinux.org/aports/tree/community/cloud-init/README.Alpine18:04
SiwelGthanks. I might have to come back to have a play with this later, might ask again if I get stuck18:09
minimalSiwelG: no problems. Happy to help. I'm often on here and on the alpine-channels (on OFTC) also. Plus my email's in the Alpine package18:11
SiwelGThanks a lot!18:11
minimalthat README is as close to a guide as to how-to-setup-cloud-init as I've got - its a small audience interested in doing so and so didn't think it was worth the effort to document in detail - my script is "living" documentation :-)18:12
SiwelGthat's great, definitely a big step towards what I was looking for18:12
minimalSiwelG: I'm also working on some patches to Alpine's cloud-utils-growpart and cloud-init to reduce dependancies further (with MRs/PRs going upstream for this)18:14
SiwelGkeep up the good work, is this all done in your free time?18:15
minimalyupe18:17
=== arif-ali_ is now known as arif-ali

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