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

Install and configure system from live enviroment #1470

Closed
AlexStorm1313 opened this issue Apr 15, 2023 · 5 comments
Closed

Install and configure system from live enviroment #1470

AlexStorm1313 opened this issue Apr 15, 2023 · 5 comments

Comments

@AlexStorm1313
Copy link

Describe the enhancement

From within the live environment be able to install coreos to disk and then just like Arch Linux for example mount those partitions and layer rpm-ostree packages on top(and perhaps do some configuration).

System details

  • Bare metal or any other form of headless install

Additional information

Let me give some context. Currently when installing coreos on bare metal i create a bootstrap.ign file that installs to the hard disk with coreos-installer -i /path/to/master.ing. Then reboot into the new install and it runs the master.ign. which configures the system ex. layer packages with rpm-ostree.

The problem here is that there is a need for two ignition files and multiple reboots. If the live environment can install and configure the system there is only need for one reboot and that's directly in the configured system.
Maybe the layering packages still needs rebooting and is out of scope for this issue(#681).

If the described enhancement can already be achieved please let me know!

@dustymabe
Copy link
Member

hey @AlexStorm1313 is it just the extra reboot that's the concern? If that's the case I think this is taken care of already. Our docs were updated a while back to make the example use --apply-live, which won't require a reboot when layering packages.

@AlexStorm1313
Copy link
Author

AlexStorm1313 commented Apr 15, 2023

Thanks @dustymabe for the --apply-live suggestion that will come in handy! Let's forget about the package layering for now.

This is my current workflow when provisioning a system:

  1. Boot into live environment
  2. Use bootstrap.ign to install coreos to disk
  3. Reboot into coreos installed to disk
  4. Use master.ign to provision the system (layer packages, set kernel args)
  5. Reboot into coreos installed to disk (with kernel args and packages)

Preferred workflow

  1. Boot into live environment
  2. Use bootstrap-and-master-as-one.ign to install coreos to disk and to provision the system that's just installed (layer packages, set kernel args)
  3. Reboot into coreos installed to disk (with kernel args and packages)

I still need to set some kernel arguments on the system so I'm guessing the reboot is still needed. Also the current method requires the use of two .ign files.

@bgilbert
Copy link
Contributor

It sounds as though you're wanting a more traditional OS installer that configures the installed system before booting into it. We intentionally don't provide that, because we want the cloud provisioning flow (launch a VM image that applies an Ignition config) to work the same as the bare-metal install flow (write an unmodified OS image to disk, then reboot into the installed system, which applies the Ignition config).

However, there are a couple things you can do. The second reboot only occurs because you're setting kernel arguments from the Ignition config. You can pass --append-karg and/or --delete-karg to coreos-installer install, which will configure the kernel arguments of the installed system directly. Yes, this breaks the principle I just mentioned; kernel arguments ended up being an exception. I'd recommend continuing to include the kernel arguments in the Ignition config too, to avoid needing to keep two different configs in sync. Ignition won't reboot if the kargs are already present.

The other thing is that you usually don't need to construct the live Ignition config by hand. Take a look at the coreos-installer iso customize and pxe customize commands, which can do that for you.

@AlexStorm1313
Copy link
Author

That will get me in the right direction. Huge thanks for the help

@dustymabe
Copy link
Member

I'd recommend continuing to include the kernel arguments in the Ignition config too, to avoid needing to keep two different configs in sync. Ignition won't reboot if the kargs are already present.

IIUC I think I need to resurrect coreos/fedora-coreos-config#1409 for that last part to be true.

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

3 participants