mirror of
https://github.com/ubicloud/ubicloud.git
synced 2025-10-06 23:01:56 +08:00
Spot instance requests can sometimes fail with an “InsufficientInstanceCapacity” error. Best practice is to request multiple instance types to increase the chances of obtaining a spot instance. Unfortunately, create_instance in E2 does not support multiple instance types in a single request. One recommended solution is to create an EC2 fleet with multiple instance types and provision the spot instance from the fleet. However, since we don’t know the required instance count beforehand, this would require creating a separate fleet for each instance. Additionally, it creates divergence with PG on AWS service. Instead of creating a fleet, we can handle this by retrying the create_instance call with alternative instance types until we try all whenever an “InsufficientInstanceCapacity” error occurs. |
||
---|---|---|
.. | ||
instance.rb | ||
nic.rb | ||
vpc.rb |