我根据instance_type
计算保留实例的总数,并通过instance_type
作为键将其存储在字典中。在
首先,我通过get_all_reserved_instances()
查找我的所有保留实例,然后对于由此返回的每个实例,我执行以下操作:
if each.state != 'retired':
key = str(each.instance_type)
res_count[key]+=each.instance_count
我还根据instance_type
计算实例总数。首先,我通过get_all_instances()
查找我的所有实例,然后针对每个instance_type
我执行以下操作:
现在对于一个实例类型,它返回:
all_count = 17
res_count = 19
怎么可能res_count
大于all_count
?
res_count
可以等于all_count
,如果没有ondemand
实例,但是为什么它大于all_count
?在
使用状态有什么错误吗?还是另有原因?在
这看起来很可疑:
如果reserve_实例是正确的,我们将改变方法 计算出总的\u计数
^{pr2}$相关问题 更多 >
编程相关推荐