When deploying RHEL on some UEFI system Curtin is unable to configure GRUB causing a deployment failure. This does not happen on all systems.
MAAS: 2.5.0~beta4-7361-g401d6c73d-0ubuntu1~18.10.1
Curtin: 18.1-51-gb812ae80-0ubuntu2~18.04.1
RHEL: 7.4
Unexpected error while running command.
Command: ['/tmp/tmpvu7bea_w/target/curtin/curtin-hooks']
Exit code: 1
Reason: -
Stdout: ''
Stderr: ''
curtin: Installation failed with exception: Unexpected error while running command.
Command: ['curtin', 'curthooks']
Exit code: 3
Reason: -
Stdout: Setting up swapspace version 1, size = 8 GiB (8589930496 bytes)
no label, UUID=05665f02-3198-4fb8-b6ff-3e516198fd48
Traceback (most recent call last):
File "/tmp/tmpvu7bea_w/target/curtin/curtin-hooks.py", line 396, in <module>
main()
File "/tmp/tmpvu7bea_w/target/curtin/curtin-hooks.py", line 374, in main
centos_curthooks(cfg, target, state)
File "/curtin/curtin/commands/curthooks.py", line 1253, in builtin_curthooks
setup_grub(cfg, target, osfamily=osfamily)
File "/curtin/curtin/commands/curthooks.py", line 396, in setup_grub
join_stdout_err + args + instdevs, env=env, capture=True)
File "/curtin/curtin/util.py", line 266, in subp
return _subp(*args, **kwargs)
File "/curtin/curtin/util.py", line 132, in _subp
cmd=args)
curtin.util.ProcessExecutionError: Unexpected error while running command.
Command: ['sh', '-c', 'exec "$0" "$@" 2>&1', 'install-grub', '--uefi', '--update-nvram', '--os-family=redhat', '/tmp/tmpvu7bea_w/target', '/dev/sda']
Exit code: 1
Reason: -
Stdout: + echo 'before grub-install efiboot settings'
before grub-install efiboot settings
+ efibootmgr -v
BootCurrent: 0002
BootOrder: 0002
Boot0000* Hard drive C: VenHw(d6c0639f-c705-4eb9-aa4f-5802d8823de6).................. ....... ... .......................................................A.....................A.0.S.0. .D.E.L.L.B.O.S.S. .V.D...
Boot0001* IBA GE Slot 1900 v1585 BBS(128,IBA GE Slot 1900 v1585,0x0)........................B.............................................................A.....................I.B.A. .G.E. .S.l.o.t. .1.9.0.0. .v.1.5.8.5...
Boot0002* Integrated NIC 1 Port 1 Partition 1 VenHw(3a191845-5f86-4e78-8fce-c4cff59f9daa)
MirroredPercentageAbove4G: 0.00
MirrorMemoryBelow4GB: false
+ bootid=rhel
+ grubpost=
+ case $bootid in
+ grubcmd=grub2-install
+ grubpost='grub2-mkconfig -o /boot/grub2/grub.cfg'
+ target=--target=x86_64-efi
+ no_nvram=
+ efi_dir=--efi-directory=/boot/efi
++ grub2-install --help
+ gi_out='Usage: grub2-install [OPTION...] [OPTION] [INSTALL_DEVICE]
Install GRUB on your drive.
--compress[=no,xz,gz,lzo] compress GRUB files [optional]
-d, --directory=DIR use images and modules under DIR
[default=/usr/lib/grub/<platform>]
--fonts=FONTS install FONTS [default=unicode]
--install-modules=MODULES install only MODULES and their dependencies
[default=all]
-k, --pubkey=FILE embed FILE as public key for signature checking
--locale-directory=DIR use translations under DIR
[default=/usr/share/locale]
--locales=LOCALES install only LOCALES [default=all]
--modules=MODULES pre-load specified modules MODULES
--themes=THEMES install THEMES [default=starfield]
-v, --verbose print verbose messages.
--allow-floppy make the drive also bootable as floppy (default
for fdX devices). May break on some BIOSes.
--boot-directory=DIR install GRUB images under the directory DIR/grub2
instead of the boot/grub2 directory
--bootloader-id=ID the ID of bootloader. This option is only
available on EFI and Macs.
--core-compress=xz|none|auto
choose the compression to use for core image
--disk-module=MODULE disk module to use (biosdisk or native). This
option is only available on BIOS target.
--efi-directory=DIR use DIR as the EFI System Partition root.
--force install even if problems are detected
--force-file-id use identifier file even if UUID is available
--label-bgcolor=COLOR use COLOR for label background
--label-color=COLOR use COLOR for label
--label-font=FILE use FILE as font for label
--macppc-directory=DIR use DIR for PPC MAC install.
--no-bootsector do not install bootsector
--no-nvram don'\''t update the `boot-device'\''/`Boot*'\'' NVRAM
variables. This option is only available on EFI
and IEEE1275 targets.
--no-rs-codes Do not apply any reed-solomon codes when
embedding core.img. This option is only available
on x86 BIOS targets.
--product-version=STRING use STRING as product version
--recheck delete device map if it already exists
--removable the installation device is removable. This option
is only available on EFI.
-s, --skip-fs-probe do not probe for filesystems in DEVICE
--target=TARGET install GRUB for TARGET platform
[default=x86_64-efi]; available targets: arm-efi,
arm-uboot, arm64-efi, i386-coreboot, i386-efi,
i386-ieee1275, i386-multiboot, i386-pc,
i386-qemu, i386-xen, ia64-efi, mips-arc,
mips-qemu_mips, mipsel-arc, mipsel-loongson,
mipsel-qemu_mips, powerpc-ieee1275,
sparc64-ieee1275, x86_64-efi, x86_64-xen
-?, --help give this help list
--usage give a short usage message
-V, --version print program version
Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.
INSTALL_DEVICE must be system device filename.
grub2-install copies GRUB images into boot/grub2. On some platforms, it may
also install GRUB into the boot sector.
Report bugs to <email address hidden>.'
+ grep -q -- ''
+ echo 'Usage: grub2-install [OPTION...] [OPTION] [INSTALL_DEVICE]
Install GRUB on your drive.
--compress[=no,xz,gz,lzo] compress GRUB files [optional]
-d, --directory=DIR use images and modules under DIR
[default=/usr/lib/grub/<platform>]
--fonts=FONTS install FONTS [default=unicode]
--install-modules=MODULES install only MODULES and their dependencies
[default=all]
-k, --pubkey=FILE embed FILE as public key for signature checking
--locale-directory=DIR use translations under DIR
[default=/usr/share/locale]
--locales=LOCALES install only LOCALES [default=all]
--modules=MODULES pre-load specified modules MODULES
--themes=THEMES install THEMES [default=starfield]
-v, --verbose print verbose messages.
--allow-floppy make the drive also bootable as floppy (default
for fdX devices). May break on some BIOSes.
--boot-directory=DIR install GRUB images under the directory DIR/grub2
instead of the boot/grub2 directory
--bootloader-id=ID the ID of bootloader. This option is only
available on EFI and Macs.
--core-compress=xz|none|auto
choose the compression to use for core image
--disk-module=MODULE disk module to use (biosdisk or native). This
option is only available on BIOS target.
--efi-directory=DIR use DIR as the EFI System Partition root.
--force install even if problems are detected
--force-file-id use identifier file even if UUID is available
--label-bgcolor=COLOR use COLOR for label background
--label-color=COLOR use COLOR for label
--label-font=FILE use FILE as font for label
--macppc-directory=DIR use DIR for PPC MAC install.
--no-bootsector do not install bootsector
--no-nvram don'\''t update the `boot-device'\''/`Boot*'\'' NVRAM
variables. This option is only available on EFI
and IEEE1275 targets.
--no-rs-codes Do not apply any reed-solomon codes when
embedding core.img. This option is only available
on x86 BIOS targets.
--product-version=STRING use STRING as product version
--recheck delete device map if it already exists
--removable the installation device is removable. This option
is only available on EFI.
-s, --skip-fs-probe do not probe for filesystems in DEVICE
--target=TARGET install GRUB for TARGET platform
[default=x86_64-efi]; available targets: arm-efi,
arm-uboot, arm64-efi, i386-coreboot, i386-efi,
i386-ieee1275, i386-multiboot, i386-pc,
i386-qemu, i386-xen, ia64-efi, mips-arc,
mips-qemu_mips, mipsel-arc, mipsel-loongson,
mipsel-qemu_mips, powerpc-ieee1275,
sparc64-ieee1275, x86_64-efi, x86_64-xen
-?, --help give this help list
--usage give a short usage message
-V, --version print program version
Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.
INSTALL_DEVICE must be system device filename.
grub2-install copies GRUB images into boot/grub2. On some platforms, it may
also install GRUB into the boot sector.
Report bugs to <email address hidden>.'
+ grep -q -- --target
+ echo 'Usage: grub2-install [OPTION...] [OPTION] [INSTALL_DEVICE]
Install GRUB on your drive.
--compress[=no,xz,gz,lzo] compress GRUB files [optional]
-d, --directory=DIR use images and modules under DIR
[default=/usr/lib/grub/<platform>]
--fonts=FONTS install FONTS [default=unicode]
--install-modules=MODULES install only MODULES and their dependencies
[default=all]
-k, --pubkey=FILE embed FILE as public key for signature checking
--locale-directory=DIR use translations under DIR
[default=/usr/share/locale]
--locales=LOCALES install only LOCALES [default=all]
--modules=MODULES pre-load specified modules MODULES
--themes=THEMES install THEMES [default=starfield]
-v, --verbose print verbose messages.
--allow-floppy make the drive also bootable as floppy (default
for fdX devices). May break on some BIOSes.
--boot-directory=DIR install GRUB images under the directory DIR/grub2
instead of the boot/grub2 directory
--bootloader-id=ID the ID of bootloader. This option is only
available on EFI and Macs.
--core-compress=xz|none|auto
choose the compression to use for core image
--disk-module=MODULE disk module to use (biosdisk or native). This
option is only available on BIOS target.
--efi-directory=DIR use DIR as the EFI System Partition root.
--force install even if problems are detected
--force-file-id use identifier file even if UUID is available
--label-bgcolor=COLOR use COLOR for label background
--label-color=COLOR use COLOR for label
--label-font=FILE use FILE as font for label
--macppc-directory=DIR use DIR for PPC MAC install.
--no-bootsector do not install bootsector
--no-nvram don'\''t update the `boot-device'\''/`Boot*'\'' NVRAM
variables. This option is only available on EFI
and IEEE1275 targets.
--no-rs-codes Do not apply any reed-solomon codes when
embedding core.img. This option is only available
on x86 BIOS targets.
--product-version=STRING use STRING as product version
--recheck delete device map if it already exists
--removable the installation device is removable. This option
is only available on EFI.
-s, --skip-fs-probe do not probe for filesystems in DEVICE
--target=TARGET install GRUB for TARGET platform
[default=x86_64-efi]; available targets: arm-efi,
arm-uboot, arm64-efi, i386-coreboot, i386-efi,
i386-ieee1275, i386-multiboot, i386-pc,
i386-qemu, i386-xen, ia64-efi, mips-arc,
mips-qemu_mips, mipsel-arc, mipsel-loongson,
mipsel-qemu_mips, powerpc-ieee1275,
sparc64-ieee1275, x86_64-efi, x86_64-xen
-?, --help give this help list
--usage give a short usage message
-V, --version print program version
Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.
INSTALL_DEVICE must be system device filename.
grub2-install copies GRUB images into boot/grub2. On some platforms, it may
also install GRUB into the boot sector.
Report bugs to <email address hidden>.'
+ grep -q -- --efi-directory
+ echo 'Usage: grub2-install [OPTION...] [OPTION] [INSTALL_DEVICE]
Install GRUB on your drive.
--compress[=no,xz,gz,lzo] compress GRUB files [optional]
-d, --directory=DIR use images and modules under DIR
[default=/usr/lib/grub/<platform>]
--fonts=FONTS install FONTS [default=unicode]
--install-modules=MODULES install only MODULES and their dependencies
[default=all]
-k, --pubkey=FILE embed FILE as public key for signature checking
--locale-directory=DIR use translations under DIR
[default=/usr/share/locale]
--locales=LOCALES install only LOCALES [default=all]
--modules=MODULES pre-load specified modules MODULES
--themes=THEMES install THEMES [default=starfield]
-v, --verbose print verbose messages.
--allow-floppy make the drive also bootable as floppy (default
for fdX devices). May break on some BIOSes.
--boot-directory=DIR install GRUB images under the directory DIR/grub2
instead of the boot/grub2 directory
--bootloader-id=ID the ID of bootloader. This option is only
available on EFI and Macs.
--core-compress=xz|none|auto
choose the compression to use for core image
--disk-module=MODULE disk module to use (biosdisk or native). This
option is only available on BIOS target.
--efi-directory=DIR use DIR as the EFI System Partition root.
--force install even if problems are detected
--force-file-id use identifier file even if UUID is available
--label-bgcolor=COLOR use COLOR for label background
--label-color=COLOR use COLOR for label
--label-font=FILE use FILE as font for label
--macppc-directory=DIR use DIR for PPC MAC install.
--no-bootsector do not install bootsector
--no-nvram don'\''t update the `boot-device'\''/`Boot*'\'' NVRAM
variables. This option is only available on EFI
and IEEE1275 targets.
--no-rs-codes Do not apply any reed-solomon codes when
embedding core.img. This option is only available
on x86 BIOS targets.
--product-version=STRING use STRING as product version
--recheck delete device map if it already exists
--removable the installation device is removable. This option
is only available on EFI.
-s, --skip-fs-probe do not probe for filesystems in DEVICE
--target=TARGET install GRUB for TARGET platform
[default=x86_64-efi]; available targets: arm-efi,
arm-uboot, arm64-efi, i386-coreboot, i386-efi,
i386-ieee1275, i386-multiboot, i386-pc,
i386-qemu, i386-xen, ia64-efi, mips-arc,
mips-qemu_mips, mipsel-arc, mipsel-loongson,
mipsel-qemu_mips, powerpc-ieee1275,
sparc64-ieee1275, x86_64-efi, x86_64-xen
-?, --help give this help list
--usage give a short usage message
-V, --version print program version
Mandatory or optional arguments to long options are also mandatory or optional
for any corresponding short options.
INSTALL_DEVICE must be system device filename.
grub2-install copies GRUB images into boot/grub2. On some platforms, it may
also install GRUB into the boot sector.
Report bugs to <email address hidden>.'
+ grub2-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=rhel --recheck
Installing for x86_64-efi platform.
grub2-install: error: /boot/efi doesn't look like an EFI partition.
.
failed to install grub!
Stderr: ''
Unexpected error while running command.
Command: ['/tmp/tmpvu7bea_w/target/curtin/curtin-hooks']
Exit code: 1
Reason: -
Stdout: ''
Stderr: ''
The error message at the bottom is key:
grub2-install: error: /boot/efi doesn't look like an EFI partition.
The storage config from the logs, is not configured for EFI:
storage: 236c-4fd8- b6ff-4da5bac297 ea, wipe: superblock} 151e-4a2b- 832d-75c048f740 4e,
config:
- {grub_device: true, id: sda, model: DELLBOSS VD, name: sda, ptable: gpt, serial: 8c52657e3d930010,
type: disk, wipe: superblock}
- {id: nvme0n1, model: Dell Express Flash NVMe P4500 4.0TB SFF, name: nvme0n1, serial: PHLF814200YA4P0IGN,
type: disk, wipe: superblock}
- {id: nvme1n1, model: Dell Express Flash NVMe P4500 4.0TB SFF, name: nvme1n1, serial: BTLF82250JCW4P0IGN,
type: disk, wipe: superblock}
- {id: nvme3n1, model: Dell Express Flash NVMe P4500 4.0TB SFF, name: nvme3n1, serial: BTLF82250J8L4P0IGN,
type: disk, wipe: superblock}
- {id: nvme2n1, model: Dell Express Flash NVMe P4500 4.0TB SFF, name: nvme2n1, serial: BTLF82250HW24P0IGN,
type: disk, wipe: superblock}
- {device: sda, id: sda-part1, name: sda-part1, number: 1, offset: 4194304B, size: 239981297664B,
type: partition, uuid: 1a1779e5-
- {fstype: xfs, id: sda-part1_format, label: '', type: format, uuid: 193b084d-
volume: sda-part1}
- {device: sda-part1_format, id: sda-part1_mount, options: '', path: /, type: mount}
So it would appear that MAAS sent a non-UEFI config to a system that thought was in UEFI mode.