Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback instance type #569

Closed
Kostiantyn-Vorobiov opened this issue Feb 16, 2021 · 8 comments
Closed

Fallback instance type #569

Kostiantyn-Vorobiov opened this issue Feb 16, 2021 · 8 comments

Comments

@Kostiantyn-Vorobiov
Copy link

A feature request: The possibility to specify secondary instance type in case of "There is no Spot capacity available that matches your request", code: 'InsufficientInstanceCapacity' error.

I think we could have a fallback launch template with another instance type or overwrite InstanceType in the current launch template in case if AWS answers with 'InsufficientInstanceCapacity' error.

@MitkoTschimev
Copy link

Yes, we had the same issue and our idea was to do the same. Is someone already working on it?

@Kostiantyn-Vorobiov
Copy link
Author

Kostiantyn-Vorobiov commented Feb 22, 2021

Here is a WIP for this idea - Kostiantyn-Vorobiov#1 (haven't tested in the real environment)
Any thoughts? I'm not a TS guy @gertjanmaas, @npalm

@gertjanmaas
Copy link
Collaborator

Hi @Kostiantyn-Vorobiov.

I really like the idea. I don't think the implementation will work because we use EC2 Launch Templates. As far as I know the Launch Templates options and the instance type options do not mix in the runInstances call.

So instead of changing the instance type, we could create a second Launch Template in Terraform and change the launchTemplateName and launchTemplateVersion to the secondary template on a InsufficientInstanceCapacity error. See terraform code here:

resource "aws_launch_template" "runner" {

@npalm how does this sound to you?

@Kostiantyn-Vorobiov
Copy link
Author

Kostiantyn-Vorobiov commented Feb 23, 2021

According to the documentation -
"LaunchTemplate — (map) -
The launch template to use to launch the instances. Any parameters that you specify in RunInstances override the same parameters in the launch template."
So there is a chance that it could work in this way. But the second launch template could also work fine.

Also, there is a more robust solution with spot fleet requests. But that requires a lot of changes.

@npalm
Copy link
Member

npalm commented Feb 24, 2021

In that case overwriting should be the way forward

link to docs: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RunInstances.html

@npalm
Copy link
Member

npalm commented Feb 24, 2021

@Kostiantyn-Vorobiov feel free to open a draft (WIP) PR

@mcaulifn
Copy link
Contributor

This should be resolved by #898

@npalm
Copy link
Member

npalm commented Dec 2, 2021

Fallback is available

@npalm npalm closed this as completed Dec 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants