os-autoinst-distri-opensuse icon indicating copy to clipboard operation
os-autoinst-distri-opensuse copied to clipboard

[WIP] Automate iPXE host installation for SL Micro 6.1

Open waynechen55 opened this issue 6 months ago • 11 comments

  • This pull request aims to support automated SL Micro 6.1 iPXE installation by using PXE-capable kernel/initrd and pre-built disk image (indicated by rd.kiwi.install.image=MIRROR_HTTP/HDD_1) which then will be deployed onto specified disk device (indicated by rd.kiwi.oem.installdevice=/dev/disk/by-id/INSTALL_DISK_WWN) and configured by using ignition/combustion (indicated by FIRST_BOOT_CONFIG).

  • Several new subroutines in lib/utils.pm:

    • is_disk_image indicates pre-built disk image will used for OS installation.
    • is_ipxe_with_disk_image indicates OS installation is performed with iPXE and disk image.
  • New test module jeos/prepare_firstboot_config.pm:

    • Aims to generate ignition or combustion configuration file based on template config.ign.ARCH.ep or script.ARCH.ep.
    • Setting FIRSTBOOT_CONFIG_DIR provides flexibility of using customized folder to store configuration templates.
    • Subroutine prepare_profile does the actual job of expanding variables (like SERIALCONSOLE) and uploading final configuration file.
    • Save addresses of configuration files to settings IGNITION_URL and COMBUSTION_URL.
  • Changes made to tests/installation/ipxe_install.pm:

    • Move part of adding extra kernel command line outside set_bootscript and into a new subroutine set_bootscript_cmdline_extra to avoid inflated set_bootscript subroutine.
    • Introduce BOOTLOADER_ROOT_DEVICE and BOOTLOADER_INITRD which indicates whether root device and specified initrd are needed at boot time for UEFI machines. If they are not needed, set BOOTLOADER_ROOT_DEVICE=0 and BOOTLOADER_INITRD=0. If customized ones are needed, set BOOTLOADER_ROOT_DEVICE=/dev/xxx and BOOTLOADER_INITRD=initrd_addr instead of default root=/dev/ram0 and initrd=initrd. Not using BOOTLOADER_ROOT_DEVICE and BOOTLOADER_INITRD means using default settings.
    • New subroutine set_bootscript_image_config adds boot parameters for pre-built disk image on kernel command line to achieve non-interactive mode installation, which is called in set_bootscript_cmdline_extra. Setting rd.kiwi.oem.installdevice is only added if FIRST_BOOT_CONFIG is being used, which means full automation, and INSTALL_DISK_WWN will be set to /dev/sda or /dev/vda if it not given.
    • New subroutine set_bootscript_firstboot_config adds boot parameters for first boot configuration on kernel command line to complete automated configuration, which is called in set_bootscript_cmdline_extra.
    • Only needles load-linux-kernel and load-initrd need to be matched for OS installation with disk image.
  • Changes made to tests/microos/selfinstall.pm:

    • For installation with specified disk device, there will be no prompt confirmation of disk device, only dialogues of writing into and verifying disk device are shown up. Corresponding needles slem-selfinstall-write-drive and slem-selfinstall-verify-drive will be matched.
    • Due to test runs under various circumstances, check_screen('slem-selfinstall-verify-drive') will be used after assert_screen('slem-selfinstall-write-drive') to avoid unnecessary failures.
  • New ignition (config.ign.x86_64.ep and config.ign.aarch64.ep) and combustion (script.x86_64.ep and script.aarch64.ep) configuration templates, which are based on architecture to better facilitate first boot configuration process. These templates need to be expanded, because there are different serial consoles and etc being used for different machines, by executing jeos/prepare_firstboot_config.pm at the beginning of test run. Final configuration files are served on URL (IGNITION_URL and COMBUSTION_URL) and will be provided on kernel command line directly.

  • Add new schedule file schedule/virt_autotest/install_guest_on_slem_kvm_host_ipxe_install.yaml for iPXE installation and rename existing one to schedule/virt_autotest/install_guest_on_slem_kvm_host_usb_install.yaml.

  • Trivial changes are made to legacy combustion/script file to take GRUB_TERMINAL_INPUT and GRUB_TERMINAL_OUTPUT into consideration as well.

  • Verification Runs:

  • Needles:

    • Needle slem-selfinstall-write-drive slem-selfinstall-write-drive
    • Needle slem-selfinstall-verify-drive slem-selfinstall-verify-drive

waynechen55 avatar Aug 23 '24 04:08 waynechen55