MAAS allows system to deploy without UEFI partition

Bug #1802174 reported by Lee Trager
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MAAS
Invalid
High
Unassigned
curtin
Invalid
Undecided
Unassigned

Bug Description

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: ''

Revision history for this message
Lee Trager (ltrager) wrote :
Revision history for this message
Ryan Harper (raharper) wrote :

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:
  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-236c-4fd8-b6ff-4da5bac297ea, wipe: superblock}
  - {fstype: xfs, id: sda-part1_format, label: '', type: format, uuid: 193b084d-151e-4a2b-832d-75c048f7404e,
    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.

Changed in curtin:
status: New → Invalid
Revision history for this message
Lee Trager (ltrager) wrote :

My mistake I thought we had added the UEFI partition back. I'm moving this to a MAAS bug as MAAS should not allow deployments on UEFI systems if the UEFI partition is missing.

Changed in maas:
status: New → Confirmed
importance: Undecided → High
milestone: none → 2.5.0rc1
summary: - Curtin fails to deploy RHEL on some UEFI systems
+ MAAS allows system to deploy without UEFI partition
Revision history for this message
Andres Rodriguez (andreserl) wrote :

How is this reproducible?
How was the configuration when this happened?
What did the user do to felony and have this failed?
Was the machine originally not EFI and the user then set it to EFI manually?
What were the porter control settings like?

Changed in maas:
milestone: 2.5.0rc1 → 2.5.0
status: Confirmed → Incomplete
Revision history for this message
Lee Trager (ltrager) wrote :

The machine was commissioned as a UEFI host and IPMI is configured to boot UEFI. The user created a custom storage layout which did not include /boot/efi. MAAS allowed the user to deploy the machine but deployment failed due to /boot/efi missing. This happens when deploying Ubuntu, CentOS, or RHEL.

MAAS should prevent deployment from happening when the machine is UEFI and there is no /boot/efi partition similarly to how MAAS prevents deployment if there is no / partition.

Changed in maas:
status: Incomplete → Confirmed
Changed in maas:
milestone: 2.5.0 → 2.5.x
Revision history for this message
Adam Collard (adam-collard) wrote :

This bug has not seen any activity in the last 6 months, so it is being automatically closed.

If you are still experiencing this issue, please feel free to re-open.

MAAS Team

Changed in maas:
status: Confirmed → Invalid
Revision history for this message
Barry Price (barryprice) wrote :

This still exists in at least version 2.3.5 (6511-gf466fdb-0ubuntu1).

Deploying to a machine with multiple disks automatically put the OS on the "wrong" disk (i.e. not the one I wanted to use).

Manually creating an ext4 partition on the desired disk and setting it as "/" didn't result in any errors, but the deploy failed.

Removing the first partition, then creating a 500MB vfat partition to mount as /boot/efi and then a second ext4 partition as "/" solved the problem.

This is an IPMI-controlled machine with "Power boot type" set to EFI, so MAAS should be aware that an EFI partition is required.

Revision history for this message
Lee Trager (ltrager) wrote :

@barryprice - RHEL7 should be deployable with MAAS 2.3+ and Curtin-18.1-59+. Make sure you are using those versions or newer. Its possible MAAS commissioned the system using BIOS compatibility which is why the UEFI partition isn't being added correctly. Try recommissioning after making sure the power boot type is set to UEFI.

The RHEL 7 image shouldn't require any Curtin hooks either. You may want to try generating the image with the recently released packer-maas(https://github.com/canonical/packer-maas).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.