/srv/irclogs.ubuntu.com/2024/03/11/#ubuntu-server.txt

=== chris14_ is now known as chris14
=== chris14_ is now known as chris14
=== justache is now known as justache_Test
=== justache_Test is now known as justache
=== JanC is now known as Guest8325
=== JanC_ is now known as JanC
=== kostkon_ is now known as kostkon
=== esv_ is now known as esv
=== JanC is now known as Guest1241
=== xispita_ is now known as xispita
=== vince_ is now known as vince
MTecknologydbungert: I heard a rumor that maybe you know some things about the autoinstall stuff? I still can't figure out how to make the installer grab an autoinstall file.16:24
dbungertMTecknology: I do.  Thanks for sharing your autoinstall in progress.16:25
dbungertI'm in a meeting for the moment so my responses might be slow16:25
dbungertthe two general plans are to build the autoinstall into the ISO or to serve it over cloud-init, which one sounds better for your case?16:25
MTecknologyI've been at this for a couple weeks, so slow is still faster than me.16:26
p3limMTecknology: I use kernel args with nocloud, e.g: `linux /casper/vmlinuz autoinstall ds=nocloud\;s=http://myhost/autoinstall.yaml ---`16:27
p3limif you've packaged the autoinstall file with the ISO or have a separate disk you can get it from that instead, e.g. `s=/cdrom/mypath/autoinstall.yaml`16:28
MTecknologyMy original goal was to bake it into the iso, but I also need to support remote re-installation so I'm trying to use those same "nocloud" arguments. I thought that the thing needed to end in a / so that it could find the user-data and meta-data files and then read the autoinstall data from the cloud-init config file16:29
p3limdocs: https://cloudinit.readthedocs.io/en/17.2/topics/datasources/nocloud.html16:29
p3limI don't use separate user-/meta-data that way so can't answer that for you16:29
MTecknologyThat's what's shown on https://ubuntu.com/server/docs/install/autoinstall and https://canonical-subiquity.readthedocs-hosted.com/en/latest/howto/autoinstall-quickstart.html#write-your-autoinstall-configuration16:31
p3limquestion: how can I validate the autoinstall/curtin match targets for storage? trying to match by 'model', which should be ID_VENDOR but it just fails to match one16:31
* MTecknology goes off and tries with a full path to that specific file.16:32
p3limdebug output doesn't really help me here, so just wondering if there are any tools to validate/match that16:32
MTecknologyThe attempt I just tried -> kvm -no-reboot -m 2048 -drive file=image.img,format=raw,cache=none,if=virtio -kernel linux -initrd initrd.gz -append 'autoinstall ds=nocloud-net\;s=https://deb.domain.tld/ubuntu2004/autoinstall.yaml'16:34
p3limMTecknology: don't do it on initrd, do it on linux16:35
MTecknology"on initrd"?16:36
p3lim(not too familiar with raw kvm parameters)16:36
p3limI assume `-append` appends it to `-initrd` here?16:36
MTecknologynope, it's the appended arguments in grub16:37
MTecknologywell, not "in grub", but what's handed to the kernel16:37
MTecknologyI can see the arguments listed in the kernel command line, but they don't appear to have any impact on the installer.16:38
p3lime.g. you see them in /proc/cmdline?16:38
MTecknologyI also can't find any logs to suggest any web activity was attempted.16:38
MTecknologyyep16:38
p3limshow us exactly what /proc/cmdline contains please16:38
p3limmask your s= if you want :P16:40
MTecknologyheh ... I don't know how to take a screenshot from this.  It's "autoinstall ds=nocloud-net;s=https://deb.corp.tld/ubuntu2004/user-data"   where "corp.tld" is a typed replacement. Everything else is char4char.16:41
p3limI made a mistake in my paths above, I had some part of the ISO builder that did something, I'll explain it here:16:42
p3limmy /proc/cmdline contains "BOOT_IMAGE=/casper/vmlinuz autoinstall ds=nocloud;s=/cdrom/nocloud/foo ---"16:43
p3limwithin /cdrom/nocloud/foo directory I have two files; meta-data and user-data16:43
p3limuser-data is the autoinstall.yaml file16:43
p3limin your case you should point to https://deb.domain.tld/ubuntu/2004 which contains those two files16:45
dbungert^16:45
dbungertwas just about to say the same, thanks p3lim16:45
MTecknologyThat's what I was trying first, before you mentioned autoinstall.yaml ;)16:45
p3limalso keep in mind that https _might_ be problematic depending on how you've signed the certificate on that domain16:45
MTecknology> I thought that the thing needed to end in a / so that it could find the user-data and meta-data files and then read the autoinstall data from the cloud-init config file16:46
dbungerthttps://cloudinit.readthedocs.io/en/latest/reference/datasources/nocloud.html#nocloud - the examples are showing a trailing slash, I don't know if it matters16:47
p3limyou might need to end your url/path with "/" indeed, I know I've done that before16:47
MTecknologyThere's a spot in documentation somewhere that claims the trailing slash must be there16:47
p3limuse it to be safe :)16:47
MTecknologyI have been16:48
p3limdbungert: do you know how I can verify/test the "match" keypair from curtin without running the entire autoinstall process? can't seem to get a match against "model" (which is supposed to be ID_VENDOR in udev according to the docs)16:48
MTecknologyI guess ... I'm sharing the arguments that are absolutely definitely being passed to the installer, so the real question is why the installer seems to do nothing with that.16:49
MTecknologyI'm not sure if it's trying and not being logged, but netstat suggests it's not being tried at all16:49
MTecknologytcpdump*16:49
p3limare you actually using this for 20.04?16:50
MTecknologyyep ... I get to target 18.04, 20.04, 22.04, and there's soon to be a fourth in that list.16:50
dbungertp3lim: I'm not sure we have a great way to verify match directives, that sounds like a nice feature improvement.  I'm jotting that down as a feature request.16:51
p3limdbungert: you're on the curtin team?16:51
dbungertI own the Subiquity stack, so all of Subiquity/Curtin/Probert, but I'm not the sole decision maker16:52
p3limah cool16:52
p3limplease jot down a feature request for configuring btrfs subvolumes too then :D16:52
p3limanyways, I cannot for the life of me tell what curtin is actually trying to match against, because it just fails whenever I supply the `match.model: foo` field16:53
dbungertMTecknology: if you're testing newer ISOs, there will be a log line in /var/log/installer/subiquity-server-debug.log load_autoinstall_config16:53
dbungertif subiquity sees the autoinstall, that will have useful information, or maybe just a 'None' if it didn't make it that far16:54
p3limto be specific, I'm using Dell EMC hardware and ID_VENDOR is "DELL     " and I've set `match.model: DELL*` (tried without the glob too) and it doesn't work16:54
MTecknologythere's no /var/log/installer on this one16:54
dbungertp3lim: I actually have a branch started but it's not a committed feature at this point16:54
p3limcool :)16:54
dbungertp3lim: (with respect to btrfs and subvolumes)16:55
p3limif there are steps I can take to test the btrfs branch let me know, would gladly help once it's kinda-ready for that16:55
* MTecknology screams ... this is a horrible mess that is driving me absolutely bonkers. How the frick is it so dang difficult just to feed a configuration file to an installer?!!16:55
p3limMTecknology: try using http instead of https16:56
p3limcertificates can pose a problem here16:56
p3limand ensure it can actually resolve the address (or just use IP)16:56
MTecknologyIt's not making a web request ... cart in front of the horse16:56
p3limcan you wget/curl the file from the installation image?16:56
MTecknologyyep, I *just* tried that, actually.16:57
p3lim🤷16:57
dbungertMTecknology: ok, so do you have /var/log/cloud-init.log ?  That should have information on the attempt to process the nocloud-net datasource16:57
MTecknologyheh.. there's also no /var/log/cloud-init.log.  In fact, the only thing at all in /var/log is syslog16:59
dbungertthat one is beyond me, something very wrong is going on in the ephemeral install environment17:02
dbungertMTecknology: what install ISO are you looking at?17:02
MTecknologyI'm using the ubuntu-server-20.04 iso to try to install a desktop of the same version17:03
dbungertMTecknology: which one?  20.04.6?17:03
MTecknologyyep, ubuntu-20.04.6-live-server-amd64.iso / sho256: b8f31413336b9393ad5d8ef0282717b2ab19f007df2e9ed5196c13d8f9153c8b17:04
MTecknologysha*17:04
p3limsuper weird17:06
p3limI just tested that exact same image in libvirt just now, although using localpath, worked just fine17:07
p3limdbungert: has there been any thought of simplifying the build tooling for ISOs? I currently have 300+ lines mess of a bash script around xorriso, and I feel like it could break at any second :(17:09
p3limfeel free to finish helping MT before answering that17:09
MTecknologylol ... I think canonical is trying to abstract the abstraction as much as abstractly possible17:09
MTecknologyI get the impression any attempts to help me have been exhausted without having control of my keyboard. I'm back to the mercy of documentation ... and soon to be comments.17:12
p3limI still think it's your cmdline being incorrect :/17:13
p3limconsidering the info provided17:13
p3limhave you tried booting the ISO and manually typing in the cmdline in interactive grub?17:14
MTecknologyI assumed the backslash was specifically for grub escaping, so by the time the system is booting, the "\;" will be escaped to a ;17:14
MTecknologyIf it is truly supposed to remain a \; into cmdline, then I have only accomplished this once.17:14
p3limit is, see the above message from me where I dumped my /proc/cmdline17:14
p3limit's supposed to be just ";" between ds=nocloud and s=17:14
dbungertMTecknology: where did the kernel and initrd come from?  It's best to match them to the one from the iso, and can be found at casper/{vmlinuz,initrd}17:15
MTecknologydbungert: I grabbed them from the iso, per some other instructions that I linked to but can't find again17:15
dbungertok.  I think at this point you need to understand why the install environment seems to not be coming up normally.  journalctl may have errors.17:16
dbungertp3lim: ubuntu-image has that as a goal, but it's not supporting ISO creation yet17:19
p3limso the official images is also built using a messy bash script? :D17:20
dbungertyou may or may not be interested in https://pad.lv/c/livecd-rootfs, p3lim17:27
dbungertbut I think you already know the answer17:28
* MTecknology is curious what's behind that link17:28
p3limI just repackage the ISO with the nocloud files17:30
p3limcan't host anything in our prov environment17:30
dbungertp3lim: don't worry about it if you have a working solution, I'm just pointing to some of the build software in question17:32
p3limit's working now, might not work tomorrow :D17:32
p3limthat's why I'm asking :)17:32
p3limonce it breaks I'll just see if either ubuntu-image has been improved, or look at the actual tooling ya'll use17:33
MTecknologyp3lim: If you can tolerate static images, live-build is pretty nifty17:34
dbungertMTecknology: I need to be afk, you're welcome to ping or leave comments here and I'll check later17:35
MTecknologydbungert: Thanks; It occurred to me that I'm probably trying to rely too heavily on inaccurate and missing documentation, and it appears to not exist because it's always changing17:40
p3limno wonder I can't get anything to work17:41
p3limthe docs are incorrect17:42
p3limin the docs, disk selection extensions says model=ID_VENDOR, but it's actually ID_MODEL17:43
p3limhttps://github.com/canonical/subiquity/blob/server/jammy/subiquity/models/filesystem.py#L999-L100117:43
p3limvendor=ID_VENDOR isn't even documented17:44
MTecknologyDid I just ... are rotational and ssd the only options? what about tape? :P17:46
MTecknologys/Did I just .../the answer was no and I was going to delete it17:46
MTecknologyya know ... I /do/ have ipxe readily available. I was using this earlier and it provided absolute proof of network connectivity, since that's where the two payloads came from. It just means I also have to go back inside because I don't want to make a network cable long enough for me to play with that outisde. :/17:50
MTecknology#ITproblems :P17:51
MTecknologydoes ubuntu not have build-essential?17:54
MTecknologyoooooh, lol ... there's no sources.list present. That must be one of the final setup things offloaded to cloud-init on the first boot.17:56
MTecknologydbungert: Is there any chance you can make this part easy for me and tell me what things cloud-init is actually responsible for on the first startup? So far it seems to be sources.list, one of the lists of package installs, and the first user17:57
dbungertp3lim: new subiquity stable snaps are "backported" to newer ISO builds, so that jammy branch is relevant for 22.04.0 ISOs but https://github.com/canonical/subiquity/blob/ubuntu/mantic/subiquity/models/filesystem.py#L1533 would be relevant instead for 22.04.418:09
p3limgood to know, but docs are incorrect regardless18:12
p3limI've reported the docs issue on launchpad18:12
dbungertMTecknology: user creation does happen at first boot of the target system.  the `packages` directive of autoinstall is the same.  /etc/apt/sources.list really should be present.  It might be interesting to add `while [ ! -f /run/finish ] ; do sleep 1 ; done` to autoinstall.late-commands, which will halt the install just before reboot to the target system and let you poke around to see before18:20
dbungertfirst-boot stuff runs.18:20
MTecknologyCan I provide that (autoinstall.late-commands) as a boot argument?18:22
dbungertno, unfortunately18:23
MTecknologyoh ... this isn't doing an automatic reboot. I haven't figured out the autoinstall, but I also need a mental break from it so I'm moving on to doing a manual install that does the same steps.18:24
MTecknologyso "late-commands" is just what I type after it says updates are done, and early-commands is before giving the installer any input.18:24
dbungertright, late-commands are at install time but before first boot, one of the last steps.  early-commands are before anything has really started.18:26
MTecknologyOh! Is there any way to get input from the user? I'd like to prompt for a password and dump that to a text file for another late-command to pick up ... or is it possible to let the script in the late-command directly request the password?  (the command invoked is gpg - https://github.com/MTecknology/teckhost/blob/master/bootstrap#L225-L226)18:30
MTecknologyfor debian, I use https://github.com/MTecknology/teckhost/blob/master/iso/debconf_early18:31
dbungertMTecknology: for prompting for supported things like the first user password or the LUKS passphrase, that can be done, but for arbitrary inputs like your gpg case I have no answer.18:42
MTecknologyoh ...18:43
MTecknologyI guess that's something that would have to be offloaded to firstboot and written to interact with the boot process, similar to cryptsetup18:44
MTecknologyI don't actually have any "firstboot" in my personal deployment. As soon as the installer shuts down at the end, it's completely configured and ready to ship (usually to family). I can even walk family members through doing a remote installation with any hardware they pick up at some cheap box store18:45
MTecknologydbungert: Oh .. how can I use "curtin" from another tty? I assumed that it would behave similar to in-target, but that doesn't seem to be the case.18:56
MTecknologyI guess that's confusing since there's "curtin in-target" vs. "in-target" .. I was using the latter18:57
dbungerton recent ISOs you can get to curtin with `subiquity.curtin`, so for example you can do `subiquity.curtin in-target -i -t /target -- /bin/bash` to get a live shell chrooted in, in exactly the same mount setup18:59
MTecknologyI saw lots of warnings against using different releases for different installs. Does that mean I'm stuck without for this?19:06
MTecknologyIt's mostly the removal of (I think) sg3-utils that causes a problem when run inside of chroot at the end of the install, because it needs /dev to be remounted.19:08
MTecknologylol ... apparently "subiquity-shell" is not what I thought it was19:13
MTecknologythat seems to be the user interface bit?19:13
dbungertMTecknology: you can refresh the snap to the latest version if you want newer features.  The subiquity snap does not refresh itself by default, or you can say `refresh-installer: { update: true }` if you do want that.19:24
dbungertand yes subiquity-shell is internals stuff, I doubt it's very helpful when directly invoked19:25
MTecknologyI had the impression that updating the snap was only an option for newer releases19:25
MTecknologylike, update the snap, and get updated ubuntu19:25
dbungertthey are separate items - if you use a 22.04.x iso you are getting Ubuntu 22.04.  Refreshing the snap helps if you want to get newer features or bugfixes but it doesn't change the OS version being installed.19:35
MTecknologygotcha, thanks for clarifying19:36
MTecknology"Also, please note that software in universe WILL NOT receive any review or updates from the Ubuntu security team."  ... but ... isn't that enabled by default?19:48
MTecknologydbungert: Which is actually canonical; security.ubuntu.com or archive.ubuntu.com foo-security?19:56
dbungertarchive.ubuntu.com can be a different mirror, security updates hit security.ubuntu.com first.  This has more details:  https://wiki.ubuntu.com/SecurityTeam/FAQ#What_repositories_and_pockets_should_I_use_to_make_sure_my_systems_are_up_to_date.3F19:58
MTecknologythanks19:58
MTecknologydbungert: oh ... I'm finally getting some logs. Now it seems to be failing because vendor-data is missing. Is that a required-empty file?21:26
MTecknologyhttps://dpaste.com/F7KUQ44MZ21:28
dbungertAIUI vendor-data is optional, I see that also in successful cases.21:29
MTecknologyThat's the only thing standing out to me right now. It seems like cloud-init is finally trying to grab the "cloud-config" files, but it still seems like there's no impact to the installation21:32
MTecknologyoooh ... 2024-03-11 21:21:32,837 - util.py[WARNING]: Failed loading yaml blob. Invalid format at line 33 column 49: "mapping values are not allowed here21:33
MTecknology- printf "network:\n  version: 2\n  renderer: NetworkManager" >/target/etc/netplan/nm.yaml21:34
MTecknologythat should be wrapped entirely in quotes21:34
MTecknologyoooh next fun challenge21:38
MTecknologyI guess "install to largest disk" is the best strategy here21:40
minimalnote the WARNING about "netplan apply" failing, that doesn't look good23:40

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