我正在尝试设置云执行模块,每次尝试使用“salt-cloud -p ec2_east_nano_prod saltcloud_nano_test”调出测试实例时,都会出错:
[DEBUG ] Reading configuration from /etc/salt/cloud
[DEBUG ] Reading configuration from /etc/salt/master
[DEBUG ] Missing configuration file: /etc/salt/cloud.providers
[DEBUG ] Including configuration from '/etc/salt/cloud.providers.d/abc.conf'
[DEBUG ] Reading configuration from /etc/salt/cloud.providers.d/abc.conf
[INFO ] There's at least one cloud driver under the '-east-2-public' cloud provider alias which does not have the required 'driver' setting. Removing it from the available providers listing.
[DEBUG ] Missing configuration file: /etc/salt/cloud.profiles
[DEBUG ] Including configuration from '/etc/salt/cloud.profiles.d/ec2_us_west-2.conf'
[DEBUG ] Reading configuration from /etc/salt/cloud.profiles.d/ec2_us_west-2.conf
[DEBUG ] Configuration file path: /etc/salt/cloud
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
[INFO ] salt-cloud starting
[DEBUG ] Could not LazyLoad parallels.avail_sizes: 'parallels' __virtual__ returned False
[DEBUG ] LazyLoaded parallels.avail_locations
[DEBUG ] LazyLoaded proxmox.avail_sizes
[DEBUG ] Could not LazyLoad saltify.destroy: 'saltify.destroy' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_sizes: 'saltify.avail_sizes' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_images: 'saltify.avail_images' is not available.
[DEBUG ] Could not LazyLoad saltify.avail_locations: 'saltify.avail_locations' is not available.
[DEBUG ] Could not LazyLoad rackspace.reboot: 'rackspace.reboot' is not available.
[DEBUG ] LazyLoaded openstack.list_locations
[DEBUG ] Could not LazyLoad rackspace.list_locations: 'rackspace.list_locations' is not available.
[ERROR ] Profile ec2 is not defined
[DEBUG ] LazyLoaded nested.output
Error:
Profile ec2 is not defined
设置
/etc/salt/cloud.profiles.d/ec2_us_west-2.conf
ec2:
provider: ec2-us-east-2-public
image: ami-41e7cb24
size: t2.micro
ssh_username: ubuntu
tag: {'Environment': 'production'}
sync_after_install: grains
minion:
master: 172.31.17.185
这是provider.d文件:
ec2-us-east-2-public:
minion:
master: master
id: '**********'
key: '******+******'
private_key: /etc/salt/***.pem
keyname: ***
ssh_interface: public_ips
securitygroup: default
location: us-west-2
availability_zone: us-west-2a
provider: ec2
del_root_vol_on_destroy: True
del_all_vols_on_destroy: True
rename_on_destroy: True
版本报告
Salt版本:
Salt: 2017.7.4
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: 2.4.2
docker-py: Not Installed
gitdb: 0.6.4
gitpython: 1.0.1
ioflo: Not Installed
Jinja2: 2.8
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: 1.0.3
msgpack-pure: Not Installed
msgpack-python: 0.4.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.12 (default, Dec 4 2017, 14:50:18)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 15.2.0
RAET: Not Installed
smmap: 0.9.0
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.1.4
System Versions:
dist: Ubuntu 16.04 xenial
locale: UTF-8
machine: x86_64
release: 4.4.0-1038-aws
system: Linux
version: Ubuntu 16.04 xenial
我不确定是否需要定义“provider:pillar ['cloud'] [etc]”。
答案 0 :(得分:1)
在provider.d
文件中,尝试使用“驱动程序”代替“提供者”,类似于salt-cloud quick start。
This page notes that this field was changed some years ago.
版本2015.8.0已更改。
云提供商定义中的提供程序参数已重命名为 驱动程序。进行此更改是为了避免与提供商混淆 云配置文件定义中使用的参数。云提供商 定义现在使用驱动程序来引用Salt云模块 提供连接到云主机的基础功能, 而云配置文件继续使用提供程序来引用提供程序 您定义的配置。