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

aws autoscaling & ASG Console: Inconsistent Handling of Decimal Places in Spot Instance Prices #9133

Closed
1 task
pbdco opened this issue Dec 12, 2024 · 3 comments
Assignees
Labels
autoscaling bug This issue is a bug. p2 This is a standard priority issue service-api This issue is due to a problem in a service API, not the SDK implementation.

Comments

@pbdco
Copy link

pbdco commented Dec 12, 2024

Describe the bug

An attempt to launch a new EC2 spot instance from launch template fails when the spot instance price is formatted with three decimal places followed by zeros (e.g., "0.000700"). However, the price format with three significant digits followed by zeros (e.g., "0.007000") is accepted without issues. This inconsistency in decimal place validation is causing confusion and preventing successful instance launches.
During launch template creation, there are no errors or warnings related to this.

Regression Issue

  • Select this option if this issue appears to be a regression.

Expected Behavior

The EC2 spot instance should launch successfully regardless of the decimal place format, as long as the numerical value is valid.
If value is not considered correct, it should give a warning/error message.

Current Behavior

The EC2 launch process from an auto scaling group fails when the price is formatted with three decimal places followed by zeros (e.g., "0.000700"), but succeeds when formatted with three significant digits followed by zeros (e.g., "0.007000").

aws autoscaling describe-scaling-activities --auto-scaling-group-name "spot-t3-nano-asg" --region=ap-south-1
{
    "Activities": [
        {
            "ActivityId": "6ae64ee1-d80e-4e0a-bbd3-e5bc7c522af6",
            "AutoScalingGroupName": "spot-t3-nano-asg",
            "Description": "Launching a new EC2 instance.  Status Reason: Value (0.000700) for parameter price is invalid. \"0.000700\" is an invalid spot instance price. Launching EC2 instance failed.",
            "Cause": "At 2024-12-12T01:22:40Z an instance was started in response to a difference between desired and actual capacity, increasing the capacity from 0 to 1.",
            "StartTime": "2024-12-12T01:22:42.195000+00:00",
            "EndTime": "2024-12-12T01:22:42+00:00",
            "StatusCode": "Failed",
            "StatusMessage": "Value (0.000700) for parameter price is invalid. \"0.000700\" is an invalid spot instance price. Launching EC2 instance failed.",
            "Progress": 100,
            "Details": "{\"Subnet ID\":\"subnet-059e739f688exxxxx\",\"Availability Zone\":\"ap-south-1a\"}",
            "AutoScalingGroupARN": "arn:aws:autoscaling:ap-south-1:559050245391:autoScalingGroup:ac27ab00-3fa7-4d0f-a12b-9753a85xxxxx:autoScalingGroupName/spot-t3-nano-asg"
        }

Reproduction Steps

Create a launch template. Specify the spot instance with max price as "0.000100".
Scale desired or max capacity in the auto scaling group to attempt to launch a new EC2 spot instance.
Observe the failure message indicating that the price is invalid with aws autoscaling describe-scaling-activities or from console > ec2> auto scaling groups > select group > acivities.

To make it work:
Change the spot instance max price to "0.001000" from the launch template.
Update ASG.
Observe that the instance launches successfully from ASG.

Possible Solution

Not a CLI issue but AWS api

Additional Information/Context

No response

CLI version used

aws-cli/2.22.8 Python/3.12.6 Darwin/21.6.0 exe/x86_64

Environment details (OS name and version, etc.)

M1 - ProductName: macOS ProductVersion: 12.7.4 BuildVersion: 21H1123

@pbdco pbdco added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Dec 12, 2024
@tim-finnigan tim-finnigan self-assigned this Dec 17, 2024
@tim-finnigan
Copy link
Contributor

Thanks for reaching out. As you mentioned this is an issue with the AWS service API rather than the CLI directly. I'll try following up with the AutoScaling team for further review. Also linking related re:Post post.

@tim-finnigan tim-finnigan added service-api This issue is due to a problem in a service API, not the SDK implementation. autoscaling p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Dec 17, 2024
@tim-finnigan
Copy link
Contributor

Thanks for your patience. We heard back from the service team who noted the following:

EC2 Spot has identified a limitation on using the maxPrice parameter where users can't submit values lower than $0.001 per instance hour. While this limitation isn't new, we acknowledge that it wasn't previously documented. We're currently updating our documentation to include this information. Additionally, we want to inform you that we're working on expanding the range of accepted values to cover amounts lower than $0.001 in the future. However, we strongly recommend that you do not use the maxPrice parameter when requesting Spot instances. When using Spot, you only pay the price that's in effect at the time your instance runs, regardless of the maxPrice you set. Using maxPrice doesn't save you money; instead, it can limit your access to available capacity and potentially increase the frequency of interruptions to your workloads.
We apologize for any inconvenience this limitation and lack of documentation may have caused.

@tim-finnigan tim-finnigan closed this as not planned Won't fix, can't repro, duplicate, stale Jan 21, 2025
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
autoscaling bug This issue is a bug. p2 This is a standard priority issue service-api This issue is due to a problem in a service API, not the SDK implementation.
Projects
None yet
Development

No branches or pull requests

2 participants