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

Register AWS AMIs as preferring UEFI over legacy BIOS #582

Open
wants to merge 3 commits into
base: flatcar-master
Choose a base branch
from

Conversation

chewi
Copy link
Contributor

@chewi chewi commented Feb 14, 2025

Register AWS AMIs as preferring UEFI over legacy BIOS

I'm not aware of any instance types that don't support UEFI, so we could possibly set this to UEFI only, but best play it safe.

Also use actual values in the image format error message. The message said raw or vmdk, but these actually need to be uppercased.

On a sidenote, I wondered what would happen to existing instances if we eventually drop BIOS support. You can convert them to UEFI, but it involves taking an AMI snapshot, registering it as a new image, and launching a new instance, which is a little tedious.

How to use

Use ore aws upload, spawn an instance, and run sudo efibootmgr to verify that it booted using UEFI.

Testing done

I've done the above.

@chewi chewi requested a review from a team February 14, 2025 16:44
@chewi chewi self-assigned this Feb 14, 2025
@jepio
Copy link
Member

jepio commented Feb 17, 2025

I'm not aware of any instance types that don't support UEFI, so we could possibly set this to UEFI only, but best play it safe.

What instance types did you test on? We run kola tests on m4.2xlarge and t3.small - and both happen to be BIOS only :)

I'm also going to capture here because I tested it:
the TpmSupport flag to RegisterImage requires BootMode=uefi and doesn't work with BootMode=uefi-preferred.

Copy link
Member

@jepio jepio left a comment

Choose a reason for hiding this comment

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

lgtm

@chewi
Copy link
Contributor Author

chewi commented Feb 17, 2025

What instance types did you test on? We run kola tests on m4.2xlarge and t3.small - and both happen to be BIOS only :)

I used t3.small. What makes you think that's BIOS-only?

I'm also going to capture here because I tested it: the TpmSupport flag to RegisterImage requires BootMode=uefi and doesn't work with BootMode=uefi-preferred.

That could be a reason to go with uefi then?

@jepio
Copy link
Member

jepio commented Feb 17, 2025

I'm not aware of any instance types that don't support UEFI, so we could possibly set this to UEFI only, but best play it safe.

What instance types did you test on? We run kola tests on m4.2xlarge and t3.small - and both happen to be BIOS only :)

Strike half of that, t3.small does support UEFI. m4 instances are BIOS only.

@jepio
Copy link
Member

jepio commented Feb 17, 2025

What instance types did you test on? We run kola tests on m4.2xlarge and t3.small - and both happen to be BIOS only :)

I used t3.small. What makes you think that's BIOS-only?

I'm also going to capture here because I tested it: the TpmSupport flag to RegisterImage requires BootMode=uefi and doesn't work with BootMode=uefi-preferred.

That could be a reason to go with uefi then?

That would mean dropping support for m4/c4 instance types. What would be the impact of that?

@chewi
Copy link
Contributor Author

chewi commented Feb 17, 2025

Right, so anything Xen-based. Sucks that we can't have both unless we register separate AMIs. Having said that, looking at the ore code, I think you can register more than one AMI from a single snapshot?

@chewi
Copy link
Contributor Author

chewi commented Feb 18, 2025

Right, so anything Xen-based. Sucks that we can't have both unless we register separate AMIs. Having said that, looking at the ore code, I think you can register more than one AMI from a single snapshot?

I spoke to @t-lo and he agreed. However, having looked at the code again, it gets quite messy. Some code assumes there is only one AMI being created or only one per region. That could be fixed, but we also publish lists of the AMIs. Again, these assume one AMI per region. We have "all" vs "hvm" listings, which are actually the same, but I guess these were different at some point. We could create another variant, but we may be crossing the point where it's no longer worth the effort.

@t-lo says that AWS discourages users from deploying these older instance types. We would only be breaking new deployments here, not upgrades. @jepio, what do you think?

@t-lo
Copy link
Member

t-lo commented Feb 18, 2025

Gen5 and higher (i.e. kvm-based instances) are cheaper to operate, and there has been a general push away from Xen based instances. Gen5 has been available from 2015 onwards (iirc).

Let's bring this up in the dev sync next Wednesday and check what others think?

The message said "raw or vmdk", but these actually need to be
uppercased.

Signed-off-by: James Le Cuirot <[email protected]>
I'm not aware of any instance types that don't support UEFI, so we could
possibly set this to UEFI only, but best play it safe.

Signed-off-by: James Le Cuirot <[email protected]>
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