简体   繁体   中英

Why price of an instance type showing different from original AWS list?

I am query AWS pricing using boto ec2 in python. Firstly,I am finding all offering instances of particular instance type using get_all_reserved_instances_offerings , then for all instances return by above, I am checking amount and fixed price in 'hourly frequency'. I do this by this code:

for ins in each_ins.recurring_charges:
    if ins.frequency == 'Hourly':
        print float(ins.amount)
    print float(each_ins.fixed_price)

each_ins.fixed_price prints upfront correctly

"d2.2xlarge": 3844.0,

"m3.2xlarge": 1961.0,

it shows correct price as shown in picture with red mark:

在此处输入图片说明

But ins.amount prints:

"d2.2xlarge": 0.438,

"m3.2xlarge": 0.248, 

I think it should be 0.8768 as shown in above picture with green mark.

The values in the green box are the overall effective cost of the instances per hour over the year (ie accounting for the per hour charge over the year plus the initial up-front cost spread over the year.)

However the ins.amount value is the cost charged per hour each month, ignoring the initial up-front cost. Roughly calculating over a month from the monthly cost gives an hourly cost of ~ 0.444 , pretty much corresponding to the values you're seeing.

AWS says the following with respect to the continuing monthly charges:

*This is the average monthly payment over the course of the RI term. For each month, the actual monthly payment will equal the actual number of hours in that month multiplied by the hourly usage rate. The hourly usage rate is equivalent to the total average monthly payments over the term of the RI divided by the total number of hours (based on a 365 day year) over the term of the RI.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM