2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-11-19 08:52:20 +00:00
Commit Graph

1294 Commits

Author SHA1 Message Date
Jarrod Johnson 7662955a98 Merge pull request #390 from Obihoernchen/fix/profile-installedargs
Fix profile installedargs on Debian, Ubuntu and SUSE 16
2026-11-17 13:43:20 -05:00
Jarrod Johnson 7d27b13f16 Merge pull request #389 from Obihoernchen/fix/image2disk-grub-lvm-names
Name the created volumes in the grub defaults of an image install
2026-11-17 13:42:07 -05:00
Jarrod Johnson 8470f1d155 Merge pull request #388 from Obihoernchen/fix/suse16-profile-label
Label the SUSE 16 profile as the default profile
2026-11-17 13:41:27 -05:00
Markus Hilger 52ae9c9e16 Fix profile installedargs on Debian, Ubuntu and SUSE
On Debian and Ubuntu 18.04 the installedargs line of profile.yaml was
added to GRUB_CMDLINE_LINUX with its "installedargs:" key still in
front, and update-grub was not run for it, so the arguments only took
effect with a later grub update, as a broken first argument.

All Debian and Ubuntu profiles also put the arguments into a sed
replacement unescaped, so an argument containing a slash, such as
rd.lvm.lv=vg/root, made sed fail and left the grub defaults unchanged.

SUSE 16 put the arguments into a JSON string unescaped, so an argument
containing a double quote or backslash produced an invalid
autoinstall.json, and one containing "!" or "&" broke the sed command
that fills it in.

SUSE 15 put them into the AutoYaST XML unescaped, so an argument
containing "&" or "<" made the whole profile invalid and stopped the
install.
2026-11-17 19:03:50 +01:00
Markus Hilger e9e83635ee Name the created volumes in the grub defaults of an image install
When the image has no /etc/default/grub, as images built by imgutil do
not, installing it to disk on EL9 and EL10 wrote one with
rd.lvm.lv=vg/root rd.lvm.lv=vg/swap, volumes that do not exist. A
missing /etc/kernel/cmdline likewise got root=/dev/mapper/localstorage-root,
which is wrong for an install without LVM or with a volume group named
after the node. The boot loader entries were rewritten correctly, so
the first boot worked, but grub2-mkconfig --update-bls-cmdline or a new
kernel would take the wrong names from these files.

