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

Open
1 task
pbdco opened this issue Dec 12, 2024 · 1 comment
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
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