- Pip install Boto3 - Thu, Mar 24 2022
- Install Boto3 (AWS SDK for Python) in Visual Studio Code (VS Code) on Windows - Wed, Feb 23 2022
- Automatically mount an NVMe EBS volume in an EC2 Linux instance using fstab - Mon, Feb 21 2022
Determine whether Reserved Instance is used
I have been buying EC2 Reserved Instances for many years, and I never had an issue until recently, when I noticed that On Demand rates were applied to an instance for which I purchased a Reserved Instance.
When I opened the Bills section in my account, I could see that an hourly rate was applied for the corresponding instance type. I chose All Upfront as the payment option, which means that no additional hourly charges should occur. But my new Reserved Instance did not appear in the Reserved Instances section.
I then checked the AWS Cost Explorer, where I confirmed that I was indeed charged an hourly rate for the running the instance.
As this never happened before, my first guess was that I purchased the wrong instance type or perhaps selected the wrong AWS region. If the instance features don't match, the Reserved Instance is not applied.
Determine whether Reserved Instance properties match
Unfortunately, no instance property exists that can indicate whether a running instance is On Demand or Reserved. Surprisingly, there is not even a Reserved Instance property that contains information about the instance to which it is currently applied.
Thus, the only way to determine whether a Reserved Instance is applied correctly is to check whether the relevant properties match. The first thing to do is navigate to Reserved Instances in the AWS Management Console and check the instance type, Scope, Region or Availability Zone, and State (Active or Retired). Alternatively, you can also use the AWS CLI:
aws ec2 describe-reserved-instances --filters Name=state,Values=active
The command above lists only active Reserved Instances. The scope in this example is Region, which means that my instance can be running in any Availability Zone in this Region. As you can see in the above screenshot, not even the region for which you purchased the instance is listed. Thus, you have to know to which Availability Zone you are connected. In the AWS CLI, you do this with this command:
aws configure get region
In the AWS Management Console, you can see in the menu bar to which Availability Zone you are connected.
Note that only Reserved Instances that you purchased for the connected Availability Zone are displayed.
Next, you have to check whether your instance matches these properties, that is, whether the instance types and the Availability Zone are identical.
In the AWS Management Console, navigate to Instances, and in the AWS CLI, use the following command to display your running instances:
aws ec2 describe-instances --filters Name=instance-state-name,Values=running
View the Reserve Utilization report
If the instance properties match those of the Reserved Instance, the last thing you can do is check the Reserve Utilization report, which you can find on the Cost Management page.
Let's say you have one Reserved Instance, Reservation Utilization should be 100% if AWS has everything applied correctly.
Contact AWS account and billing support
If you have double-checked everything, and you are still certain that your Reserved Instance is not used, you should contact AWS account and billing support. Note that you don't require an AWS Support Plan. Of course, if you have billing issues, you can contact Amazon at any time.
For the type, select Billing, and for the Category, select Reserved Instance. At the bottom of the page, you can then choose to send an email or chat with a representative. I selected the latter option, and I was immediately connected to Amazon Support. After I told him the instance type, he needed less than a minute to verify that the Reserved Instance was indeed not applied. He promised to contact the Reserve Instance team and get back to me via email once he knew more.
The next day, I received an email informing me that it takes from 24 to 48 hours for Reserved Instances to be activated. To be honest, I was a bit surprised that an automated procedure can take two days, and I don't remember that this ever happened before when I purchased a Reserved Instance.
I was wondering if I had to pay the On Demand rates during this time, but when I then checked my AWS Service Charges, the On Demand costs from the last day were removed. In the AWS Cost Explorer, the On Demand fees were gone as well.
Subscribe to 4sysops newsletter!
It is hard to tell whether someone from the Reserve Instance team corrected my bill or if this happens automatically once the Reserved Instance is active. In any case, I recommend keeping an eye on your AWS bill.