跳至內容

How do I troubleshoot issues with my Amazon EC2 On-Demand Capacity Reservation?

4 分的閱讀內容
0

I use On-Demand Capacity Reservations for my Amazon Elastic Compute Cloud (Amazon EC2) instances. However, my Amazon EC2 instances don't use the reserved capacity.

Resolution

Note: If you receive errors when you run AWS Command Line Interface (AWS CLI) commands, then see Troubleshooting errors for the AWS CLI. Also, make sure that you're using the most recent AWS CLI version.

Check your Capacity Reservation configuration

Check your Capacity Reservation settings

Prerequisites: Your Capacity Reservation must adhere to the following requirements:

  • The Capacity Reservation is Active.
  • The Capacity Reservation uses the same instance type as your EC2 instance.
  • The Capacity Reservation is in the same Availability Zone as your instance.
  • The Capacity Reservation Utilization is below 100%.

To check your Capacity Reservation settings, open the Amazon EC2 console, and then choose Capacity Reservations. If your Capacity Reservation doesn't adhere to the preceding requirements, then cancel the Capacity Reservation. Then, create a new Capacity Reservation with the correct settings. You can't modify an existing Capacity Reservation.

Check whether you set the Capacity Reservation to open

Run the following describe-instances AWS CLI command to check the instance's Capacity Reservation settings:

aws ec2 describe-instances --filters --instance-ids instance-id

Note: Replace instance-id with the ID of the instance that uses the Capacity Reservation.

In the output, make sure that CapacityReservationSpecification is set to Open. If CapacityReservationSpecification is set to None, then you must update your Capacity Reservation settings to allow the instance to use the Capacity Reservation.

Example output:

"CapacityReservationSpecification": {
  "CapacityReservationPreference": "open",
  "CapacityReservationTarget": null
}

Configure your instance for a stop and start

Note: When you stop and start an instance, the instance's public IP address changes. It's a best practice to use an Elastic IP address to route external traffic to your instance instead of a public IP address. If you use Amazon Route 53, then you might need to update the Route 53 DNS records when the public IP address changes.

Before you stop and start your instance, take the following actions:

Set your Capacity Reservation to open

Complete the following steps:

  1. Stop the instance.
  2. Select the instance, and then choose Actions.
  3. Select Instance settings, and then choose Modify Capacity Reservation settings.
  4. For Capacity Reservation setting, choose Open.
  5. Choose Save.
  6. Start the instance.
  7. Run the following describe-instances command to validate that CapacityReservationSpecification is set to open:
    aws ec2 describe-instances --filters --instance-ids instance-id
    Note: Replace instance-id with the instance ID.

Related information

How do I request a vCPU service quota increase for my EC2 On-Demand Instance?

How do I troubleshoot InsufficientInstanceCapacity errors when I start or launch an EC2 instance?

How do I troubleshoot the ReservationCapacityExceeded error that I receive when I launch or start an Amazon EC2 instance?

AWS 官方已更新 6 個月前