tcurdtI 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
tcurdtIsn't that what "user-data scripts" should be?01:07
tcurdtor is there a way to reference a file for the content of a write_files in the cloud init?01:11
tcurdtmaybe as context ... I am running this from terraform as .... user_data = file("cloud-config.yml") 01:37
tcurdtis this what I am looking for? https://registry.terraform.io/providers/hashicorp/template/latest/docs/data-sources/cloudinit_config01:40
tcurdtor is there an easier way to upload a couple of files alongside of cloud init?01:52
=== toolz is now known as Daniel
=== cpaelzer_ is now known as cpaelzer
godofseaIs there a way to define cloud-init user-data and network-data in the same file ?10:13
=== rbasak_ is now known as rbasak
=== andrewbogott_ is now known as andrewbogott
akutzgodofsea: It would depend entirely on the datasource AFAIK since how network data is obtained is DS-specific.13:56
falcojrright, network-data comes from the datasource, not the user-data14:17
falcojrblackboxsw: release PR is up https://github.com/canonical/cloud-init/pull/99314:18
ubottuPull 993 in canonical/cloud-init "Release 21.3" [Open]14:18
godofseaakutz, 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. 15:26
blackboxswfalcojr: thanks reviewing daily integration test results now to make sure we aren't looking at degraded behavior  etc.16:18
blackboxswmeh, falcojr running tox -e integration-tests locally do you get SSH banner protocol errors from pycloudlib frequently?16:56
blackboxswI see it on CLOUD_INIT_OS_IMAGE=hirsute or focal 16:57
blackboxswrunning tox -e integration-tests  tests/integration_tests/modules/test_ssh_keysfile.py16:57
falcojrPR is already up for the bottom one 17:06
falcojrI haven't seen banner errors though 17:06
Nothing4Yougodofsea: 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:25
Nothing4Youit did take me some time to get the syntax of the network.yaml right tho17:26
godofseaNothing4You, yeah I think that's the thing, my syntax is wrong I guess. I have to define route: ...  17:29
Nothing4Yougodofsea: this is how my network yaml looks like: https://paste.debian.net/plainh/c38c632517:29
Nothing4Youin my case i'm adding netplan to the image btw and using that to render17:32
godofseaNothing4You, this is mine https://paste.debian.net/1208728 , how are you adding netplan to the image ?17:34
Nothing4Yougodofsea: https://paste.debian.net/hidden/fbee5058/17:35
Nothing4Youhaven't tested with bullseye yet but it works fine for me on debian buster17:35
Nothing4Yougodofsea: i think you just need to remote the top most network object17:37
Nothing4Youand have everything go up one level17:37
Nothing4Younetplan 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 think17:38
godofseathat 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-init17:39
godofseaI will try it without the topmost network object 17:39
Nothing4Youthis is the kind of stuff i'm playing with :) https://paste.debian.net/hidden/7d8aae64/17:40
Nothing4You(+ipv6 but stripped for simplicity)17:41
godofseaahh nice! similar to what I am trying to do :-)17:41
godofseaXD 17:42
blackboxswfalcojr: thanks for the PR https://github.com/canonical/cloud-init/pull/992/files17:42
ubottuPull 992 in canonical/cloud-init "testing: Fix ssh keys integration test" [Open]17:42
blackboxswfalcojr: merged https://github.com/canonical/cloud-init/pull/99317:43
ubottuPull 993 in canonical/cloud-init "Release 21.3" [Merged]17:43
godofseaNothing4You, can you please explain what you are doing from line 34 in https://paste.debian.net/hidden/fbee5058/ 17:44
Nothing4Youthat's basically just the commands running in the chroot env17:45
Nothing4Youso on 37 i force netplan as renderer as it may otherwise not use netplan if other renderers are installed17:45
Nothing4Youline 46 enables mem hotplug as per https://pve.proxmox.com/wiki/Hotplug_(qemu_disk,nic,cpu,memory)17:46
Nothing4Yourest should be mostly self explaining17:46
Nothing4Youline 20 is because the debian cloud image has the partition numbers out of order17:47
Nothing4Yougodofsea: does that answer it?17:47
godofseayeah, makes sense now :) Thanks17:48
Nothing4Youi also have a version that turns the image into btrfs17:48
godofseawoahh !! Cool 17:49
godofseaI haven't really worked with btrfs, What advantages does it have over ext4 ? Nothing4You 17:53
Nothing4Yousnapshots for starters17:53
Nothing4Youyou can also btrfs-send snapshots over the network for backups if you wanted17:54
Nothing4Younote 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 machines17:55
Nothing4Youi don't think that was something that could easily be reset e.g. by cloud-init17:56
godofsearemoving the topmost network object worked :)17:59
godofseait worked, somewhat, still can't connect to internet. But that's a different issue. 18:03
Nothing4Youi don't think you should have the scope link on the default route18:04
godofseaNothing4You, 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:08
Nothing4Youcan you access the guest at all currently to verify the effective config?18:10
Nothing4Youas in only internet connectivity dead?18:10
godofseaI can access it via console but not over the internet 18:11
Nothing4Youwhat do you get from `ip r`?18:11
Nothing4Youconsidering that you have a /32 on the interface address i don't think it's able to set the gw route18:12
Nothing4Youunless that is automatically set with scope link?18:12
Nothing4Younot sure18:12
Nothing4Youalso just reading your snippet again18:12
Nothing4Youhost ip via doesn't make sense18:12
Nothing4Youi read that the other way round18:13
Nothing4Youi'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
godofseaso when I do ip r , I get `default via <HOST_IP>.254`18:13
Nothing4Youand no route to the host ip?18:14
Nothing4Youi think you need routes 1 and 3 from my example (skipping from:) https://paste.debian.net/hidden/7d8aae64/18:14
godofseayeah 2 lines of output, 2nd line is ` <HOST_IP>.254`18:14
Nothing4Youcan you grab the full line? there's more info than that to read18:15
Nothing4Youdefault via GATEWAY dev ens18 proto static18:16
Nothing4YouGATEWAY dev ens18 proto static scope link18:16
Nothing4Youthat's what mine looks like if i strip the 2nd route and the src ip part18:16
Nothing4Youscope link on the gw route and the other one just towards GATEWAY18:16
godofseadefault via <HOST_IP>.254 dev ens18 proto static 18:17
godofsea<HOST_IP>.254 dev ens18 proto static scope link 18:17
godofseaThis is it18:17
Nothing4Youok, looks the same as mine then18:17
Nothing4Youcan you ping the host ip?18:17
godofseaHost ip is the IP address of the proxmox machie 18:19
Nothing4Youyes, can you ping the proxmox host from inside the vm?18:19
godofseaokay 18:19
godofseaIt says destination host unreachable 18:21
Nothing4Youyou tried to ping the ip that is in the link scoped route, right?18:22
godofseaYeah both, the one with .254 and the actual proxmox Host IP18:23
Nothing4Youdid you configure the proxmox host to actually have .254 on the interface that is connected to the vm?18:24
godofseaInteresting ! I reinstalled proxmox, and upgraded it to 7, so its clean, didnt do anything like that 18:25
godofseagot a link ? 18:26
Nothing4Youwell if you don't configure proxmox to have an interface with that ip it's not surprising you can't reach it18:26
Nothing4Youidk, i don't use any of proxmox's builtin network capabilities as they're not flexible enough for me18:26
Nothing4Youhttps://pve.proxmox.com/wiki/Network_Configuration can probably guide you through the process18:27
godofseafound this https://pve.proxmox.com/wiki/OVH 18:28
Nothing4You> for Proxmox VE 4.x.18:28
Nothing4Younot sure how well that still applies18:28
Nothing4Youit 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 interface18:28
Nothing4Youif you don't trust your vms what i'm doing is having a bridge interface per vm18:28
Nothing4Youyou also don't necessarily need a .254 ip18:29
akutzYay, 21.3 is merged!!!18:30
Nothing4Youalso 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 them18:30
godofseaactually all my vms should be accessible via the internet so all of them have their own unique IP 18:31
Nothing4Youthen you could even get away without having a private ip range18:32
Nothing4Youjust use the same host ip on all bridge interfaces (if you have multiple) and have the vms route to the host interface18:33
Nothing4You*route to host ip18:33
Nothing4Youand on the host you need the route(s) to the bridge interface(s)18:34
godofseaI think my bridge port is wrongly defined in /etc/network/interfaces18:35
godofseahttps://paste.debian.net/hidden/f4d4ffb6/ this is how it looks, bridge port is correct nvm18:37
Nothing4Youjust to be sure, <HOST_IP>.254 is the ip of the provider gateway, right?18:39
Nothing4Youand your current goal is to have the proxmox host behave like a switch?18:40
godofseafor the first question yes, 18:40
godofsea2nd one is also yes , I guess18:41
Nothing4Youmy setups are normally that the host is a router instead of a switch so i was thinking about a slightly different setup18:42
godofseaIt'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:44
Nothing4Youi 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_bridge18:45
Nothing4Youand it looks like you have that already18:45
Nothing4Youyour provider may be limiting which macs can route traffic to it, so if your host acts as a switch the vm mac will be forwarded18:45
Nothing4Youthe 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
Nothing4Youthat might even be all that's needed to get it to work18:46
Nothing4Youassuming you're using ovh18:46
godofseaahh okay.  18:47
Nothing4Youi have the same thing at hetzner but as i use the host as a router i don't need that18:47
godofsealemme look up the difference between router and switch real quick 18:49
godofseaMine's a router not a switch :)18:58
Nothing4Youwith bridge-ports eno1 it behaves as switch18:58
Nothing4Youit's also easier to set up that way19:00
=== m_ueberall is now known as ueberall
godofseaI think its got something to do with OVH manager. Thanks Nothing4You for all the help. Signing off 19:04
Nothing4Younp, good luck19:04
akutzI 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:10
rharperakutz: \o/20:16
blackboxswfalcojr: https://github.com/canonical/cloud-init/pull/992 can land if we rebase .... again.21:22
ubottuPull 992 in canonical/cloud-init "testing: Fix ssh keys integration test" [Open]21:22
blackboxswfalcojr: also are you putting up a PR for the upload to impish?21:25
blackboxswprobably after 992 lands?21:25
falcojryeah, I gotta get some food going first though :)21:26
blackboxswlanded https://github.com/canonical/cloud-init/pull/99221:50
ubottuPull 992 in canonical/cloud-init "testing: Fix ssh keys integration test" [Merged]21:50
blackboxswif a PR is put up for Impish upload, I'll review and dput it21:51
falcojrblackboxsw: https://github.com/canonical/cloud-init/pull/99421:58
ubottuPull 994 in canonical/cloud-init "Ubuntu/devel" [Open]21:58
blackboxswbuilding will upload if all's good22:09
blackboxswfalcojr: [ubuntu/impish-proposed] cloud-init 21.3-1-g6803368d-0ubuntu1 (Accepted)   I'm merging now22:16
blackboxswhttps://github.com/canonical/cloud-init/pull/994#pullrequestreview-736612813 merged22:17
ubottuPull 994 in canonical/cloud-init "Ubuntu/devel" [Merged]22:17
falcojrSweet, I threw up the other branches too23:10

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