Both defaults now name the root device and the logical volumes for root
and swap that the install created.
2026-11-17 16:53:10 +01:00
Robert Caliman 1e8c4a88c3 Add support for SLES 16 deployed from a multi NIC server 2026-11-17 17:14:12 +02:00
Markus Hilger f05ef810c1 Label the SUSE 16 profile as the default profile
Every other OS labels its stock profile "(Default Profile)", including
SUSE 15, whose server profile also has the directory name server. SUSE
16 said "(Server Profile)" instead.
2026-11-17 16:05:04 +01:00
Markus Hilger 973a340ed7 Use the root filesystem for grub when an image has no /boot
image2disk only took the boot UUID from a /boot volume. Images captured
from a system without a separate /boot left it unset, and rewriting the
EFI stub grub.cfg failed with "TypeError: sequence item 5: expected str
instance, NoneType found". Fall back to the UUID of the / filesystem,
which holds /boot in that case.
2026-11-12 15:17:36 +01:00
Jarrod Johnson bec1ed1498 Merge pull request #383 from Obihoernchen/feat/confluent-attrib-helper
Add confluent_attrib helper for profile scripts
2026-11-12 07:40:14 -05:00
Markus Hilger 9d8cb97fb3 Add confluent_attrib helper to profile functions
Profile scripts had to call apiclient and parse /self/myattribs to read
a node attribute. confluent_attrib prints one attribute, comma joining
lists, and returns 1 when it is unset. Non-shell scripts can run it as
'bash /etc/confluent/functions confluent_attrib <name>'.
2026-11-11 23:02:02 +01:00
Jarrod Johnson 218f245b50 Merge pull request #380 from Obihoernchen/fix/confignet-firewalld-quiet
Do not print the firewalld check of confignet
2026-11-11 07:09:09 -05:00
Markus Hilger 823f2e57e6 Do not print the firewalld check of confignet
systemctl status firewalld printed the unit status, or 'Unit
firewalld.service could not be found.' on images without firewalld.
2026-11-10 22:25:29 +01:00
Markus Hilger e9e284986f Add post.custom to EL diskless profiles, drop firstboot tls copy
post.sh runs post.custom, which the profiles lacked, so every install
to disk logged a failed download. firstboot.sh copied
/etc/confluent/tls/*.pem, which diskless nodes never have: installimage
already adds the confluent CA to the ca-trust anchors.
2026-11-10 22:25:09 +01:00
Jarrod Johnson 05ec7f9d4d Merge pull request #377 from Obihoernchen/fix/diskless-lvm-autoactivation
Do not autoactivate LVM on local disks on diskless boot
2026-11-09 15:38:42 -05:00
Jarrod Johnson c3bc8ce747 Merge pull request #375 from Obihoernchen/fix/image2disk-kernelargs
Keep interface naming arguments when installing images to disk
2026-11-09 15:37:55 -05:00
Markus Hilger 5473f46cf3 Do not autoactivate LVM on local disks on diskless boot
An old stateful OS on LVM was activated at diskless boot and kept the
disk busy, so repartitioning it for scratch failed. Set an empty
auto_activation_volume_list unless the image sets one. Ubuntu also
needs it in the initramfs, whose udev rules activate LVM earlier.
2026-11-09 21:35:40 +01:00
Markus Hilger bd5c7be4da Add interface naming arguments to captured image cmdlines
A captured image keeps the /etc/kernel/cmdline of its source. If the
source did not run with the net.ifnames=/biosdevname= of the diskless
boot, the installed system renames the interface and the connection
written during the install does not match. Append them when missing.
2026-11-09 21:04:06 +01:00
Markus Hilger 9b84a4ecba Point the installtodisk no disk hint at port 22
While installimage waits for an install disk, the sshd of the image
listens on port 22. The el9 initramfs sshd on port 2222 only runs with
debugssh.
2026-11-09 21:03:07 +01:00
Markus Hilger e23873888f Serve installtodisk syncfiles with the sshd of the image
After image2disk, installimage stopped the sshd of the image and moved
port 22 to the initramfs sshd, chrooted into the install target, by
sending that sshd HUP. The el9 initramfs only starts its sshd with
debugssh, and on EL 9.8 it cannot start at all without sshd-session, so
normally nothing listened on port 22. The syncfiles push of post.sh then
failed with connection refused while the node still reported completed.

Restart the sshd of the image instead, chrooted into the install target.
It is always present and matches the OpenSSH helpers of the image, so
this also works for images packed or captured before the initramfs fix.
Wait for the old sshd to exit first, so the new one can bind port 22.
2026-11-09 20:26:06 +01:00
Markus Hilger 0e3f732538 Keep interface naming arguments when installing images to disk
image2disk only carried console= and quiet into the installed system.
A built image deployed with net.ifnames=0 biosdevname=0 came up with
enp1s0 while the connection written during the install was for eth0,
so the network failed. Carry net.ifnames= and biosdevname= as well.

Also add the missing space before crashkernel= in the default el9
GRUB_CMDLINE_LINUX.
2026-11-09 20:17:18 +01:00
Jarrod Johnson b59d8b24c0 Have NetworkManager run if not already enabled 2026-11-04 12:40:31 -05:00
Jarrod Johnson aa85c1a8bb Fix up some issues in suse leap 16 diskless boot 2026-11-04 12:33:09 -05:00
Jarrod Johnson dbdb9e062e Fix 'grep true' error in suse boots 2026-11-04 11:48:45 -05:00
Markus Hilger fc63269dc7 Give every deployed node its own machine-id
Captured images carried the machine-id of the source system, and images
built with imgutil carry the one generated in the build root, so every
node deployed from a profile shared it. That breaks anything keyed on it,
such as DHCP DUIDs and journal identities.

Capture now stores an empty /etc/machine-id. Diskless boot on EL and SUSE
writes a stable per-node one derived from the node name and the DMI
product UUID, as Ubuntu already does, using openssl since the initramfs
has no sha512sum. Install to disk copies that machine-id into the target
and renames the boot loader entries from the image to it. Otherwise
kernel-install in post.sh adds a second set of entries under another ID.
2026-11-04 15:06:58 +01:00
Jarrod Johnson afc96a66e4 Merge pull request #366 from Obihoernchen/fix/ubuntu-install-fixes
Fix Ubuntu install to disk and installedargs
2026-11-04 08:28:59 -05:00
Jarrod Johnson 1f0202b68c Merge pull request #362 from Obihoernchen/fix/capture-optional-lvm
Make lvm optional for capture
2026-11-04 08:06:41 -05:00
Jarrod Johnson ae4bbe5300 Merge pull request #361 from Obihoernchen/fix/image2disk-localstorage-recapture
Fix install to disk of recaptured localstorage LVM nodes
2026-11-04 08:05:52 -05:00
Jarrod Johnson f31305ab7b Merge pull request #360 from Obihoernchen/fix/image2disk-partition-overflow
Fix install to disk of images with plain partitions
2026-11-04 08:05:06 -05:00
Markus Hilger 244f75b0b2 Pass maxsplit to re.split as a keyword
ruff B034 flags the positional maxsplit argument.
2026-11-03 22:03:31 +01:00
Markus Hilger 9830518131 Apply installedargs to the grub configuration of Ubuntu installs
post.sh wrote installedargs into /etc/default/grub but only ran
update-grub when it had also added a console, so grub.cfg kept the old
command line until some later grub update.
2026-11-03 21:16:53 +01:00
Markus Hilger ed49d131ad Strip the key from installedargs in Ubuntu installs
post.sh took the whole installedargs line from profile.yaml, key
included, so every Ubuntu install from these profiles got a literal
'installedargs:' in GRUB_CMDLINE_LINUX.
2026-11-03 20:23:43 +01:00
Markus Hilger 4b2c8c74c4 Rebuild the initramfs when installing Ubuntu images to disk
The installed system kept the initramfs of the image. Ubuntu 26.04
builds it with dracut in host-only mode, so a captured image's initramfs
waits for the source's volume group and filesystem UUIDs and the
installed node ends in emergency mode. Rebuild it in post.sh, as EL does
through kernel-install.
2026-11-03 20:23:43 +01:00
Markus Hilger b2a40e1370 Skip deactivating volume groups when lvm is absent
lvm is optional in the capture initramfs now, so installimage printed
'lvm: command not found' on every install of a capture taken from a host
without lvm2. Only run it when it is there.
2026-11-03 17:18:46 +01:00
Markus Hilger 115de4c00e Check for the localstorage volume group first
The guess for volume groups named by the OS installer (<os>_<node>)
matched any device mapper name with an underscore followed later by a
hyphen. A localstorage volume for a mount point with a hyphen, such as
localstorage-_srv_my--data, was taken for one and got a broken volume
group name. Recognize volumes of the target volume group before trying
that guess.
2026-11-03 17:17:31 +01:00
Markus Hilger 04f45bf542 Number new partitions in creation order in image2disk
The plain partitions were addressed by their number on the source system,
while parted numbers them in the order they are created. A source with a
gap, such as swap between filesystems (it is not captured), made
image2disk format the wrong partition and look for swap on one that does
not exist. Count the partitions as they are created instead.

Also look up filesystem UUIDs through one helper.
2026-11-03 17:17:11 +01:00
Markus Hilger b5a58ef770 Install images without LVM to disk
image2disk.py formatted the target filesystems, copied the image and
ran fixup only in the branch that sets up LVM. For an image whose
filesystems are all plain partitions it created the partitions and
returned success without writing anything, and installimage then failed
on the missing target.

Run that part for both layouts. Plain partitions also need their swap
in fstab by UUID instead of the localstorage-swap volume, and on EL9
and later root= and resume= refer to the new root and swap by UUID as
well, since partition names are not stable with several disks.
2026-11-03 16:53:21 +01:00
Markus Hilger 3bd3ebeadb Install recaptured images of LVM installed nodes to disk
image2disk.py puts the volumes of a node it installs into the volume
group localstorage. Capturing such a node and installing the profile to
disk again failed with 'No mapping defined to create volume group
localstorage': volumes named localstorage-root were taken for volumes of
an extra volume group that needs volumegroupmap.yml.

Treat volumes of a volume group named like the target one as main volume
group volumes, and split device mapper names into volume group and
logical volume names correctly, including hyphens that device mapper
doubles inside either name.
2026-11-03 16:51:59 +01:00
Markus Hilger e021d29afc Keep image2disk partitions inside the disk
When the largest filesystem of a captured image is a plain partition,
it was sized as the disk minus the other filesystems. That ignored the
2048 sector gap before the first partition and the rounding of every
partition up to a 2048 sector boundary, so the last partition always
ran past the end of the disk. The clamp then set its end to the sector
count, one past the last sector and inside the backup GPT, and parted
refused it with 'The location ... is outside of the device'. Images
with the largest filesystem in LVM were not affected.

Reserve that overhead plus 1MiB at the end of the disk for the backup
GPT, and clamp to that last sector instead. Also round the swap
partition by its own size rather than by the previous partition's.
2026-11-03 15:45:52 +01:00
Markus Hilger 3debfdaee0 Add missing script directories to el10 and Ubuntu diskless profiles
Their scripts run onboot.d and the others, but the profiles did not
have them like el8 and el9. el10 also lacked the syncfiles template,
now linked to el9's like its other shared files, and Ubuntu lacked the
firstboot.custom that its firstboot.sh runs.
2026-11-02 18:12:47 +01:00
Jarrod Johnson 050936e6f4 Merge pull request #353 from Obihoernchen/feat/fix-urlmount-shutdown
Keep urlmount alive during system shutdown
2026-11-02 07:53:08 -05:00
Jarrod Johnson 813ddd4d05 Merge pull request #348 from Obihoernchen/fix/confignet-no-network-tool
Fail clearly when confignet finds no network configuration tool
2026-11-02 07:50:24 -05:00
Jarrod Johnson 75402fe9ba Merge pull request #346 from Obihoernchen/fix/ubuntu-diskless-netplan-perms
Restrict the netplan file written by Ubuntu diskless boot
2026-11-02 07:49:20 -05:00
Jarrod Johnson 016db810ea Merge pull request #345 from Obihoernchen/fix/diskless-stop-on-extract-failure
Stop a diskless boot when the root filesystem cannot be extracted
2026-11-02 07:49:09 -05:00
Markus Hilger 061f2facec Keep urlmount alive during system shutdown
Mark urlmount as an initramfs root storage daemon before entering FUSE so systemd-shutdown does not wait for or kill the process serving the root image.
2026-11-02 02:37:23 +01:00
Markus Hilger 6bdc3e17d7 Restrict the netplan file written by Ubuntu diskless boot
imageboot.sh wrote /etc/netplan/10-<iface>-confluentcfg.yaml with the
default mode 0644, and netplan warns that its configuration should not
be accessible by others. confignet already writes its files 0600, but
it leaves an identical file in place, so the boot-time one stayed 0644.
2026-11-01 22:39:31 +01:00
Markus Hilger 5d97bc6a19 Stop a diskless boot when the root filesystem cannot be extracted
extract_untethered_rootimg reports failure, for example when the image
does not fit into the memory backed root, but imageboot.sh ignored it and
booted into the partly extracted root, which then hung later on. Stop
with a message saying why instead.
2026-11-01 22:16:57 +01:00
Markus Hilger eb4f1ad21a Fail clearly when confignet finds no network configuration tool
Without netplan, nmcli or wicked the manager variable was never set and
confignet died with a NameError. Say what is missing instead. Also pick
netplan over nmcli in the retry pass, as the first pass does, instead of
switching to NetworkManager on systems that have both.
2026-11-01 22:10:22 +01:00
Jarrod Johnson 26f27da575 Merge pull request #343 from Obihoernchen/fix/image2disk-bls-kernel-paths
Point boot entries at the kernel on the installed boot filesystem
2026-11-01 13:32:38 -05:00
Jarrod Johnson 84b232db63 Merge pull request #339 from Obihoernchen/fix/untethered-failover
Fall back to other managers for untethered images
2026-11-01 13:27:30 -05:00
Markus Hilger 1d8d4f3077 Point boot entries at the kernel on the installed boot filesystem
image2disk rewrote root= in the boot loader entries but kept their
linux and initrd paths. Those come from where the image was built: in a
diskless image from imgutil they carry the scratch directory of the
server (grub2-mkrelpath sees its bind mount), and a /boot/ path does not
match the separate /boot filesystem image2disk creates for such images.
grub then fails with "you need to load the kernel". Make the paths
relative to the boot filesystem of the target.
2026-11-01 15:02:43 +01:00