Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFE: provide a way to persist hostname via live ISO/coreos-installer #697

Open
dustymabe opened this issue Dec 10, 2020 · 5 comments
Open

Comments

@dustymabe
Copy link
Member

dustymabe commented Dec 10, 2020

Describe the enhancement

Right now a user can configure the network via nmtui in the live ISO environment and use coreos-installer --copy-network to copy those networking configurations into the installed system. nmtui also has a menu option for setting the system hostname. We've had requests (example) for being able to set the hostname via coreos-installer as well, but I'm a bit hesitant on if we should because the whole "forward networking" bit is a bit fragile to begin with.

The options I see are:

  • we provide a new option --copy-hostname that will try to propagate the info in /etc/hostname into the real root and will fail if /etc/hostname doesn't exist.
  • we just lump it into --copy-network and copy it if it exists, and do nothing if not.
  • Refer people to the documentation on how to set it via Ignition.

For the first two options we'd basically need to cp the file into the boot partition like we do for the networking configs and then pass it along a few times before it gets set by the initramfs propagating code that we have. A bit fragile/brittle, but we're doing it already for other things. I guess a less fragile way to do it would be to convert the file into an Ignition config and merge it with the other config the user provided.

@jlebon jlebon added meeting topics for meetings and removed meeting topics for meetings labels Dec 16, 2020
@eformat
Copy link

eformat commented Feb 2, 2023

hi @dustymabe .. this still seems to be an open issue with sno bootstrap in place ? i have tried updating bootstrap-in-place-for-live-iso.ign which works until the pivot i.e hostname is set, but not copied over. i see the --copy-network working as expected and +1 the idea of adding a --copy-hostname
unless there is another way round this ?

@jlebon
Copy link
Member

jlebon commented Feb 3, 2023

@eformat Can you go into more details on the setup? The hostname is currently being set during the live ISO boot via Ignition and then you install RHCOS using --copy-network? How are you delivering the Ignition config of the installed system? Is the full config nested in the live config, or fetched on first boot?

@eformat
Copy link

eformat commented Feb 3, 2023

hi @jlebon, thanks for responding - so i'm doing this for bootstrap in place

generate ignition

openshift-install create single-node-ignition-config --dir=cluster

set copy-network in install config

vi install-config.yaml
bootstrapInPlace:
  installationDisk: "--copy-network /dev/vda"

then generate boot iso with ignition

arg1="rd.neednet=1"
arg2="ip=192.168.86.32::192.168.86.1:255.255.255.0:sno:enp1s0:none nameserver=192.168.86.27"
coreos-installer iso customize rhcos-live.x86_64.iso --live-karg-append="${arg1}" --live-karg-append="${arg2}" -f
coreos-installer iso ignition embed -fi cluster/bootstrap-in-place-for-live-iso.ign rhcos-live.x86_64.iso -o /var/lib/libvirt/images/rhcos-live.x86_64.iso

which works for bootstrap phase i.e. host is set ok to sno in this case .. but .. after the pivot, the network is copied, but not the hostname. so i have to ssh into the node, and hostnamectl set-hostname once the bootstrap process gets to this bit

systemd[1]: Starting Wait for a non-localhost hostname...

@jlebon
Copy link
Member

jlebon commented Mar 7, 2023

@eformat Thanks. To answer your question, yes this is still an outstanding RFE. For now you can provide an Ignition config that sets the hostname. Note that coreos-installer iso customize supports embedding Ignition configs using --dest-ignition so you can avoid the separate coreos-installer iso ignition embed invocation. The command supports passing that switch multiple times (the configs are merged), so you'd be able to merge in your hostname config that way.

bootstrapInPlace:
  installationDisk: "--copy-network /dev/vda"

This looks like it's abusing how that string is passed around. I wouldn't rely on this since it may break in the future.

That said, in your use case, you're providing a hostname already via the ip karg. It's awkward that --copy-network copies parts of its effect, but not the hostname. So that seems like an argument for making it part of --copy-network.

@peterroth
Copy link

An option to copy the hostname file would be really useful for quick test/POC cluster creation.
If I'm already configuring the network using nmtui, I can also set the hostname, instead of editing the ignition file as documented in Bugzilla #1905986 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants