Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1507860

Summary: [RFE] Enable UEFI disk image building support on top of the RHEL 7.4 KVM guest Image
Product: Red Hat OpenStack Reporter: Ramon Acedo <racedoro>
Component: openstack-tripleoAssignee: Nobody <nobody>
Status: CLOSED CURRENTRELEASE QA Contact: Wei Shi <wshi>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 14.0 (Rocky)CC: atonner, cjanisze, jboutaud, jgreguske, jschluet, lersek, linl, mburns, mlammon, peter.vreman, racedoro, ribarry, sputhenp, wshi, yroblamo
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-02-02 17:57:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1769177    
Bug Blocks:    

Description Ramon Acedo 2017-10-31 10:45:58 UTC
To be able to deploy the RHEL KVM guest image on bare metal nodes with UEFI enabled the guest image needs to at least support GRUB2 with EFI modules/config and GPT partition tables.

This is a dependency to allow deploying the RHEL KVM guest image with Ironic on bare metal nodes with UEFI (BZ#1438574).

We intend to use and recommend the RHEL KVM guest image as our default testing image with Ironic in the Overcloud, including on UEFI enabled nodes.

Thanks.

Comment 4 Ryan Barry 2017-11-01 02:29:06 UTC
Brew image-build uses ImageFactory by default, in EFI mode. Are we sure this doesn't already work?

Comment 5 mlammon 2017-12-08 22:50:08 UTC
I looked at the image and it does not appear to have the efi files in order to boot.
We need to have the RHEL team investigate what we need to add to this kvm image or potentially provide a separate image with efi support.

(undercloud) [stack@undercloud-0 ~]$ guestfish -a rhel-server-7.4-x86_64-kvm.qcow2

Welcome to guestfish, the guest filesystem shell for
editing virtual machine filesystems and disk images.

Type: 'help' for help on commands
      'man' to read the manual
      'quit' to quit the shell

><fs> run
 100% ⟦▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒
><fs> list file-systems
list: unknown command
><fs> list-filesystems
/dev/sda1: xfs
><fs> mount /dev/sda1 /
><fs> ll /
total 20
dr-xr-xr-x. 17 root root  224 Jul 11 05:47 .
drwxr-xr-x  19 root root 4096 Dec  8 18:16 ..
lrwxrwxrwx.  1 root root    7 Jul 11 05:34 bin -> usr/bin
dr-xr-xr-x.  5 root root 4096 Jul 11 05:48 boot
drwxr-xr-x.  2 root root    6 Jul 11 05:34 dev
drwxr-xr-x. 78 root root 8192 Jul 11 05:48 etc
drwxr-xr-x.  2 root root    6 Mar 10  2016 home
lrwxrwxrwx.  1 root root    7 Jul 11 05:34 lib -> usr/lib
lrwxrwxrwx.  1 root root    9 Jul 11 05:34 lib64 -> usr/lib64
drwxr-xr-x.  2 root root    6 Mar 10  2016 media
drwxr-xr-x.  2 root root    6 Mar 10  2016 mnt
drwxr-xr-x.  2 root root    6 Mar 10  2016 opt
drwxr-xr-x.  2 root root    6 Jul 11 05:34 proc
dr-xr-x---.  2 root root  137 Jul 11 05:49 root
drwxr-xr-x.  2 root root    6 Jul 11 05:34 run
lrwxrwxrwx.  1 root root    8 Jul 11 05:34 sbin -> usr/sbin
drwxr-xr-x.  2 root root    6 Mar 10  2016 srv
drwxr-xr-x.  2 root root    6 Jul 11 05:34 sys
drwxrwxrwt.  7 root root  156 Jul 11 05:49 tmp
drwxr-xr-x. 13 root root  155 Jul 11 05:34 usr
drwxr-xr-x. 19 root root  251 Jul 11 05:42 var

><fs> ll /boot
total 94596
dr-xr-xr-x.  5 root root     4096 Jul 11 05:48 .
dr-xr-xr-x. 17 root root      224 Jul 11 05:47 ..
-rw-r--r--.  1 root root      166 Jul  7 00:01 .vmlinuz-3.10.0-693.el7.x86_64.hmac
-rw-------.  1 root root  3228420 Jul  7 00:01 System.map-3.10.0-693.el7.x86_64
-rw-r--r--.  1 root root   140894 Jul  7 00:01 config-3.10.0-693.el7.x86_64
drwxr-xr-x.  3 root root       17 Jul 11 05:34 efi
drwxr-xr-x.  2 root root       39 Jul 11 05:48 grub
drwx------.  5 root root       97 Jul 11 05:49 grub2
-rw-------.  1 root root 40965056 Jul 11 05:46 initramfs-0-rescue-284f2e4cdb524ce191b99ca123d8859c.img
-rw-------.  1 root root 40462848 Jul 11 05:48 initramfs-3.10.0-693.el7.x86_64.img
-rw-r--r--.  1 root root   293027 Jul  7 00:02 symvers-3.10.0-693.el7.x86_64.gz
-rwxr-xr-x.  1 root root  5875184 Jul 11 05:46 vmlinuz-0-rescue-284f2e4cdb524ce191b99ca123d8859c
-rwxr-xr-x.  1 root root  5875184 Jul  7 00:01 vmlinuz-3.10.0-693.el7.x86_64

><fs> ll /boot/efi/
total 4
drwxr-xr-x. 3 root root   17 Jul 11 05:34 .
dr-xr-xr-x. 5 root root 4096 Jul 11 05:48 ..
drwxr-xr-x. 3 root root   20 Jul 11 05:34 EFI

><fs> ll /boot/efi/EFI/
total 0
drwxr-xr-x. 3 root root 20 Jul 11 05:34 .
drwxr-xr-x. 3 root root 17 Jul 11 05:34 ..
drwxr-xr-x. 2 root root  6 May 31  2017 redhat

><fs> ll /boot/efi/EFI/redhat/
total 0
drwxr-xr-x. 2 root root  6 May 31  2017 .
drwxr-xr-x. 3 root root 20 Jul 11 05:34 ..

Comment 6 mlammon 2017-12-18 20:29:31 UTC
Answer from Ramon and myself in https://bugzilla.redhat.com/show_bug.cgi?id=1507860#c5

Comment 8 Ryan Barry 2017-12-20 11:44:51 UTC
I'll see if we can update the kickstart or brew config here.

This definitely works in Brew for other images

Comment 10 Sandro Bonazzola 2018-03-30 13:24:07 UTC
Moving to openstack since this is an Ironic enablement.

Comment 12 Yolanda Robla 2018-09-28 11:48:47 UTC
For whole disk images, i implemented a new image, as it needs a different schema. So it is found on https://github.com/openstack/tripleo-common/blob/master/image-yaml/overcloud-hardened-images-uefi.yaml .
The build procedure is the same than for the security hardened one, but including the UEFI file instead of using the regular one.

Comment 13 Yolanda Robla 2018-10-02 08:58:25 UTC
The name of the image being built needs to match with the one in the yaml, so the right command to use is:

openstack overcloud image build --image-name overcloud-hardened-uefi-full --config-file  /usr/share/openstack-tripleo-common/image-yaml/overcloud-hardened-images-uefi.yaml --config-file /usr/share/openstack-tripleo-common/image-yaml/overcloud-hardened-images-uefi-centos7.yaml --verbose

Comment 14 Wei Shi 2018-10-12 14:10:38 UTC
Ramon,
  Per the email discussion, could someone from Openstack (QE) team try the rhel-guest-image with efibootmgr and grub2-efi package installed, and provide the test result here?

Comment 15 Chris Janiszewski 2018-10-16 16:06:44 UTC
Wei Shi,

I am not a QE Engineer, but provided by you image has not worked for me in UEFI mode (it still boots ok in Legacy).

I quickly looked at ubuntu cloud image and compared it to rhel7.6 that you have built and I see ubuntu comes with UEFI partition:

(undercloud) [stack@undercloud nfsshare]$ virt-filesystems --long -h --all -a  rhel-guest-image-7.6-210-wshi.x86_64.qcow2
Name       Type        VFS  Label  MBR  Size  Parent
/dev/sda1  filesystem  xfs  -      -    7.8G  -
/dev/sda1  partition   -    -      83   7.8G  /dev/sda
/dev/sda   device      -    -      -    10G   -
(undercloud) [stack@undercloud nfsshare]$ virt-filesystems --long -h --all -a ubuntu-18.04-server-cloudimg-amd64.img
Name       Type       VFS     Label           MBR Size Parent
/dev/sda1  filesystem ext4    cloudimg-rootfs -   2.1G -
/dev/sda14 filesystem unknown -               -   4.0M -
/dev/sda15 filesystem vfat    UEFI            -   106M -
/dev/sda1  partition  -       -               -   2.1G /dev/sda
/dev/sda14 partition  -       -               -   4.0M /dev/sda
/dev/sda15 partition  -       -               -   106M /dev/sda
/dev/sda   device     -       -               -   2.2G -
 

Usually when I build these UEFI images manually I include UEFI partition. I hope this helps.

Comment 16 Wei Shi 2018-10-17 01:56:00 UTC
Hi Ryan, Lubos,
  Per c15, it means only add grub2-efi,efibootmgr to existing rhel-guest-image is not enough to fix this bug. The only modification i did for the image(http://10.8.242.130/rhel-guest-image-7.6-210-wshi.x86_64.qcow2) i provided to Chris is:
  # virt-customize -a rhel-guest-image-7.6-210.x86_64.qcow2 --install grub2-efi,efibootmgr
  Maybe big changes are needed, create a separated UEFI image or change existing image to gpt with additional esp part(like Ubuntu does).
  Please help to evaluate how can we fix this bug in rhel7, thanks.

Comment 18 mlammon 2018-12-17 15:34:28 UTC
Loaded 2018-12-12.4 OSP14 and deployed oc nodes successfully in virtual environment with uefi

Comment 35 Jon Schlueter 2021-02-02 17:57:35 UTC
closing current release per comment #32