hetzneronline / installimage

Bash scripts to universally deploy various distributions
Other
508 stars 140 forks source link

Support for Fedora CoreOS #72

Open silenium-dev opened 1 year ago

silenium-dev commented 1 year ago

I'd like to use Fedora CoreOS (https://docs.fedoraproject.org/en-US/fedora-coreos/) with the Cluster API Provider Hetzner (https://github.com/syself/cluster-api-provider-hetzner), but it requires any setup of bare metal machines to be made with installimage, which currently doesn't support it, because it has a different filesystem structure than common Linux distributions. It uses an ostree based root filesystem for A/B-deployments and rollbacks. This requires btrfs with snapshots and a different /boot layout.

asciiprod commented 1 year ago

Thank you for your suggestion. CoreOS installations are very different to what installimage can currently do or what is was designed for. Adding support will hence require substantial changes to the code. There are no plans to add this, but if you like to give it a try, feel free to open a pull request

silenium-dev commented 1 year ago

I will give it a try, am I allowed to use the coreos-installer (requires rustup and cargo install on the rescue system) or should I write the config manually. To configure CoreOS, should I assemble the ignition config from the given options (DRIVE1, DRIVE2, SWRAID etc.) or add a CoreOS specific option to pass an url where the installer can download the config? Using an url to download the ignition config would allow much more customization.

silenium-dev commented 1 year ago

@asciiprod How do I test my changes? Is there any test environment (VM image, packer config) or do I have to use a dedicated server with its rescue system? And on the rescue system, how do I replace the already present installimage with my own, because I have only read permissions on the NFS mount, but the installimage script requires being in a specific directory.

yaroze commented 1 year ago

I will give it a try, am I allowed to use the coreos-installer (requires rustup and cargo install on the rescue system) or should I write the config manually. To configure CoreOS, should I assemble the ignition config from the given options (DRIVE1, DRIVE2, SWRAID etc.) or add a CoreOS specific option to pass an url where the installer can download the config? Using an url to download the ignition config would allow much more customization.

Hi! I've been developing a Dockerfile that creates an image you can use to generate and inject an ignition file on Fedora CoreOS.

You can then test it on qemu or another hypervisor that supports qcow2. If it works, you might be able to deploy it on Hetzner servers through the rescue system, but I give no guarantees, as I'm not (yet) a Hetzner customer.

You can find it on my GH repo @yaroze/oci-fcos.

silenium-dev commented 1 year ago

Hi! I've been developing a Dockerfile that creates an image you can use to generate and inject an ignition file on Fedora CoreOS.

You can then test it on qemu or another hypervisor that supports qcow2. If it works, you might be able to deploy it on Hetzner servers through the rescue system, but I give no guarantees, as I'm not (yet) a Hetzner customer.

You can find it on my GH repo @yaroze/oci-fcos.

This doesn't help me, because I have to use the installimage method as described in the issue. For installing coreos with an ignition file, there is already the official coreos-installer which does exactly that: write coreos and the ignition file onto a disk. It's available as a container image, too.

yaroze commented 1 year ago

the official coreos-installer which does exactly that: write coreos and the ignition file onto a disk. It's available as a container image, too.

Not quite... it's a bit different from coreos-installer. Coreos-installer takes an ISO and deploys FCOS on the same machine it is running.

My dockerfile takes a vanilla/official FCOS qcow2 image and embeds the ignition file into it, which can then be used on a VM running on qemu. That was my purpose, as I want to run FCOS on Oracle Cloud, which doesn't also support ignition files. However, they support qcow2 images, hence my specific use case.

If that feature was available in coreos-installer, I wouldn't take the effort of developing something that has already been developed 😅

In your case, you could convert the resulting qcow2 image to raw and use dd to dump it to your server (maybe I'll also find a way to convert it with the Docker as an optional parameter🤔).

I don't know about Hetzner's rescue system, but you can do the dd over ssh if, for some reason, you can't upload the raw image to the filesystem of the rescue system.

silenium-dev commented 1 year ago

I don't know about Hetzner's rescue system, but you can do the dd over ssh if, for some reason, you can't upload the raw image to the filesystem of the rescue system.

installimage runs on the rescue system which is booted via PXE. It doesn't run from disk so you can write disks without breaking the running system. I don't need to write from somewhere else or somehow else. I just need to integrate the coreos-installer with installimage. And it's a tool for dedicated root servers, which don't use qcow2. The hetzner cloud VMs also support the rescue system, so there is no need for uploading a custom disk image too.

And, as stated in the original comment, I require it to be installed with installimage.