我跟随salt-cloud AWS guide并且遇到一些错误消息,我认为不清楚。错误是:
$ sudo salt-cloud -p ubuntu_aws test-vm
[INFO ] salt-cloud starting
[INFO ] Creating Cloud VM test-vm in ap-southeast-1
[ERROR ] EC2 Response Status Code and Error: [400 400 Client Error: Bad Request] {'Errors': {'Error': {'Message': "The key pair 'testkey' does not exist", 'Code': 'InvalidKeyPair.NotFound'}}, 'RequestID': '******************************'}
[ERROR ] There was a profile error: 'str' object does not support item assignment
我已经了解到最后一部分是python错误,我认为可能会在我的配置中出现语法错误,但我无法发现任何问题。
ubuntu_aws config
ubuntu_aws:
provider: aws
image: ami-e2f1c1b0
size: Micro Instance
ssh_username: ec2-user
提供商配置
private_key: /path/to/testkey.pem
keyname: testkey
securitygroup: default
我还注意到有2个默认组,我都无法删除:
当我访问 https://console.aws.amazon.com/ec2/v2/home?region=us-east-1#KeyPairs:sort=keyName 时,我可以看到 us-east-1 上确实存在密钥。
我的 testkey.pem 键具有 -rw ------- 权限。
我还在学习使用 salt-cloud 和 AWS ,我很难确定它是否是我的问题AWS配置或我的Salt配置。任何指导都会有所帮助。
答案 0 :(得分:2)
您的配置正在尝试在新加坡ap-southeast-1
地区创建虚拟机。您的密钥存在于us-east-1
区域。
因此,您需要将密钥添加到新加坡地区,或者将您的虚拟机配置为在us-east-1
区域中创建。