image-builder icon indicating copy to clipboard operation
image-builder copied to clipboard

qemu,raw: Ubuntu 20.04 EFI builds are broken

Open johananl opened this issue 2 years ago • 19 comments

What steps did you take and what happened:

PACKER_LOG=1 make build-qemu-ubuntu-2004-efi

The build fails with the following error:

2022/05/11 13:21:06 packer-builder-qemu plugin: Qemu stderr: qemu-system-x86_64: -drive file=OVMF.fd,if=pflash,format=raw,readonly=on: Could not open 'OVMF.fd': No such file or directory
==> qemu: Error launching VM: Qemu failed to start. Please run with PACKER_LOG=1 to get more info.

~The same is theoretically true for make build-raw-ubuntu-2004-efi, however raw builds are currently broken due to https://github.com/kubernetes-sigs/image-builder/issues/879.~ Update: The issue reproduces for raw builds, too.

What did you expect to happen: I expected the build to work.

Anything else you would like to add: Looks like OVMF.fd should be a firmware file used to emulate EFI in VMs. Ideally we should create (or download) this file automatically upon build. If we can't do that, we should document that it's required and probably exempt the EFI builds from make build-{qemu|raw}-all.

Environment:

Project (Image Builder for Cluster API, kube-deploy/imagebuilder, konfigadm): image-builder

Additional info for Image Builder for Cluster API related issues:

  • OS (e.g. from /etc/os-release, or cmd /c ver): Ubuntu 20.04 LTS
  • Packer Version: v1.8.0
  • Packer Provider: qemu
  • Ansible Version: irrelevant
  • Cluster-api version (if using): irrelevant
  • Kubernetes version: (use kubectl version): irrelevant

/kind bug

cc @MaxRink

johananl avatar May 11 '22 10:05 johananl

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Aug 09 '22 10:08 k8s-triage-robot

/remove-lifecycle stale

johananl avatar Aug 09 '22 13:08 johananl

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Nov 07 '22 14:11 k8s-triage-robot

/remove-lifecycle stale

johananl avatar Nov 08 '22 09:11 johananl

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Feb 06 '23 09:02 k8s-triage-robot

/remove-lifecycle stale

johananl avatar Feb 07 '23 10:02 johananl

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar May 08 '23 10:05 k8s-triage-robot

/remove-lifecycle stale

johananl avatar May 08 '23 11:05 johananl

From my (limited) understanding, this requires some qemu(-kvm) tooling to be installed onto the machine you're running this on. We managed to get around this at Giant Swarm by using the docker image running the following:

apt-get update && apt-get install -y qemu qemu-kvm

Maybe it makes sense to have this built in to the standard image-builder container image to at least make sure that is useable out-of-the-box with qemu.

I'm not sure how best to handle this when running make directly other than stating it as a pre-requisite. Do you have any ideas?

AverageMarcus avatar Jun 19 '23 18:06 AverageMarcus

Actually, looks like this is now added to the Docker image: https://github.com/kubernetes-sigs/image-builder/commit/6b2a0ecdf8a73e56c143a626b4630fb060e85473

AverageMarcus avatar Jun 19 '23 18:06 AverageMarcus

@johananl is this still an issue now that #879 is closed? (See also #1122.)

mboersma avatar Aug 10 '23 20:08 mboersma

The OVMF.fd error still reproduces for me @mboersma. IIUC #879 didn't affect this issue but rather the ability to try to reproduce this issue for raw builds (because you need to be able to run a raw build in order to determine if the EFI raw build is broken).

Thanks for the info @AverageMarcus. AFAICT you're talking about the QEMU/KVM dependency which is off course necessary, however I'm not sure how satisfying this dependency fixes the problem with the missing OVMF.fd file.

johananl avatar Aug 14 '23 11:08 johananl

This seems very relevant: https://github.com/tianocore/tianocore.github.io/wiki/How-to-run-OVMF

johananl avatar Aug 14 '23 11:08 johananl

I've reproduced the problem using the Docker-based build, too:

docker run -it --rm --net=host -e PACKER_LOG=1 registry.k8s.io/scl-image-builder/cluster-node-image-builder-amd64:v0.1.17 build-qemu-ubuntu-2004-efi

johananl avatar Aug 14 '23 12:08 johananl

I'll try to build and use OVMF using the instructions above and report here.

johananl avatar Aug 14 '23 12:08 johananl

/assign

johananl avatar Aug 14 '23 12:08 johananl

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Jan 26 '24 08:01 k8s-triage-robot

/remove-lifecycle stale

mboersma avatar Jan 29 '24 16:01 mboersma

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue as fresh with /remove-lifecycle stale
  • Close this issue with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Apr 28 '24 16:04 k8s-triage-robot