我想并行启动许多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命令,这也可以让您并行启动多个实例。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句