dell / dellemc-openmanage-ansible-modules

Dell OpenManage Ansible Modules
GNU General Public License v3.0
335 stars 163 forks source link

[QUESTION]: How to configure NIC1 UEFI Boot URI? #511

Closed BilboTheGreedy closed 1 year ago

BilboTheGreedy commented 1 year ago

i Tried using the idrac_boot module, but not sure its the right way. Because the setting i change via the webgui is under Bios > Network Settings where i set HTTP Device1 to Enabled and then specify URI under HTTP Device1 Settings. This works but i'd like to know if theres a redfish call to configure this or if existing module exist to do this.

so in short... how to...

  1. Set HTTP Device1: Enabled
  2. Set HTTP Device1 Settings URI to: "HTTP Server"

Tried this, but to no luck.

- name: Configure the system boot settings
  dellemc.openmanage.idrac_boot:
    idrac_ip: "{{ idrac_address}}"
    idrac_user: "{{ idrac_username }}"
    idrac_password: "{{ idrac_password }}"
    idrac_port: "{{ https_port }}"
    validate_certs: "{{ validate_certs }}"
    timeout: "{{ https_timeout }}"
    boot_source_override_mode: "uefi"
    boot_source_override_enabled: "once"
    boot_source_override_target: "uefi_http"
    uefi_target_boot_source_override: "http://192.168.10.22/esxi/mboot.efi" <----?
    reset_type: "force_restart"
    job_wait: "{{ job_wait }}"
    job_wait_timeout: "{{ job_wait_timeout }}"
    resource_id: "{{ resource_id | default(omit) }}"
  register: idrac_boot_out
  delegate_to: "{{ idrac_boot_delegate }}"
anupamaloke commented 1 year ago

@BilboTheGreedy, The HTTP boot client settings can only be configured in the UEFI boot mode. Once the bios boot mode is set to UEFI, then you will have to modify the BIOS attributes first to configure the HTTP boot client settings. The settings are similar to PXE settings with the addition of the “URI” setting, which specifies the location of the bootstrap program. The URI must use the HTTP protocol, and must specify the name of the bootstrap program (for example, http://mydomain.org/img/bootimage.efi).

NOTE: If the “URI” setting is blank, the system will try to obtain the URI from the DHCP server (Option 67 - Bootfile_Name for DHCPv4; Option 59 - Bootfile_Url for DHCPv6)

Then, you can configure the server to boot once using "UefiHttp".

  tasks:
  - name: set boot mode to UEFI
    dellemc.openmanage.idrac_bios:
      idrac_ip: "{{ inventory_hostname }}"
      idrac_user: "{{ user }}"
      idrac_password: "{{ new_password }}"
      validate_certs: false
      attributes:
        boot_mode: "UEFI"
    delegate_to: localhost

  - name: setup HTTP boot client
    dellemc.openmanage.idrac_bios:
      idrac_ip: "{{ inventory_hostname }}"
      idrac_user: "{{ user }}"
      idrac_password: "{{ new_password }}"
      validate_certs: false
      attributes:
        HttpDev1EnDis: "Enabled"
        HttpDev1Interface": "NIC.Mezzanine.1A-1-1" <== change this to the NIC FQDD that you want to use for HTTP client boot
        HttpDev1DhcpEnDis: "Enabled"
        HttpDev1DnsDhcpEnDis: "Enabled"
        HttpDev1Dns1: "{{ DNS server 1 - optional; needed if the URI is using domain name instead of IP address }}"
        HttpDev1Dns2: "{{ DNS server 2 - optional; needed if the URI is using domain name instead of IP address }}"
        HttpDev1Ip: "{{ static IP address - optional; only if using static IP }}"
        HttpDev1Gateway: "{{ gateway - optional; only if using static IP }}"
        HttpDev1Mask: "{{ subnet mask - optional; only if using static IP }}"
        HttpDev1Protocol: "IPv4"
        HttpDev1TlsMode: "None"
        HttpDev1Uri: "http://mydomain.org/img/bootimage.efi"
        HttpDev1VlanEnDis: "Disabled"
        HttpDev1VlanId: 1
        HttpDev1VlanPriority: 0
     delegate_to: localhost

  - name: set one-time boot using UefiBoot
    dellemc.openmanage.idrac_boot:
      idrac_ip: "{{ inventory_hostname }}"
      idrac_user: "{{ user }}"
      idrac_password: "{{ new_password }}"
      validate_certs: false
      boot_source_override_mode: UEFI
      boot_source_override_target: UefiHttp
      boot_source_override_enabled: once
    delegate_to: localhost

  - name: restart server to boot from UefiHttp
    dellemc.openmanage.redfish_powerstate:
      baseuri: "{{ inventory_hostname }}"
      username: "{{ user }}"
      password: "{{ new_password }}"
      validate_certs: false
      reset_type: GracefulRestart
    delegate_to: localhost
BilboTheGreedy commented 1 year ago

Thank you very much @anupamaloke, worked like a charm.