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

Request for Addition of API to Adjust Spot Instance Limit #4133

Closed
2 tasks
rawhuul opened this issue May 17, 2024 · 2 comments
Closed
2 tasks

Request for Addition of API to Adjust Spot Instance Limit #4133

rawhuul opened this issue May 17, 2024 · 2 comments
Assignees
Labels
feature-request This issue requests a feature.

Comments

@rawhuul
Copy link

rawhuul commented May 17, 2024

Describe the feature

I encountered an issue while working with spot instances. Upon attempting to request spot instances, I received the following error message:

An error occurred (MaxSpotInstanceCountExceeded) when calling the RequestSpotInstances operation: Max spot instance count exceeded

After some investigation, it appears that there isn't currently an API available to modify this limit. Consequently, I'm unable to adjust the spot instance limit to accommodate my needs.

Is it be possible to add API or providing a mechanism to adjust the spot instance limit?

Use Case

To adjust spot instance limit

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

SDK version used

1.24.70

Environment details (OS name and version, etc.)

20.04.1-Ubuntu (Kernel: 5.15.0-1047-aws)

@rawhuul rawhuul added feature-request This issue requests a feature. needs-triage This issue or PR still needs to be triaged. labels May 17, 2024
@tim-finnigan tim-finnigan self-assigned this May 17, 2024
@tim-finnigan tim-finnigan added the investigating This issue is being investigated and/or work is in progress to resolve the issue. label May 17, 2024
@tim-finnigan
Copy link
Contributor

Thanks for the feature request. As noted here:

The service quota for spot instances is limited by the number of vCPUs, not the number of instances.

The number of vCPUs for each instance type can be found here: https://aws.amazon.com/ec2/instance-types/?nc1=h_ls. And you can find documentation on requesting quota increases here: https://docs.aws.amazon.com/servicequotas/latest/userguide/request-quota-increase.html

It looks like you can do this programmatically via the request_service_quota_increase command. For example:

import boto3

# Create a Service Quotas client
service_quotas = boto3.client('service-quotas')

# Request an increase in the Spot Instance limit
response = service_quotas.request_service_quota_increase(
    ServiceCode='ec2',
    QuotaCode='L-1216C47A',
    DesiredValue=1000,  # Set the desired value for the new limit
)

# Check the response
print(response)

For any requests involving service APIs please create a new issue in our cross-SDK repository and we can bring those up to the appropriate team.

I also noticed you're using version 1.24.70 which is very old. The latest version of Boto3 per the CHANGELOG is 1.34.107. Please consider updating your version of Boto3 for access to the latest updates/fixes.

@tim-finnigan tim-finnigan removed investigating This issue is being investigated and/or work is in progress to resolve the issue. needs-triage This issue or PR still needs to be triaged. labels May 17, 2024
Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request This issue requests a feature.
Projects
None yet
Development

No branches or pull requests

2 participants