簡體   English   中英

為什么實例類型的價格顯示與原始AWS列表不同?

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

我在python中使用boto ec2查詢AWS定價。 首先,我使用get_all_reserved_instances_offerings查找所有具有特定實例類型的提供實例,然后對於所有按上述價格返回的實例,我將檢查“小時頻率”中的金額和固定價格。 我通過以下代碼執行此操作:

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正確地each_ins.fixed_price打印

"d2.2xlarge": 3844.0,

"m3.2xlarge": 1961.0,

它顯示正確的價格,如帶有紅色標記的圖片所示:

在此處輸入圖片說明

但是ins.amount打印:

"d2.2xlarge": 0.438,

"m3.2xlarge": 0.248, 

我認為應該是上圖中帶有綠色標記的0.8768

綠色框中的值是一年中每小時實例的總體有效成本(即,占一年中每小時的費用加上一年中初始的前期成本)。

但是, ins.amount值是每月每小時收取的費用,而忽略了初始的前期費用。 從每月費用中大致算出一個月的時間,得出的每小時費用約為0.444 ,幾乎與您看到的值相對應。

AWS對於持續的每月費用說以下幾點:

*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.

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM