Hi folks,
I have a capacity reservation with 1 instance available for use:
$ aws ec2 describe-capacity-reservations --capacity-reservation-ids cr-00d78c6805551161a
{
"CapacityReservations": [
{
"CapacityReservationId": "cr-00d78c6805551161a",
...
"InstanceType": "c5n.9xlarge",
"InstancePlatform": "Linux/UNIX",
"AvailabilityZone": "us-east-1d",
...
"AvailableInstanceCount": 1,
...
}
I also have a stopped instance with matching instance type/platform/AZ assigned to this capacity:
$ aws ec2 describe-instances --instance-ids $myinstance
{
"Reservations": [
{
"Groups": [],
"Instances": [
{
"AmiLaunchIndex": 0,
"ImageId": "ami-6ed35e06",
"InstanceId": "i-2d1ff5cc",
"InstanceType": "c5n.9xlarge",
....
"Placement": {
"AvailabilityZone": "us-east-1d",
....
},
"CapacityReservationSpecification": {
"CapacityReservationTarget": {
"CapacityReservationId": "cr-00d78c6805551161a"
}
},
....
"PlatformDetails": "Linux/UNIX",
....
}
However I cannot start it:
$ aws ec2 start-instances --instance-ids $myinstance
An error occurred (InsufficientInstanceCapacity) when calling the StartInstances operation (reached max retries: 2): Insufficient capacity.
I must be confused as I would expect that the capacity reservation would be used.
Why does the instance fail to start?
I asked AWS support 2 days ago, but haven't made progress yet.
At the time you ran
describe-capacity-reservations
, was the reservation in theactive
state? See the possible states at https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/capacity-reservations-using.html#capacity-reservations-viewYes it is in the active state.
Meanwhile I have received an answer from AWS support: the EC2 belongs to a placement group, and the CapacityReservation is not applicable to placement groups unfortunately.