/srv/irclogs.ubuntu.com/2023/04/15/#cloud-init.txt

greebhi all, having difficulty figuring out the cloud-init ecosystem. As far as I can tell, there's a core set of features that the cloud-init utility itself provides, along with metadata that individual cloud providers expose as a datasource to cloud-init. If I were to just download some random cloud image of a Linux-based distribution, where would i begin to dissect what is supported? For example,00:47
greebthere is a note here: https://cloudinit.readthedocs.io/en/latest/reference/network-config.html that says PhotonOS disabled fallback networking. Where does Photon define that?00:47
greebadditionally, to figure out what metadata is provided per-cloud provider, would I just consult their docs (assuming the docs actually document this)00:47
minimalgreeb: let's backtrack - what are you trying to achieve?01:18
minimalyou want to create a VM on a particular Cloud Provider?01:19
greebI'm running terra(grunt|form) using the libvirt provider. It works well for quickly spinning up local VMs and I am starting to prefer it to vagrant. there is a templatized network configuration that terragrunt consumes. Here's the pastebin: https://pastebin.com/a5RU21A7 . The cloud I'm using is an official Ubuntu xenial image. My question is why does that network drop-in simply work.01:25
minimal"drop-in"?01:25
minimalso the cloud disk image (not "cloud") you're using is Ubuntu01:26
greebyes I understand the difference01:27
minimalso it doesn't sound like you have any problems01:27
greebI don't. I'm trying to figure out how it's working exactly.01:27
minimalits like using NoCloud Ds with libvirt providing a cidata ISO01:27
greebwhat does the D mean in what you just typed01:28
minimalDS = DataSource01:29
greebokay, I thought you mean Ds and in plural D01:29
greebmeant*01:29
minimaldid you try searching online? one of the 1st links I found explains how libvirt works with cloud-init01:29
minimaland assuming you're using this, https://registry.terraform.io/providers/DevScrewOps/libvirt/latest/docs/resources/cloudinit with Terraform its description mentions it creates a cidata ISO01:32
minimalbut none of this relates to what you were initially talking about01:35
greebI'm using this provider: https://github.com/dmacvicar/terraform-provider-libvirt . Let's go back to the original confusion regarding network configuration. See here: https://github.com/dmacvicar/terraform-provider-libvirt/blob/main/examples/v0.13/ubuntu/network_config.cfg I just copied this on faith and it works. Which is fine, but I want to understand why. Is 'ens3' baked into the image? How01:36
greebcan I check that myself?01:36
minimalens is a network interface, the naming of which depends on the distro you are using01:36
minimalthat's nothing specific to cloud-init01:37
greebyes I know01:37
greebI think I know where I'm not being clear, sorry.01:37
greebone sec01:37
greebSo let's say I roll my own image. Do I bake-in the network interface and put in documentation "use this interface in your cloud-init configurations" or do I leave it up to cloud-init (the documentation for which suggests some link detection magic) or do I do something else? I'm thinking from kind of a managerial perspective, sorry for being unclear earlier.01:39
minimalno you don't "bake in" the network interface, when any machine boots it will "see" whatever network interfaces are present, again that's nothing specific to cloud-init01:40
minimalhow such network interfaces are named is down ot the particular distro/OS config you are using01:40
minimali.e. old style "eth0, eth0" versus newer style scheme01:41
minimals/eth0, eth0/eth0, eth1/01:41
minimalalso are you asked specifically about "local" VM hypervisor environments only, not including Cloud Providers?01:43
greebyeah I know there's old style vs predictable naming scheme new style. In the example above, how is it guaranteed that ens3 is always going to be there on that xenial image? 01:44
minimala interface isn't "on" a OS image, it is on a physical/virtual machine that happens to be running the OS image01:44
greeblet me rephrase01:45
minimalcan you answer my last last question please01:45
greebI have no questions about cloud providers specifically no.01:45
minimalok, as network config doesn't apply there01:45
minimalso have a look at the docs regarding the network-config file: https://cloudinit.readthedocs.io/en/latest/reference/network-config.html01:46
minimalspecifically the links to the NoCloud v1 and v2 file formats01:46
minimalwith NoCloud I have my OS configured to use old style names so the 1st (perhaps only) network interface is eth001:48
greebI see. Thank you! this helps01:48
greebI should've kept reading this page before asking here.01:49
greebso there's no match keys in the network interfaces I'm using, which makes it seem like magic. So I'm assuming there is something in the xenial image forcing ens3 onto a deteced network interface.01:49
greebs/interfaces/configuration/g01:50
minimalor perhaps it is using the "fallback" of DHCP on the 1st present interface01:51
greebI think that's what's happening because no amount of grep'ing or find'ing is turning up the interface configuration on the VM post-boot.01:51
minimaleh? cloud-init will be setting the config appropriately01:52
minimalas it's Ubuntu it should be setting the netplan config file01:52
greebdisregard, nevermind haha01:52
greebanyway, thanks for you time. I should focus on this NoCloud type of config.01:53
greebs/you/your lol01:53
minimalcloud-init "renders" any network to the appropriate form for the distro (/etc/network/interfaces, netplan, sysconfig, etc)01:53
greebyeah, I realized the mistake of my last message wrt to that01:53
minimalwell you said you're not using Cloud Providers so yes, only NoCloud, is appropriate01:54
minimalif you enable debugging for the cloud-init logfile you'd see what exactly it is doing01:54
greebthanks, I'll try that out01:54
meenaoops https://github.com/NetworkConfiguration/dhcpcd/issues/19510:47
-ubottu:#cloud-init- Issue 195 in NetworkConfiguration/dhcpcd "dhcpcd bypasses firewall" [Open]10:47
holmanb@eb3095-Vultr: I have a question for you regarding __main__ in DataSourceVultr.py if you get a chance. See -> https://github.com/canonical/cloud-init/pull/2122/files#r116609426815:42
minimalholmanb: just starting to look at your dhcp changes15:47
minimalI guess fixing the dhcp stuff in NoCloud (for seed url access) would come via a different PR15:48
meenaholmanb: any15:57
meena15:57
meenado you want me to do a pr with the FreeBSD changes now, against your pr, or after it lands?15:58
holmanbmeena: after - just wanted your awareness for now15:59
meenaaye16:00
holmanbminimal: what needs to get fixed in nocloud for seed url?16:01
holmanbminimal: not sure I follow16:01
minimalholmanb: I mentioned previously that it is using the "fallback" method of adding an entry in /e/n/i and the relying on OS to bring up interface so that c-i can then fetch URLs to then read network config from meta-data to then rewrite /e/n/i16:03
holmanbahhh right that part16:03
minimalbut the 2nd (proper) network config is never activated as the interface is already up16:03
minimalbasically NoCloud in general uses fallback in no CIDATA found, which is fine16:03
minimalhowever for seed URL use fallback IMHO should *NOT* be used16:04
minimalrather the interface should be upped and dhcp client run, and then after URLs fetched it 16:04
minimaladdr should be deleted16:04
holmanbYep, I remember now. I'd like that issue to be a separate PR. 16:05
holmanbIt probably deserves a LP bug.16:05
minimalok, guess I'll raise an LP bug then, I don't currently understand the relevant parts of the code to write a PR yet16:06
holmanbappreciated, thanks16:07
minimalBTW with your current WIP I guess the idea of doing DHCP all in python is no longer being considered16:07
holmanbit's certainly still possible (easier, even with the refactor), but not the current plan16:10
minimalok16:11
holmanbThere was some internal hesitation around that approach with maintaining a custom client for only cloud-init, and dhcpcd is required anyways in images for initramfs, so the dhcpcd approach is seen as lowest risk/difficulty and doesn't require maintaining / adding new dependencies that aren't already needed in base images.16:14
holmanbLike I said, that could certainly change, and this PR doesn't lock us into that approach.16:16
holmanbAlso I see someone just offered a proposal for udhcpc16:17
eb3095-VultrI got that going to look when I get home in a few16:47
minimalholmanb: udhcpc "suffers" from the same limitation as dhclient, 1 process cannot do both IPv4 and IPv616:53
minimalbut yes it is good to see udhcpc interest, I'm interested in it as it is the default dhcp client for Alpine16:55
meenahonestly, can't wait for dhcpcd in FreeBSD16:58
holmanbeb3095-Vultr: much appreciated, thanks18:56
eb3095-Vultrnp!18:58
Lvl4SwordWhat do you use to verify your cloud-init isn't typoed?22:20

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