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-ha-update gets wrong instance-id #104

Open
mtb-xt opened this issue Oct 17, 2015 · 2 comments
Open

aws-ha-update gets wrong instance-id #104

mtb-xt opened this issue Oct 17, 2015 · 2 comments

Comments

@mtb-xt
Copy link

mtb-xt commented Oct 17, 2015

Hello.

For some reason the script adds an extra " sign and next commands are failing because of that:

[user@shinkiro aws-ha-release]$ ./aws-ha-release.sh -a prod_media_asg -r ap-southeast-2 -t 10 -i 400 
The list of Instances in Auto Scaling Group prod_media_asg that will be terminated is below:
i-670d77b9"
i-2fa11df0"
i-1da11dc2"
i-2e0278f0"
prod_media_asg has reached a desired-capacity of 5. aws-ha-release.sh can now remove an Instance from service.
Instance i-670d77b9" will now be deregistered from ELBs "prod-media-elb."

A client error (InvalidInstance) occurred when calling the DeregisterInstancesFromLoadBalancer operation: InvalidInstance found in [i-670d77b9"]. Invalid id: "i-670d77b9"" (Service: AmazonEC2; Status Code: 400; Error Code: InvalidInstanceID.Malformed; Request ID: 367c7041-5d0f-4c79-90bf-7a00f48761f0)
@anujbiyani
Copy link
Contributor

Can you show the output of the following command:

aws autoscaling describe-auto-scaling-groups --auto-scaling-group-name "prod_media_asg" --region ap-southeast-2

Also have you given the Ruby version a shot? It uses the aws sdk gem which is a bit more reliable than their CLI.

@mtb-xt
Copy link
Author

mtb-xt commented Nov 3, 2015

Yes, the Ruby version works fine, I use that at the moment.

The output of the command:

[user@shinkiro ansible]$ aws autoscaling describe-auto-scaling-groups --auto-scaling-group-name "prod_media_asg" --region ap-southeast-2
{
    "AutoScalingGroups": [
        {
            "AutoScalingGroupName": "prod_media_asg",
            "DefaultCooldown": 300,
            "LaunchConfigurationName": "terraform-xqwn7yggpbdn7d7apinpc523yi",
            "MinSize": 2,
            "Tags": [
                {
                    "ResourceId": "prod_media_asg",
                    "Key": "Name",
                    "Value": "prod_media_asg",
                    "PropagateAtLaunch": true,
                    "ResourceType": "auto-scaling-group"
                },
                {
                    "ResourceId": "prod_media_asg",
                    "Key": "env",
                    "Value": "prod",
                    "PropagateAtLaunch": true,
                    "ResourceType": "auto-scaling-group"
                },
                {
                    "ResourceId": "prod_media_asg",
                    "Key": "role",
                    "Value": "media",
                    "PropagateAtLaunch": true,
                    "ResourceType": "auto-scaling-group"
                }
            ],
            "VPCZoneIdentifier": "subnet-6503a800,subnet-e4fd2d93",
            "HealthCheckGracePeriod": 300,
            "HealthCheckType": "ELB",
            "MaxSize": 4,
            "AutoScalingGroupARN": "arn:aws:autoscaling:ap-southeast-2:648824010792:autoScalingGroup:e6339064-f0f7-4432-af78-4772f6884cee:autoScalingGroupName/prod_media_asg",
            "TerminationPolicies": [
                "OldestLaunchConfiguration"
            ],
            "DesiredCapacity": 4,
            "AvailabilityZones": [
                "ap-southeast-2b",
                "ap-southeast-2a"
            ],
            "SuspendedProcesses": [],
            "EnabledMetrics": [],
            "Instances": [
                {
                    "InstanceId": "i-0fa3ecd1",
                    "LifecycleState": "InService",
                    "LaunchConfigurationName": "terraform-xqwn7yggpbdn7d7apinpc523yi",
                    "HealthStatus": "Healthy",
                    "AvailabilityZone": "ap-southeast-2a"
                },
                {
                    "InstanceId": "i-09a3ecd7",
                    "LifecycleState": "InService",
                    "LaunchConfigurationName": "terraform-xqwn7yggpbdn7d7apinpc523yi",
                    "HealthStatus": "Healthy",
                    "AvailabilityZone": "ap-southeast-2a"
                },
                {
                    "InstanceId": "i-cc199a13",
                    "LifecycleState": "InService",
                    "LaunchConfigurationName": "terraform-xqwn7yggpbdn7d7apinpc523yi",
                    "HealthStatus": "Healthy",
                    "AvailabilityZone": "ap-southeast-2b"
                },
                {
                    "InstanceId": "i-d0189b0f",
                    "LifecycleState": "InService",
                    "LaunchConfigurationName": "terraform-xqwn7yggpbdn7d7apinpc523yi",
                    "HealthStatus": "Healthy",
                    "AvailabilityZone": "ap-southeast-2b"
                }
            ],
            "CreatedTime": "2015-10-16T13:29:49.339Z",
            "LoadBalancerNames": [
                "prod-media-elb"
            ]
        }
    ]
}

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

2 participants