/srv/irclogs.ubuntu.com/2023/06/30/#cloud-init.txt

ancienttoiletGood afternoon. First time every using cloud-init and I am really confused13:45
ancienttoiletI wold like to automate the deployment of Landscape with it, here is the yml file https://raw.githubusercontent.com/canonical/landscape-scripts/main/provisioning/cloud-init.yaml13:45
ancienttoilethowever, I am not sure where to put or how to tell  cloud-init to deploy that yml file13:46
minimalyou provide that as user-data when you create the VM13:50
minimalwhere are you deploying? to a specific cloud provider? to a local hypervisor-based VM?13:51
ancienttoilethey minimal 14:11
ancienttoiletI am trying to deploy it locally really14:11
ancienttoiletand using lxd14:11
ancienttoiletso I need to use lxd commands to deploy that yml file?14:12
minimalso then when you deploy the VM via LXD you use whatever mechanism the LXD tools have to specify user-data14:12
ancienttoiletI was expecting something like docker-compose . I was wrong :S14:12
minimalyou must be running some cli tool to deploy the VM, right?14:13
ancienttoiletalright then, I will do the tutorial. 14:13
ancienttoiletwhat do you mean?14:13
ancienttoiletthe host is debian14:13
minimalhow are you creating the VM in LXD?14:13
ancienttoiletlxd handles containers14:13
minimalyes and it also handles VMs, I assumed you were creating a VM not a containers14:14
ancienttoiletI thought I could feed the .yml file to cloud-init just as you do for docker-composer14:14
minimalhow are you creating the container/VM with LXD?14:14
ancienttoiletminimal: I understand. Well I am kinda confused atm14:14
ancienttoiletI haven't yet.14:14
minimalLXD containers are nothing to do with docker14:15
ancienttoiletI literally started exploring this project14:15
ancienttoiletminimal: I know. I just though cloud-init usage of a yml file would be similar to docker-compose.14:15
ancienttoiletmy mistake14:15
minimalyou use a LXD tool to create a LXD container or LXD VM, that tool should provide a way to specify user-data at the same time14:16
ancienttoiletand the .yml config is the user-data right?14:17
minimalyes14:17
ancienttoiletalright, I guess I have some readings to do before I even go ahead with this14:18
ancienttoiletthank you for now :)14:18
ancienttoiletI guess I have the basics figured now14:40
ancienttoiletone more question14:40
ancienttoilethow can I pass the proxy settings to cloud-init? I have it in /etc/environment but it is not liking it by the looks of it14:41
ancienttoilethttps://pastebin.com/XwD0dvN814:42
minimalancienttoilet: that is nothing to do with cloud-init - cloud-init runs inside the ubuntu cloud image which this error shows has not even been downloaded yet16:04
blackboxswancienttoilet: right, check out this tutorial for cloud-init on launching LXD with user-data https://cloudinit.readthedocs.io/en/latest/tutorial/lxd.html. 17:49
blackboxswand for proxy settings in cloud-init I don't think we've grown proper proxy config setup/automation given the state of this bug https://bugs.launchpad.net/cloud-init/+bug/1089405 (which has a workaround for you which may help)17:51
-ubottu:#cloud-init- Launchpad bug 1089405 in cloud-init "setting up system proxy via cloud-config might be nice" [Wishlist, Expired]17:51
OutOfServicehi17:55
OutOfServiceso, i seems that there is a new way in order to deploy ubuntu, right? I'm used to use ipxe with http and simple config parameters for installing to my lab. Now I'm a little lost with cloud-init. Could please somebody help me to find some examples for installing ubuntu via (i)pxe and http, please? I don't know where top start.. there is no very much information at these days...17:58
dbungertOutOfService: I think this is more of an Ubuntu topic than a cloud-init one.  I suggest taking this to #ubuntu-server.  as a starting point, https://ubuntu.com/server/docs/install/autoinstall-quickstart has a bit about feeding autoinstall by way of cloud-init to the newer installers.18:09
blackboxswOutOfService: seems like you are referring to Ubuntu autoinstall on live server/desktop images. https://ubuntu.com/server/docs/install/autoinstall  and https://ubuntu.com/server/docs/install/netboot-arm64 may be helpful. Cloud-init is used under the hood to allow for obtaining #cloud-config user-data during that boot process. The autoinstall:  key is largely ignored by cloud-init and passed through to the subiquity installer...   18:09
blackboxswhttps://cloudinit.readthedocs.io/en/latest/reference/faq.html#autoinstall-preruncmd-postruncmd.18:09
blackboxswas dbungert mentioned, best to continue the installer conversation over in #ubuntu-server18:10
blackboxswthx dbungert 18:10
OutOfServicethanks very much!!18:13
blackboxswholmanb: I mentioned I'd look again at BSD images in clouds to see status/supportability from pycloudlib. As it stands, it looks like thefreebsdfoundation is a publisher of Azure images, but those images don't contain cloud-init by default. I think meena has mentioned https://bsd-cloud-image.org/ as typical base BSD image which can be converted and uploaded to clouds. 19:38
blackboxswazure's BSD publisher images:  are as follows: 19:39
blackboxsw+FREEBSD_IMAGES = {19:39
blackboxsw+    "13.1": "thefreebsdfoundation:freebsd-13_2:13_2-release:13.1.0",19:39
blackboxsw+    "13.2": "thefreebsdfoundation:freebsd-13_2:13_2-release:13.2.0",19:39
blackboxsw+}19:39
blackboxswec2, on the otherhand seems to have an ec2 marketplace publisher "FreeBSD" which do contain cloud-init in images. I have a working example that I'd like to add to pycloudlib/examples19:39
blackboxswhttps://aws.amazon.com/marketplace/seller-profile?id=92bb514d-02bc-49fd-9727-c474863f63da&ref=dtl_B0928XNW6D19:39
blackboxswholmanb: and I've tested latest pycloudlib with your changes for custom username and we can directly provide known amis from ec2 BSD marketplace images and successfully interact w/ cloud-init there.19:40
blackboxswstrike that on ec2... it's running configinit too (like Azure images) https://www.daemonology.net/blog/2013-12-09-FreeBSD-EC2-configinit.html19:43
blackboxswso I can put together a pycloudlib:examples/ec2.py  script that shows pkg install py39-cloud-init and rebooting into the test system.... but again it'd be injecting cloud-init after initial boot and rebooting into the 'clean' environment19:46
blackboxswso, not ideal if we don't have official BSD images in ec2/azure with cloud-init already installed19:47
falcojryeah, that feels excessive to me19:48
blackboxswyeah, I think it's enough to say, pycloudlib supports unique AMIs from BSD when present and can interact with that VM using the desired custom username and related SSH pubkey/cert19:51
meenablackboxsw: who do we need to talk to fix that?20:04
meenaactually, i probably know20:05
meenahttps://freshbsd.org/freebsd/src/branch/main?q=azure20:06
meenalooks like lwhsu@ does azure stuff on behalf of the freebsd foundation 20:07
meenahttps://github.com/freebsd/freebsd-src/blob/main/release/tools/azure.conf20:11
blackboxswyeah that may help if there are Azure images from thefreebsdfoundation: containing configured/enabled cloud-init by default, pycloudlib testing should be a breeze.20:16
blackboxswmeena: with your recent merges of https://github.com/canonical/cloud-init/pull/4209/files and https://github.com/canonical/cloud-init/pull/4182 does that mean things are well placed for ds-identify to quickly reduce possible datasources detected on BSD prior to any cloud-init python code getting involved trying to DataSource*._get_data() now?20:19
-ubottu:#cloud-init- Pull 4209 in canonical/cloud-init "setup: fix generation of init templates" [Merged]20:19
-ubottu:#cloud-init- Pull 4182 in canonical/cloud-init "BSD: add dsidentify to early startup scripts" [Merged]20:19
blackboxswas in, BSD cloud-images can contain a configured  cloud-init  which will filter it's datasource discovery based on the outputs of ds-identify in early boot.20:20
blackboxswI mean this'll be cloud-init 23.3  as that functionality just landed now.20:21
meenablackboxsw: yes. it seems to work!20:26
meenaI just say I'm surprised myself;)20:26
blackboxswsweet!20:34
blackboxswthat'll be a huge performance boost as folks publish BSD images to various clouds to allow them to  avoid having to tailor the image to a specific `datasource_list: [ Ec2 ]` or OpenStack etc20:36
meenaI've also made it easy for the service to be removed, in case someone prefers that20:37
blackboxswgood deal.20:42
blackboxswmeena: do you know offhand if typical BSD images prefer to **not** have sudo installed? just wondering from expectations of cloud-init and pycloudlib integration tests .pycloudlib tries to use sudo when non-root user is the default user on an instance 20:44
blackboxswand the BSD images I've seen in azure/ec2 don't have sudo installed by default20:44
blackboxswit's something we'll have to be aware of if we want easy cloud image testing setup somewhere for BSD.20:44
minimalblackboxsw: some of the BSDs (OpenBSD for example) tend to use doas rather than sudo20:45
meenaOpenBSD has a doas in Base, and for everyone else it's a contentious subject20:46
minimalI've been adapting my Alpine-specific patch to cloud-init to make it OS generic with the intention of submitting a PR for it soon (just need to write testcases)20:46
minimalmy doas patch I mean20:46
meenaI think the split is probably fifty 60% sudo, 25 su, rest doas20:47
blackboxswTIL about doas thx.  so pycloudlib may need to grow a switch based on what utility to escalate permissions is available. specifically I'm thinking about things like our Instance.clean method https://github.com/canonical/pycloudlib/blob/main/pycloudlib/instance.py#L198-L21220:47
meenait would be cool if the choice was configurable, but as of yet, it's a runtime dependency, so it's a porter's opinion in that mix, too20:48
blackboxswthat'd be a blocker as many integration tests try to use "clean" before snapshotting images in clouds20:48
blackboxswand then running through test cases for the base snapshotted image (with cloud-init upgraded to whatever we are testing)20:48
blackboxswmakes sense.20:49
minimalblackboxsw: I guess you'd have to run "which sudo", "which doas" etc or similar to decide which is available first20:49
meenaseems easy enough20:50
blackboxswyeah that's what I'm thinking too minimal.. though this particular ec2 marketplace image of BSD has neither sudo nor doas :)20:50
blackboxswso I have to su ... .then pkg install X20:50
meenayou'd probably not want both of those installed, and definitely not on a test system 20:50
blackboxswagreed. one or the other. sensible fallback when sudo doesn't exist... and a hard fail if neither sudo nor doas20:52

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