ec2 API如何确定哪个可用区? [英] How does the ec2 API decide which availability zone?
问题描述
我正在编写一项服务,该服务可以按需以编程方式启动EC2实例.我想给它最大的机会,它可以随时启动实例,最大程度地减少由于容量不足而导致的失败.实例在一个区域内运行在哪个可用区域无关紧要,只是我有最大的机会启动一个.
I'm writing a service which programmatically starts EC2 instances on demand. I want to give it the best chance of being able to start an instance at any time, minimizing fails due to lack of capacity. It doesn't matter what availability zone the instances run in within a region, just that I have the best chance of starting one.
我想知道,如果在使用api的runInstances方法时不指定放置对象,会不会:
I'm wondering, if I don't specify a placement object when using the runInstances method of the api, will it:
A)在任何具有可用容量的可用区中运行我的新实例
A) Run my new instances in any availability zone which has the capacity available
B)随机选择一个可用区域,如果那里没有可用容量,则失败
B) Randomly pick an availability zone and fail if there isn't any spare capacity there
C)还有其他东西
我的研究表明人们相信它是A)或B),但我无法从aws中找到明确的答案.
My research shows people believing it's A) or B) but I can't find a definitive answer from aws.
如果是A)我想我可以打个电话,然后让aws弄清楚我是否可以拥有该实例.如果是B),我想我应该通过可用区并继续尝试所有方法,直到找到有可用容量的容器为止.
If it's A) I guess I can make one call and leave it to aws to figure out if I can have the instance. If it's B) I guess I should pass in the availability zone and keep trying them all until I find one with spare capacity.
谢谢.