diff --git a/discovery/roles/slurm_config/defaults/main.yml b/discovery/roles/slurm_config/defaults/main.yml index 6429271040..acfe61e401 100644 --- a/discovery/roles/slurm_config/defaults/main.yml +++ b/discovery/roles/slurm_config/defaults/main.yml @@ -1,4 +1,4 @@ -# Copyright 2025 Dell Inc. or its subsidiaries. All Rights Reserved. +# Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,7 +19,7 @@ slurmctld_service_default_path: '/usr/lib/systemd/system/slurmctld.service' slurmd_service_default_path: '/usr/lib/systemd/system/slurmd.service' slurmdbd_service_default_path: '/usr/lib/systemd/system/slurmdbd.service' sys_env_path: '/etc/environment' -default_real_memory: 4 # This is the minimum default memory in GiB +default_real_memory: 4096 # This is the minimum default memory in MiB default_threadspercore: 1 default_corespersocket: 1 share_prefix: "/" diff --git a/discovery/roles/slurm_config/tasks/read_node_idrac.yml b/discovery/roles/slurm_config/tasks/read_node_idrac.yml index 5b8b29f571..8955bc8a03 100644 --- a/discovery/roles/slurm_config/tasks/read_node_idrac.yml +++ b/discovery/roles/slurm_config/tasks/read_node_idrac.yml @@ -1,4 +1,4 @@ -# Copyright 2025 Dell Inc. or its subsidiaries. All Rights Reserved. +# Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -44,7 +44,7 @@ - name: Read Memory NodeParams ansible.builtin.uri: - url: "https://{{ bmc_ip_map[item] }}/redfish/v1/Systems/System.Embedded.1" + url: "https://{{ bmc_ip_map[item] }}/redfish/v1/Systems/System.Embedded.1/Memory?$expand=*($levels=1)" user: "{{ bmc_username }}" password: "{{ bmc_password }}" method: GET @@ -62,13 +62,15 @@ register: mem_info failed_when: false -- name: Calculate total memory in MB (GiB → MB) +- name: Calculate total memory sum of slots ansible.builtin.set_fact: - total_memory_mb: "{{ (mem_info.json.MemorySummary.TotalSystemMemoryGiB | default(default_real_memory)) * 1024 | int }}" + total_memory_mb: "{{ mem_info.json.Members | default([{'CapacityMiB': default_real_memory}]) + | map(attribute='CapacityMiB', default=default_real_memory) + | map('int', default=default_real_memory) | sum | int }}" -- name: Calculate 90% of real memory +- name: Calculate percentage of real memory ansible.builtin.set_fact: - real_memory: "{{ ((total_memory_mb | float) * 0.90) | int }}" + real_memory: "{{ ((total_memory_mb | int) * (memory_percentage / 100)) | int | round }}" - name: Calculate proc facts ansible.builtin.set_fact: diff --git a/discovery/roles/slurm_config/vars/main.yml b/discovery/roles/slurm_config/vars/main.yml index 2c93ad32cb..a4a9342439 100644 --- a/discovery/roles/slurm_config/vars/main.yml +++ b/discovery/roles/slurm_config/vars/main.yml @@ -1,4 +1,4 @@ -# Copyright 2025 Dell Inc. or its subsidiaries. All Rights Reserved. +# Copyright 2026 Dell Inc. or its subsidiaries. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -103,3 +103,4 @@ auth_tls_certs_path: "/opt/omnia/auth/tls_certs/ldapserver.crt" slurm_installation_type: configless pulp_webserver_cert_path: "/opt/omnia/pulp/settings/certs/pulp_webserver.crt" controller_empty_msg: "Slurm controller functional group is missing from PXE mapping file. Please update the file and rerun discovery.yml." +memory_percentage: 90