Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,11 @@
"not a directory.")
PXE_MAPPING_FILE_EXT_FAIL_MSG = ("File path is invalid. Please ensure that the file ends with "
".csv extension")
PXE_MAPPING_AARCH64_LOCAL_PATH_MSG = ("aarch64 nodes are present in pxe_mapping_file.csv but "
"local share path selected for omnia core container deployment. "
"aarch64 nodes require NFS share path. "
"Please redeploy omnia core container with NFS share path option or remove aarch64 nodes "
"from pxe_mapping_file.csv.")
CLUSTER_OS_FAIL_MSG = "Cluster OS must be 'rhel' for RHEL Omnia Infrastructure Manager"

# local_repo.yml
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,60 @@ def validate_admin_ips_against_network_spec(pxe_mapping_file_path, network_spec_

return errors

def validate_aarch64_local_path_compatibility(pxe_mapping_file_path):
"""
Validates that aarch64 nodes are not present when using local share path.

Args:
pxe_mapping_file_path (str): Path to the PXE mapping file.

Raises:
ValueError: If aarch64 nodes are found with local share path configuration.
"""
# Check metadata file for omnia_share_option
metadata_path = "/opt/omnia/.data/oim_metadata.yml"

# Default to Local if metadata doesn't exist or omnia_Share_option is not set
share_option = "Local"

if os.path.isfile(metadata_path):
try:
with open(metadata_path, "r", encoding="utf-8") as f:
metadata = yaml.safe_load(f) or {}

# Check omnia_share_option in metadata
share_option = metadata.get("omnia_share_option", "Local")
except Exception:
# If there's an error reading metadata, assume Local
pass

# If share option is NFS, no need to check further
if share_option.lower() == "nfs":
return

# Check for aarch64 nodes in PXE mapping file
with open(pxe_mapping_file_path, "r", encoding="utf-8") as fh:
raw_lines = fh.readlines()

non_comment_lines = [ln for ln in raw_lines if ln.strip()]
reader = csv.DictReader(non_comment_lines)

fieldname_map = {fn.strip().upper(): fn for fn in reader.fieldnames}
fg_col = fieldname_map.get("FUNCTIONAL_GROUP_NAME")

if not fg_col:
return

aarch64_found = False
for row in reader:
fg_name = row.get(fg_col, "").strip() if row.get(fg_col) else ""
if fg_name and "aarch64" in fg_name.lower():
aarch64_found = True
break

if aarch64_found:
raise ValueError(en_us_validation_msg.PXE_MAPPING_AARCH64_LOCAL_PATH_MSG)

def validate_provision_config(
input_file_path, data, logger, module, omnia_base_dir, module_utils_base, project_name
):
Expand Down Expand Up @@ -811,6 +865,7 @@ def validate_provision_config(
validate_functional_groups_separation(pxe_mapping_file_path)
validate_parent_service_tag_hierarchy(pxe_mapping_file_path)
validate_slurm_login_compiler_prefix(pxe_mapping_file_path)
validate_aarch64_local_path_compatibility(pxe_mapping_file_path)

# Validate ADMIN_IPs against network_spec.yml ranges
network_spec_path = create_file_path(input_file_path, file_names["network_spec"])
Expand Down Expand Up @@ -1112,4 +1167,3 @@ def _validate_ip_ranges(dynamic_range, network_type, netmask_bits):
)

return errors

Loading