diff --git a/bifrost/cli.py b/bifrost/cli.py index fe93b5a5f..5cb609268 100644 --- a/bifrost/cli.py +++ b/bifrost/cli.py @@ -123,7 +123,7 @@ def cmd_testenv(args): test_vm_disk_gib=args.disk, test_vm_domain_type=args.domain_type, test_vm_node_driver=args.driver, - default_boot_mode='uefi' if args.uefi else 'bios', + default_boot_mode=args.boot_mode or 'uefi', baremetal_json_file=os.path.abspath(args.inventory), baremetal_nodes_json=os.path.abspath(args.output), extra_vars=args.extra_vars, @@ -169,7 +169,7 @@ def cmd_install(args): use_tinyipa=args.testenv, developer_mode=args.develop, enable_prometheus_exporter=args.enable_prometheus_exporter, - default_boot_mode='uefi' if args.uefi else 'bios', + default_boot_mode=args.boot_mode or 'uefi', include_dhcp_server=not args.disable_dhcp, extra_vars=args.extra_vars, **kwargs) @@ -224,8 +224,13 @@ def parse_args(): testenv.add_argument('--driver', default='ipmi', choices=['ipmi', 'redfish'], help='driver for testing nodes') - testenv.add_argument('--uefi', action='store_true', - help='boot testing VMs with UEFI by default') + boot_mode = testenv.add_mutually_exclusive_group() + boot_mode.add_argument('--uefi', dest='boot_mode', + action='store_const', const='uefi', + help='boot testing VMs with UEFI by default') + boot_mode.add_argument('--legacy-boot', dest='boot_mode', + action='store_const', const='bios', + help='boot testing VMs with legacy boot by default') testenv.add_argument('-e', '--extra-vars', action='append', help='additional vars to pass to ansible') testenv.add_argument('-o', '--output', default='baremetal-nodes.json', @@ -261,8 +266,13 @@ def parse_args(): 'deployments (can take a lot of time)') install.add_argument('--enable-prometheus-exporter', action='store_true', help='Enable Ironic Prometheus Exporter') - install.add_argument('--uefi', action='store_true', - help='use UEFI by default') + boot_mode = install.add_mutually_exclusive_group() + boot_mode.add_argument('--uefi', dest='boot_mode', + action='store_const', const='uefi', + help='use UEFI boot by default') + boot_mode.add_argument('--legacy-boot', dest='boot_mode', + action='store_const', const='bios', + help='use legacy boot (BIOS) by default') install.add_argument('--disable-dhcp', action='store_true', help='Disable integrated dhcp server') install.add_argument('-e', '--extra-vars', action='append', diff --git a/doc/source/install/index.rst b/doc/source/install/index.rst index af500f08f..de1d7378e 100644 --- a/doc/source/install/index.rst +++ b/doc/source/install/index.rst @@ -286,8 +286,8 @@ Additionally, the following parameters can be useful: ``--enable-prometheus-exporter`` Enable the Ironic Prometheus Exporter service. -``--uefi`` - Boot machines in the UEFI mode by default. +``--uefi`` / ``--legacy-boot`` + Boot machines in the UEFI or BIOS mode by default (defaults to UEFI). ``--disable-dhcp`` Disable the configuration of the integrated DHCP server, allowing to use diff --git a/playbooks/roles/bifrost-ironic-install/defaults/main.yml b/playbooks/roles/bifrost-ironic-install/defaults/main.yml index ed1a3117c..1a82d2ebb 100644 --- a/playbooks/roles/bifrost-ironic-install/defaults/main.yml +++ b/playbooks/roles/bifrost-ironic-install/defaults/main.yml @@ -156,7 +156,7 @@ enabled_vendor_interfaces: "" default_resource_class: baremetal -default_boot_mode: "" +default_boot_mode: uefi enable_credential_less_deploy: false diff --git a/playbooks/roles/bifrost-ironic-install/templates/ironic.conf.j2 b/playbooks/roles/bifrost-ironic-install/templates/ironic.conf.j2 index 342b06458..0f4f638ae 100644 --- a/playbooks/roles/bifrost-ironic-install/templates/ironic.conf.j2 +++ b/playbooks/roles/bifrost-ironic-install/templates/ironic.conf.j2 @@ -78,9 +78,7 @@ enable_netboot_fallback = true http_url = http://{{ internal_ip }}:{{ file_url_port }}/ http_root = {{ http_boot_folder }} default_boot_option = local -{% if default_boot_mode | default('') != '' %} default_boot_mode = {{ default_boot_mode }} -{% endif %} fast_track = {{ fast_track }} {% if cleaning_disk_erase | bool %} erase_devices_priority = 10 diff --git a/releasenotes/notes/uefi-default-730aeff37716fe08.yaml b/releasenotes/notes/uefi-default-730aeff37716fe08.yaml new file mode 100644 index 000000000..1ddfa3e9f --- /dev/null +++ b/releasenotes/notes/uefi-default-730aeff37716fe08.yaml @@ -0,0 +1,9 @@ +--- +upgrade: + - | + Bifrost now uses UEFI by default. Set ``default_boot_mode`` to ``bios`` + or use the ``--legacy-boot`` CLI flag to override. +deprecations: + - | + Using legacy boot is deprecated, although we don't have immediate plans + to remove its support. Please consider using UEFI. diff --git a/zuul.d/bifrost-jobs.yaml b/zuul.d/bifrost-jobs.yaml index 3baf942d8..0dc89d120 100644 --- a/zuul.d/bifrost-jobs.yaml +++ b/zuul.d/bifrost-jobs.yaml @@ -117,7 +117,6 @@ name: bifrost-integration-redfish-vmedia-uefi-ubuntu-focal parent: bifrost-integration-tinyipa-ubuntu-focal vars: - boot_mode: uefi enable_tls: true test_driver: redfish use_vmedia: true @@ -150,7 +149,6 @@ name: bifrost-integration-redfish-vmedia-uefi-centos-8 parent: bifrost-integration-tinyipa-centos-8 vars: - boot_mode: uefi test_driver: redfish use_vmedia: true @@ -179,7 +177,6 @@ name: bifrost-integration-redfish-uefi-fedora-latest parent: bifrost-integration-tinyipa-fedora-latest vars: - boot_mode: uefi test_driver: redfish - job: