From 2709cb2c154c53e724ccac744768ef98a115d750 Mon Sep 17 00:00:00 2001 From: Giacomo Marciani Date: Wed, 3 Jun 2026 12:07:34 +0200 Subject: [PATCH 1/2] [Templates] In 1-click template to deploy external storage, make the parameter SubnetTwo optional to support the case where we need to deploy EFs mount targets in a single-AZ. --- cloudformation/storage/storage-stack.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cloudformation/storage/storage-stack.yaml b/cloudformation/storage/storage-stack.yaml index a3e12c4036..a3eb0630b2 100644 --- a/cloudformation/storage/storage-stack.yaml +++ b/cloudformation/storage/storage-stack.yaml @@ -71,7 +71,8 @@ Parameters: Default: '' SubnetTwo: Description: ID of the Subnet (second Availability Zone) where the storage will be deployed. - Type: AWS::EC2::Subnet::Id + # The type has to be String to allow empty values. + Type: String Default: '' SubnetThree: Description: ID of the Subnet (third Availability Zone) where the storage will be deployed. @@ -115,6 +116,9 @@ Parameters: Conditions: CreateEbs: !Equals [!Ref CreateEbs, 'true'] CreateEfs: !Equals [!Ref CreateEfs, 'true'] + CreateMountTargetResourceEfs0SubnetTwo: !And + - !Equals [!Ref CreateEfs, 'true'] + - !Not [!Equals [!Ref SubnetTwo, '']] CreateMountTargetResourceEfs0SubnetThree: !And - !Equals [!Ref CreateEfs, 'true'] - !Not [!Equals [!Ref SubnetThree, '']] @@ -157,7 +161,7 @@ Resources: SubnetId: !Ref SubnetOne MountTargetResourceEfs0SubnetTwo: Type: 'AWS::EFS::MountTarget' - Condition: CreateEfs + Condition: CreateMountTargetResourceEfs0SubnetTwo Properties: FileSystemId: !Ref EfsFileSystem SecurityGroups: From e98a66ff7fc27945e9e5bbdfe92078574de72ef4 Mon Sep 17 00:00:00 2001 From: Giacomo Marciani Date: Wed, 3 Jun 2026 12:10:09 +0200 Subject: [PATCH 2/2] [Test] Fix intermittent failure in test_dynamic_file_system_update by deploying EFS mount targets in the single AZ used by compute nodes. Before this fix, the test could fail when EFS mount targets were deployed in AZs different from those where the compute nodes were deployed. This fix forces the EFS mount targets to be created in the same AZ where the compute nodes are deployed. --- .../tests/update/test_update.py | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/tests/integration-tests/tests/update/test_update.py b/tests/integration-tests/tests/update/test_update.py index 96ba16723e..6eeab200e4 100644 --- a/tests/integration-tests/tests/update/test_update.py +++ b/tests/integration-tests/tests/update/test_update.py @@ -14,7 +14,6 @@ import os.path as os_path import re import time -from collections import defaultdict from datetime import datetime import boto3 @@ -1004,14 +1003,11 @@ def create_stack(vpc_stack, bucket_name, file_cache_path): if request.config.getoption(option): stack = CfnStack(name=request.config.getoption(option), region=region, template=None) else: - # Choose subnets from different availability zones - subnet_ids = vpc_stack.get_all_public_subnets() + vpc_stack.get_all_private_subnets() - subnets = boto3.client("ec2").describe_subnets(SubnetIds=subnet_ids)["Subnets"] - subnets_by_az = defaultdict(list) - for subnet in subnets: - subnets_by_az[subnet["AvailabilityZone"]].append(subnet["SubnetId"]) - azs = [az for az in subnets_by_az.keys()] - one_subnet_per_az = [subnets_by_az[az][0] for az in azs] + # Deploy the storage in the private subnet used by the cluster compute nodes. + # The head node, login nodes and compute nodes all live in the same Availability Zone, + # so a single EFS mount target in the compute node subnet covers every node in the cluster. + # The other single-AZ storage resources (FSx, File Cache, EBS) are co-located there as well. + compute_subnet_id = vpc_stack.get_private_subnet() # The EBS volume must be placed in the same AZ where the head node is. # The head node is deployed in the public subnet. @@ -1029,12 +1025,9 @@ def create_stack(vpc_stack, bucket_name, file_cache_path): params = [ # Networking {"ParameterKey": "Vpc", "ParameterValue": vpc}, - {"ParameterKey": "SubnetOne", "ParameterValue": one_subnet_per_az[0]}, - {"ParameterKey": "SubnetTwo", "ParameterValue": one_subnet_per_az[1]}, - { - "ParameterKey": "SubnetThree", - "ParameterValue": "" if len(one_subnet_per_az) == 2 else one_subnet_per_az[2], - }, + {"ParameterKey": "SubnetOne", "ParameterValue": compute_subnet_id}, + {"ParameterKey": "SubnetTwo", "ParameterValue": ""}, + {"ParameterKey": "SubnetThree", "ParameterValue": ""}, # EBS {"ParameterKey": "CreateEbs", "ParameterValue": "true"}, {"ParameterKey": "EbsVolumeAz", "ParameterValue": ebs_volume_az},