salt-projectsalt-cloud

Problem configuring GCE provider (Salt-Cloud)


I'm having an issue with configuring GCE provider for salt-cloud, I always get this error:

root@bastion-01:~# salt-cloud --list-providers
[WARNING ] The cloud driver, 'gce', configured under the 'my-gce-config' cloud provider alias, could not be loaded. Please check your provider configuration files and ensure all required dependencies are installed for the 'gce' driver.
In rare cases, this could indicate the 'gce.get_configured_provider()' function could not be found.
Removing 'gce' from the available providers list
Error: There was an error listing providers: There are no cloud providers configured.

Tracing the problem shows this erorr:

[TRACE   ] Error loading clouds.gce: apache-libcloud is not installed

While It's installed on the system

root@bastion-01:~# salt --versions-report
Salt Version:
          Salt: 3006.10

Python Version:
        Python: 3.10.16 (main, Mar  6 2025, 02:23:15) [GCC 11.2.0]

Dependency Versions:
          cffi: 1.14.6
      cherrypy: unknown
  cryptography: 42.0.5
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.6
       libgit2: Not Installed
  looseversion: 1.0.2
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 22.0
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.19.1
        pygit2: Not Installed
  python-gnupg: 0.4.8
        PyYAML: 6.0.1
         PyZMQ: 23.2.0
        relenv: 0.18.1
         smmap: Not Installed
       timelib: 0.2.4
       Tornado: 4.5.3
           ZMQ: 4.3.4

System Versions:
          dist: ubuntu 20.04.6 focal
        locale: utf-8
       machine: x86_64
       release: 5.15.0-1078-gcp
        system: Linux
       version: Ubuntu 20.04.6 focal

root@bastion-01:~# pip3.10 list | grep libcloud
apache-libcloud          2.8.0

Not sure what I'm missing here, and I appreciate any advice.


Solution

  • Dependencies must be installed into Salt's environment, which since 3006 is by default not the system Python.

    Use salt-pip to manage Salt's dependencies. In this case, salt-pip install apache-libcloud.