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

rhel10: drop hardcoded UUIDs from {centos,rhel}-10, fedora #823

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mvo5
Copy link
Contributor

@mvo5 mvo5 commented Jul 31, 2024

rhel10: drop hardcoded UUIDs from {centos,rhel}-10

Historically the rhel/centos image defintion hardcoded the partition
table, partition and filesystem UUIDs. The exact reasons for this
is unclear and it seems it was done mostly for comaptibility with
the previous generation of image build tools.

However given that a UUIDs is meant to be (practically) unique
from rhel10 on we stop hardcoding them. The images library will
then create a random one for each image build. For the cases
where this is undesirable the OSBUILD_TESTING_RNG_SEED env
can be used to control the RNG.


fedora: drop hardcoded UUIDs for partitions/filesystems

Similar to the change in the previous commit for centos10/rhel10
the hardcoding of the UUIDs is also dropped on fedora.

This is the result of the discussion in #816

mvo5 added 2 commits July 31, 2024 16:48
Historically the rhel/centos image defintion hardcoded the partition
table, partition and filesystem UUIDs. The exact reasons for this
is unclear and it seems it was done mostly for comaptibility with
the previous generation of image build tools.

However given that a UUIDs is meant to be (practically) unique
from rhel10 on we stop hardcoding them. The images library will
then create a random one for each image build. For the cases
where this is undesirable the `OSBUILD_TESTING_RNG_SEED` env
can be used to control the RNG.
Similar to the change in the previous commit for centos10/rhel10
the hardcoding of the UUIDs is also dropped on fedora.

Ideally we would only do it for fedora-41 or later but the
library is not split this way yet and just introducing a new
factory for fc41 seems overkill (but I'm happy to do it if
others feel it's worth it).
Copy link
Member

@thozza thozza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's see if anyone will complain 😅

@cgwalters
Copy link
Contributor

The messy thing here is I think it's actually a best practice to do what Fedora CoreOS derivatives have been doing for a while (and what systemd-repart encourages too), which is to regenerate the filesystem UUIDs on firstboot to avoid "UUIDs" actually being the same across multiple VMs instantiated from the single generated disk image.

That's...more difficult to do if the UUIDs are actually random in each disk image as it's harder to know (without using out of band metadata) that they need regeneration.

FCOS has hardcoded "UUIDs" today, but I think it would make sense to use zero.

BTW...there's an "ignition-vs-cloud-init" thing going on here because a lot of cloud VMs use ext4, and historically ext4 didn't allow changing the UUID when the filesystem was already mounted...and cloud-init only runs in the real root. (Actually I may have it backwards and ext4 supports it but other FS's don't).

@mvo5 mvo5 marked this pull request as draft July 31, 2024 15:35
@mvo5
Copy link
Contributor Author

mvo5 commented Jul 31, 2024

Thanks for the feedback @cgwalters - you raise a very good point here that this maybe only solving half-of-the problem and by doing that actually making it worse. I will look into what we can do, it might involve getting by-in to be able to run systemd-repart.

Copy link
Member

@achilleas-k achilleas-k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good to merge now.
Let's follow it up with a systemd-repart configuration and zeroes like Colin suggested.

For that though I'd talk to other teams (for RHEL), because it might be a pretty significant change for cloud images and expectations around marketplace and golden images.

Copy link

github-actions bot commented Sep 1, 2024

This PR is stale because it has been open 30 days with no activity. Remove "Stale" label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Sep 1, 2024
@thozza thozza removed the Stale label Sep 3, 2024
Copy link

github-actions bot commented Oct 4, 2024

This PR is stale because it has been open 30 days with no activity. Remove "Stale" label or comment or this will be closed in 7 days.

@github-actions github-actions bot added the Stale label Oct 4, 2024
@mvo5 mvo5 removed the Stale label Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants