[01:07] <tcurdt> I am looking for a way to ship some files (or rather just some shells scripts) with the cloud init. I can't seem to find a (straight forward) way of doing so.
[01:07] <tcurdt> Isn't that what "user-data scripts" should be?
[01:11] <tcurdt> or is there a way to reference a file for the content of a write_files in the cloud init?
[01:37] <tcurdt> maybe as context ... I am running this from terraform as .... user_data = file("cloud-config.yml") 
[01:40] <tcurdt> is this what I am looking for? https://registry.terraform.io/providers/hashicorp/template/latest/docs/data-sources/cloudinit_config
[01:52] <tcurdt> or is there an easier way to upload a couple of files alongside of cloud init?
[10:12] <godofsea> Hi
[10:13] <godofsea> Is there a way to define cloud-init user-data and network-data in the same file ?
[13:56] <akutz> godofsea: It would depend entirely on the datasource AFAIK since how network data is obtained is DS-specific.
[14:17] <falcojr> right, network-data comes from the datasource, not the user-data
[14:18] <falcojr> blackboxsw: release PR is up https://github.com/canonical/cloud-init/pull/993
[15:26] <godofsea> akutz, falcojr yeah I have the datasource specific network-data config, I am trying to set it up on proxmox, for some reason the user-data config is applied but the network data is not applied. 
[16:18] <blackboxsw> falcojr: thanks reviewing daily integration test results now to make sure we aren't looking at degraded behavior  etc.
[16:56] <blackboxsw> meh, falcojr running tox -e integration-tests locally do you get SSH banner protocol errors from pycloudlib frequently?
[16:57] <blackboxsw> I see it on CLOUD_INIT_OS_IMAGE=hirsute or focal 
[16:57] <blackboxsw> running tox -e integration-tests  tests/integration_tests/modules/test_ssh_keysfile.py
[17:06] <falcojr> PR is already up for the bottom one 
[17:06] <falcojr> I haven't seen banner errors though 
[17:25] <Nothing4You> godofsea: i just set 2 different settings for user-data and network-data: qm set "$vmid" --cicustom "user=local:snippets/cloud-init-$vmid-user.yaml,network=local:snippets/cloud-init-$vmid-network.yaml"
[17:26] <Nothing4You> it did take me some time to get the syntax of the network.yaml right tho
[17:29] <godofsea> Nothing4You, yeah I think that's the thing, my syntax is wrong I guess. I have to define route: ...  
[17:29] <Nothing4You> godofsea: this is how my network yaml looks like: https://paste.debian.net/plainh/c38c6325
[17:32] <Nothing4You> in my case i'm adding netplan to the image btw and using that to render
[17:34] <godofsea> Nothing4You, this is mine https://paste.debian.net/1208728 , how are you adding netplan to the image ?
[17:35] <Nothing4You> godofsea: https://paste.debian.net/hidden/fbee5058/
[17:35] <Nothing4You> haven't tested with bullseye yet but it works fine for me on debian buster
[17:37] <Nothing4You> godofsea: i think you just need to remote the top most network object
[17:37] <Nothing4You> and have everything go up one level
[17:37] <Nothing4You> s/remote/remove/
[17:38] <Nothing4You> netplan shouldn't be needed for most things though, in my case i do need it specifically because otherwise i can't set routes with specific source ips i think
[17:39] <godofsea> that makes sense, I had to create the netplan file manually using the console. It was a pain. This is why I am moving to cloud-init
[17:39] <godofsea> I will try it without the topmost network object 
[17:40] <Nothing4You> this is the kind of stuff i'm playing with :) https://paste.debian.net/hidden/7d8aae64/
[17:41] <Nothing4You> (+ipv6 but stripped for simplicity)
[17:41] <godofsea> ahh nice! similar to what I am trying to do :-)
[17:42] <godofsea> XD 
[17:42] <blackboxsw> falcojr: thanks for the PR https://github.com/canonical/cloud-init/pull/992/files
[17:43] <blackboxsw> falcojr: merged https://github.com/canonical/cloud-init/pull/993
[17:44] <godofsea> Nothing4You, can you please explain what you are doing from line 34 in https://paste.debian.net/hidden/fbee5058/ 
[17:45] <Nothing4You> that's basically just the commands running in the chroot env
[17:45] <Nothing4You> so on 37 i force netplan as renderer as it may otherwise not use netplan if other renderers are installed
[17:46] <Nothing4You> line 46 enables mem hotplug as per https://pve.proxmox.com/wiki/Hotplug_(qemu_disk,nic,cpu,memory)
[17:46] <Nothing4You> rest should be mostly self explaining
[17:47] <Nothing4You> line 20 is because the debian cloud image has the partition numbers out of order
[17:47] <Nothing4You> godofsea: does that answer it?
[17:48] <godofsea> yeah, makes sense now :) Thanks
[17:48] <Nothing4You> i also have a version that turns the image into btrfs
[17:49] <Nothing4You> https://paste.debian.net/hidden/d1089069/
[17:49] <godofsea> woahh !! Cool 
[17:53] <godofsea> I haven't really worked with btrfs, What advantages does it have over ext4 ? Nothing4You 
[17:53] <Nothing4You> snapshots for starters
[17:53] <Nothing4You> compression
[17:54] <Nothing4You> you can also btrfs-send snapshots over the network for backups if you wanted
[17:55] <Nothing4You> note though that with btrfs in the image i believe all vms from that image will share the volume uuids, so you may not want to use it this way if you intend to send snapshots between machines
[17:56] <Nothing4You> i don't think that was something that could easily be reset e.g. by cloud-init
[17:59] <godofsea> removing the topmost network object worked :)
[18:00] <Nothing4You> nice
[18:03] <godofsea> it worked, somewhat, still can't connect to internet. But that's a different issue. 
[18:04] <Nothing4You> i don't think you should have the scope link on the default route
[18:08] <godofsea> Nothing4You, This has worked for me in the past, I add this https://paste.debian.net/hidden/14aa2375/ to netcfg.yaml file and then sudo netplan appy. it worked. 
[18:10] <Nothing4You> can you access the guest at all currently to verify the effective config?
[18:10] <Nothing4You> as in only internet connectivity dead?
[18:11] <godofsea> I can access it via console but not over the internet 
[18:11] <Nothing4You> what do you get from `ip r`?
[18:12] <Nothing4You> considering that you have a /32 on the interface address i don't think it's able to set the gw route
[18:12] <Nothing4You> unless that is automatically set with scope link?
[18:12] <Nothing4You> not sure
[18:12] <Nothing4You> also just reading your snippet again
[18:12] <Nothing4You> host ip via 0.0.0.0/0 doesn't make sense
[18:13] <Nothing4You> i read that the other way round
[18:13] <Nothing4You> i'm not sure about the order of the routes, but if you first put the host route with scope link and then you put the default route (as explicit route instead of gateway4) then i think you should be good?
[18:13] <godofsea> so when I do ip r , I get `default via <HOST_IP>.254`
[18:14] <Nothing4You> and no route to the host ip?
[18:14] <Nothing4You> i think you need routes 1 and 3 from my example (skipping from:) https://paste.debian.net/hidden/7d8aae64/
[18:14] <godofsea> yeah 2 lines of output, 2nd line is ` <HOST_IP>.254`
[18:15] <Nothing4You> can you grab the full line? there's more info than that to read
[18:16] <Nothing4You> default via GATEWAY dev ens18 proto static
[18:16] <Nothing4You> GATEWAY dev ens18 proto static scope link
[18:16] <Nothing4You> that's what mine looks like if i strip the 2nd route and the src ip part
[18:16] <Nothing4You> scope link on the gw route and the other one just towards GATEWAY
[18:17] <godofsea> default via <HOST_IP>.254 dev ens18 proto static 
.254 dev ens18 proto static scope link 
[18:17] <godofsea> This is it
[18:17] <Nothing4You> ok, looks the same as mine then
[18:17] <Nothing4You> can you ping the host ip?
[18:19] <godofsea> Host ip is the IP address of the proxmox machie 
[18:19] <Nothing4You> yes, can you ping the proxmox host from inside the vm?
[18:19] <godofsea> okay 
[18:21] <godofsea> It says destination host unreachable 
[18:22] <Nothing4You> you tried to ping the ip that is in the link scoped route, right?
[18:23] <godofsea> Yeah both, the one with .254 and the actual proxmox Host IP
[18:24] <Nothing4You> did you configure the proxmox host to actually have .254 on the interface that is connected to the vm?
[18:25] <godofsea> Interesting ! I reinstalled proxmox, and upgraded it to 7, so its clean, didnt do anything like that 
[18:26] <godofsea> got a link ? 
[18:26] <Nothing4You> well if you don't configure proxmox to have an interface with that ip it's not surprising you can't reach it
[18:26] <Nothing4You> idk, i don't use any of proxmox's builtin network capabilities as they're not flexible enough for me
[18:27] <Nothing4You> https://pve.proxmox.com/wiki/Network_Configuration can probably guide you through the process
[18:28] <godofsea> found this https://pve.proxmox.com/wiki/OVH 
[18:28] <Nothing4You> > for Proxmox VE 4.x.
[18:28] <Nothing4You> not sure how well that still applies
[18:28] <Nothing4You> it also depends on how isolated you want to build your network, e.g. if you trust your vms to not steal each others ips you can put them all on the same bridge interface
[18:28] <Nothing4You> if you don't trust your vms what i'm doing is having a bridge interface per vm
[18:29] <Nothing4You> you also don't necessarily need a .254 ip
[18:30] <akutz> Yay, 21.3 is merged!!!
[18:30] <Nothing4You> also depends on whether you have public ips for your vm and a couple other factors, most of my vms have a native ipv4 address routed to them
[18:31] <godofsea> actually all my vms should be accessible via the internet so all of them have their own unique IP 
[18:32] <Nothing4You> then you could even get away without having a private ip range
[18:33] <Nothing4You> just use the same host ip on all bridge interfaces (if you have multiple) and have the vms route to the host interface
[18:33] <Nothing4You> *route to host ip
[18:34] <Nothing4You> and on the host you need the route(s) to the bridge interface(s)
[18:35] <godofsea> I think my bridge port is wrongly defined in /etc/network/interfaces
[18:37] <godofsea> https://paste.debian.net/hidden/f4d4ffb6/ this is how it looks, bridge port is correct nvm
[18:39] <Nothing4You> just to be sure, <HOST_IP>.254 is the ip of the provider gateway, right?
[18:40] <Nothing4You> and your current goal is to have the proxmox host behave like a switch?
[18:40] <godofsea> for the first question yes, 
[18:41] <godofsea> 2nd one is also yes , I guess
[18:41] <Nothing4You> ok
[18:42] <Nothing4You> my setups are normally that the host is a router instead of a switch so i was thinking about a slightly different setup
[18:44] <godofsea> It's okay. I can come very far, I will figure it out from here on. Also can you gimme a link where I can read about these things, network stuff . subnets and other things like that. 
[18:45] <Nothing4You> i don't have any specific resources, what you're looking to set up is (for the host part) probably this https://pve.proxmox.com/wiki/Network_Configuration#_default_configuration_using_a_bridge
[18:45] <Nothing4You> and it looks like you have that already
[18:45] <Nothing4You> your provider may be limiting which macs can route traffic to it, so if your host acts as a switch the vm mac will be forwarded
[18:46] <Nothing4You> the ovh proxmox page also mentions that: First you need to use the OVH manager to create a virtual mac address for the address you want to assign. Then you can create the virtual machine in the Proxmox VE GUI and assign the generated mac address to your virtual network card. 
[18:46] <Nothing4You> that might even be all that's needed to get it to work
[18:46] <Nothing4You> assuming you're using ovh
[18:47] <godofsea> ahh okay.  
[18:47] <Nothing4You> i have the same thing at hetzner but as i use the host as a router i don't need that
[18:49] <godofsea> lemme look up the difference between router and switch real quick 
[18:58] <godofsea> Mine's a router not a switch :)
[18:58] <Nothing4You> with bridge-ports eno1 it behaves as switch
[19:00] <Nothing4You> it's also easier to set up that way
[19:04] <godofsea> I think its got something to do with OVH manager. Thanks Nothing4You for all the help. Signing off 
[19:04] <Nothing4You> np, good luck
[20:10] <akutz> I am telling everyone at work who will listen about this link -- https://cloudinit.readthedocs.io/en/stable/topics/datasources/vmware.html. Thank you for all your help blackboxsw, falcojr, minimal, rharper, and everyone else!
[20:11] <falcojr> 🎉
[20:16] <rharper> akutz: \o/
[21:22] <blackboxsw> falcojr: https://github.com/canonical/cloud-init/pull/992 can land if we rebase .... again.
[21:25] <falcojr> doh...
[21:25] <blackboxsw> falcojr: also are you putting up a PR for the upload to impish?
[21:25] <blackboxsw> probably after 992 lands?
[21:26] <falcojr> yeah, I gotta get some food going first though :)
[21:50] <blackboxsw> landed https://github.com/canonical/cloud-init/pull/992
[21:51] <blackboxsw> if a PR is put up for Impish upload, I'll review and dput it
[21:58] <falcojr> blackboxsw: https://github.com/canonical/cloud-init/pull/994
[22:09] <blackboxsw> building will upload if all's good
[22:16] <blackboxsw> falcojr: [ubuntu/impish-proposed] cloud-init 21.3-1-g6803368d-0ubuntu1 (Accepted)   I'm merging now
[22:17] <blackboxsw> https://github.com/canonical/cloud-init/pull/994#pullrequestreview-736612813 merged
[23:10] <falcojr> Sweet, I threw up the other branches too