From b31e5a0d90b415bbe0c96a3ef8bd2a54df66f6f2 Mon Sep 17 00:00:00 2001 From: Laurent Holtzer Date: Sun, 5 Nov 2023 22:47:03 +0100 Subject: [PATCH] Update ec2_utils.py to handle SpotInstance limits When having too many spot instance requests, the error code MaxSpotInstanceCountExceeded is returned. In such a case it then depends on behavior what will happen. --- tibanna/ec2_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tibanna/ec2_utils.py b/tibanna/ec2_utils.py index 494609d5..31847292 100755 --- a/tibanna/ec2_utils.py +++ b/tibanna/ec2_utils.py @@ -573,7 +573,7 @@ def launch_and_get_instance_id(self): self.delete_launch_template() raise Exception(f"Invalid fleet configuration. Result from create_fleet command: {json.dumps(fleet_result)}") - elif 'InsufficientInstanceCapacity' in error_codes or 'InstanceLimitExceeded' in error_codes or 'UnfulfillableCapacity' in error_codes: + elif 'InsufficientInstanceCapacity' in error_codes or 'InstanceLimitExceeded' in error_codes or 'UnfulfillableCapacity' in error_codes or 'MaxSpotInstanceCountExceeded'in error_codes: # We ignore the 'InvalidFleetConfiguration' error here behavior = self.cfg.behavior_on_capacity_limit if behavior == 'fail':