1

我正在尝试设置云执行模块,每次尝试使用“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: 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]”。

4

1 回答 1

1

在您的provider.d文件中,尝试使用“driver”而不是“provider”,类似于salt-cloud quick start

此页面指出,该字段几年前已更改。

在 2015.8.0 版中更改。

云提供商定义中的 provider 参数已重命名为 driver。进行此更改是为了避免与云配置文件定义中使用的提供程序参数混淆。云提供者定义现在使用驱动程序来指代提供连接到云主机的底层功能的 Salt 云模块,而云配置文件继续使用提供者来指代您定义的提供者配置。

于 2018-03-28T21:53:58.647 回答