Sal Cloud无法找到aws AMI

时间:2016-02-22 23:07:19

标签: amazon-web-services amazon-ec2 salt-stack salt-cloud

我正在使用Salt Cloud(aws作为提供者),我的个人资料文件是:

ec2-profile:
  provider: ec2-config
  image: ami-7e2da54e
  size: Micro Instance

我运行此测试:

sudo salt-cloud --profile=ec2-private test_minion -l debug

我遇到了这个错误:

[DEBUG   ] Using AWS endpoint: ec2.us-east-1.amazonaws.com
[DEBUG   ] AWS Request: https://ec2.us-east-1.amazonaws.com/?Action=RunInstances&ImageId=ami-7e2da54e&InstanceType=Micro%20Instance&KeyName=salt_cloud_key&MaxCount=1&MinCount=1&Version=2014-10-01
[INFO    ] Starting new HTTPS connection (1): ec2.us-east-1.amazonaws.com
[DEBUG   ] Setting read timeout to None
[DEBUG   ] "GET /?Action=RunInstances&ImageId=ami-7e2da54e&InstanceType=Micro%20Instance&KeyName=salt_cloud_key&MaxCount=1&MinCount=1&Version=2014-10-01 HTTP/1.1" 400 None
[DEBUG   ] AWS Response Status Code: 400
[ERROR   ] AWS Response Status Code and Error: [400 400 Client Error: Bad Request] {'Errors': {'Error': {'Message': "The image id '[ami-7e2da54e]' does not exist", 'Code': 'InvalidAMIID.NotFound'}}, 'RequestID': '6b8f2fb5-b24e-4438-8e45-c6b01dc08519'}
[ERROR   ] Error requesting instance: Errors
Error: There was a profile error: Failed to deploy VM

你有什么想法吗?

更新

我更改了图像AMI ID。 现在我有这个调试消息:

InvalidParameterValue

哪个(根据AWS文档):

An invalid or out-of-range value was supplied for the input parameter.

1 个答案:

答案 0 :(得分:1)

使用AWS CLI检查AMI是否对您所在的地区有效

aws ec2 describe-images --image-ids ami-XXXXXXX

对于salt-cloud profile.conf" size"参数,正确的AWS命名是"实例类型"。您可以检查AWS以获取正确的命名。 https://aws.amazon.com/ec2/instance-types/

或者您可以使用salt-cloud命令使用--list-sizes命令列出实例类型

salt-cloud --list-sizes <provider_name>
salt-cloud --list-sizes test_minion
p / s:不要将salt-cloud命名视为理所当然,开发人员似乎总是选择令人困惑的属性名称。记录命名地图以传递给下一个人是一个新的saltstack

是一个好主意