You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ec2.pychooses the first subnet from the specified (or default, if none specified) VPC, ignoring the availability_zone(AZ) parameter.
Some VMs are not supported on all AZs, so it is necessary to provide an AZ, but doing so may conflict with the subnet selected on the step described above.
Minimal Complete Verifiable Example:
At the time of writing m5.large instance is not supported on us-east-1e, and that is the subnet returned at index 0 when listing subnets from default VPC in my case.
To better reproduce we can force use of the AZ of second subnet, creating this code:
fromdask_cloudprovider.aws.ec2importEC2Clusterfromdask_cloudprovider.aws.helperimport (
get_default_vpc,
)
fromaiobotocore.sessionimportget_sessionimportbotocoreboto_config=botocore.config.Config(retries=dict(max_attempts=10))
region="us-east-1"asyncwithget_session().create_client("ec2", region_name=region, config=boto_config) asclient:
vpc=awaitget_default_vpc(client)
subnets= (awaitclient.describe_subnets())["Subnets"]
az=subnets[1]['AvailabilityZone'] # Code at `dask_cloudprovider.aws.ec2` gets subnet at [0], so this will force the issueEC2Cluster(
region="us-east-1",
availability_zone=az,
security=False, # Simply to avoid requiring criptography packagescheduler_instance_type="m5.large",
worker_instance_type="m5.large",
)
This outputs:
2024-06-09 14:46:30,639 - distributed.deploy.spec - WARNING - Cluster closed without starting up
And inspecting the stack we can see the following error:
[...]
ClientError: An error occurred (InvalidParameterValue) when calling the RunInstances operation: Value (us-east-1a) for parameter availabilityZone is invalid. Subnet '<REDACTED>' is in the availability zone us-east-1e
During handling of the above exception, another exception occurred:
[...]
Anything else we need to know?:
Changing dask_cloudprovider.aws.helper.get_vpc_subnets to receive and consider the AvailabilityZone should fix the issue. If this makes sense I could open a PR! :)
Describe the issue:
ec2.py
chooses the first subnet from the specified (or default, if none specified) VPC, ignoring theavailability_zone
(AZ) parameter.Some VMs are not supported on all AZs, so it is necessary to provide an AZ, but doing so may conflict with the subnet selected on the step described above.
Minimal Complete Verifiable Example:
At the time of writing
m5.large
instance is not supported onus-east-1e
, and that is the subnet returned at index 0 when listing subnets from default VPC in my case.To better reproduce we can force use of the AZ of second subnet, creating this code:
This outputs:
And inspecting the stack we can see the following error:
Anything else we need to know?:
Changing
dask_cloudprovider.aws.helper.get_vpc_subnets
to receive and consider the AvailabilityZone should fix the issue. If this makes sense I could open a PR! :)Environment:
The text was updated successfully, but these errors were encountered: