我想并行启动多台 EC2 机器。到目前为止,我一直在使用 boto 和 fabric,但串行执行需要很长时间才能一一启动和配置它们。任何替代解决方案/工具来做到这一点?
最佳答案
亚马逊命令行工具支持实例数量参数。
aws ec2 run-instances help
--count (string)
Number of instances to launch. If a single number is provided, it is
assumed to be the minimum to launch (defaults to 1). If a range is
provided in the form min:max then the first number is interpreted as
the minimum number of instances to launch and the second is inter-
preted as the maximum number of instances to launch.
如果您运行的是较旧的 CLI:
ec2-run-instances
-n, --instance-count MIN[-MAX]
The number of instances to attempt to launch. May be specified as a
single integer or as a range (min-max). This specifies the minimum
and maximum number of instances to attempt to launch. If a single
integer is specified min and max are both set to that value.
更新:根据 boto ec2 文档,您可以将 min_count 和 max_count 参数传递给 run_instances 命令,这也可以让您并行启动多个实例。
关于amazon-web-services - 并行启动多个 EC2 实例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20614655/