Skip to content

Commit

Permalink
Use Placement Group in Dryrun
Browse files Browse the repository at this point in the history
Signed-off-by: Sean Smith <seaam@amazon.com>
  • Loading branch information
sean-smith committed Aug 2, 2019
1 parent a391d89 commit f294fb5
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cli/pcluster/cfnconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def __init_vpc_parameters(self):
"VPC section [%s] used in [%s] section is not defined" % (vpc_section, self.__cluster_section)
)

def __check_account_capacity(self):
def __check_account_capacity(self): # noqa: C901
"""Try to launch the requested number of instances to verify Account limits."""
if self.parameters.get("Scheduler") == "awsbatch" or self.parameters.get("ClusterType", "ondemand") == "spot":
return
Expand All @@ -387,6 +387,9 @@ def __check_account_capacity(self):
MaxCount=max_size,
ImageId=test_ami_id,
SubnetId=subnet_id,
Placement={"GroupName": self.parameters.get("PlacementGroup")}
if self.parameters.get("PlacementGroup")
else {},
DryRun=True,
)
except ClientError as e:
Expand All @@ -410,6 +413,8 @@ def __check_account_capacity(self):
"The configured max size parameter {0} exceeds the number of free private IP addresses "
"available in the Compute subnet.\n{1}".format(max_size, message)
)
elif code == "InvalidParameterCombination":
self.__fail(message)
else:
self.__fail(
"Unable to check AWS Account limits. Please double check your cluster configuration.\n%s" % message
Expand Down

0 comments on commit f294fb5

Please sign in to comment.