-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use Azure ARM cloud provider with salt cloud on salt 3002 #59264
Comments
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. |
Looks like the azure cloud driver needs some love. |
Hoping someone can pick this up. We are currently using Saltstack to manage virtual machines on all of our internal platforms and now want to extend this to Azure. |
@martinhacker1965 this is probably breaking here: https://github.com/saltstack/salt/blob/master/salt/cloud/clouds/azurearm.py#L129 MS has significantly changed their APIs (and SDKs) since late 2017 / early 2018 when this was written. I seem to recall that the storage SDK changed enough that this import won't even work. Try installing these older SDK versions and see if that helps: Additionally, you might want to check out https://github.com/eitrtechnologies/idem-azurerm It's the "next gen" Azure provider. Not fully integrated w/ Salt, but might be useful for some workflows. Hit me on the community Slack if you need help with any of that. |
The Azure functionality in Salt is moving to https://github.com/salt-extensions/saltext-azurerm Please try out the extension and open an issue there if you are still encountering problems. |
Description of Issue
Attempting to perform a POC for provisioning Azure virtual machines using the salt cloud azurearm driver from a salt master also running in Azure. Master is running on Ubuntu 20_04-lts. See Setup section for inital bootstrap configuration.
Referred to https://docs.saltstack.com/en/latest/topics/cloud/azurearm.html to check dependencies. These refer to sdk libraries that are now deprecated such as azure and azure-storage - see https://pypi.org/project/azure/ where the following is stated:
Please install the service specific packages prefixed by azure needed for your application.
The same dependencies are also listed in /usr/lib/python3/dist-packages/salt/cloud/clouds/azurearm.py
Following guidance on using azure python sdk libraries at https://docs.microsoft.com/en-gb/python/api/overview/azure/virtualmachines?view=azure-python-preview I decided to install a few libraries which might be required to create an Azure VM then began testing.
Setup
#salt-master.sh
Steps to Reproduce Issue
Created a new service principal in destination subscription.
Created /etc/salt/cloud.providers.d/azurearm.conf with the following contents
Got following output:
[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/azurearm.conf'
[DEBUG ] Reading configuration from /etc/salt/cloud.providers.d/azurearm.conf
[DEBUG ] Missing configuration file: /etc/salt/cloud.profiles
[DEBUG ] Including configuration from '/etc/salt/cloud.profiles.d/azurearm.conf'
[DEBUG ] Reading configuration from /etc/salt/cloud.profiles.d/azurearm.conf
[DEBUG ] Configuration file path: /etc/salt/cloud
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
[INFO ] salt-cloud starting
[WARNING ] Missing dependency: 'azurearm'. The azurearm driver requires 'azurearm' to be installed.
[DEBUG ] Marking 'base64_encode' as a jinja filter
[DEBUG ] Marking 'base64_decode' as a jinja filter
[DEBUG ] Marking 'md5' as a jinja filter
[DEBUG ] Marking 'sha1' as a jinja filter
[DEBUG ] Marking 'sha256' as a jinja filter
[DEBUG ] Marking 'sha512' as a jinja filter
[DEBUG ] Marking 'hmac' as a jinja filter
[DEBUG ] Marking 'hmac_compute' as a jinja filter
[DEBUG ] Marking 'random_hash' as a jinja filter
[DEBUG ] Marking 'rand_str' as a jinja filter
[DEBUG ] Marking 'file_hashsum' as a jinja filter
[DEBUG ] Marking 'http_query' as a jinja filter
[DEBUG ] Marking 'strftime' as a jinja filter
[DEBUG ] Marking 'date_format' as a jinja filter
[DEBUG ] Marking 'raise' as a jinja global
[DEBUG ] Marking 'match' as a jinja test
[DEBUG ] Marking 'equalto' as a jinja test
[DEBUG ] Marking 'skip' as a jinja filter
[DEBUG ] Marking 'sequence' as a jinja filter
[DEBUG ] Marking 'to_bool' as a jinja filter
[DEBUG ] Marking 'indent' as a jinja filter
[DEBUG ] Marking 'tojson' as a jinja filter
[DEBUG ] Marking 'quote' as a jinja filter
[DEBUG ] Marking 'regex_escape' as a jinja filter
[DEBUG ] Marking 'regex_search' as a jinja filter
[DEBUG ] Marking 'regex_match' as a jinja filter
[DEBUG ] Marking 'regex_replace' as a jinja filter
[DEBUG ] Marking 'uuid' as a jinja filter
[DEBUG ] Marking 'unique' as a jinja filter
[DEBUG ] Marking 'min' as a jinja filter
[DEBUG ] Marking 'max' as a jinja filter
[DEBUG ] Marking 'avg' as a jinja filter
[DEBUG ] Marking 'union' as a jinja filter
[DEBUG ] Marking 'intersect' as a jinja filter
[DEBUG ] Marking 'difference' as a jinja filter
[DEBUG ] Marking 'symmetric_difference' as a jinja filter
[DEBUG ] Marking 'method_call' as a jinja filter
[DEBUG ] Marking 'yaml_dquote' as a jinja filter
[DEBUG ] Marking 'yaml_squote' as a jinja filter
[DEBUG ] Marking 'yaml_encode' as a jinja filter
[DEBUG ] Could not LazyLoad parallels.avail_sizes: 'parallels' virtual returned False
[DEBUG ] LazyLoaded parallels.avail_locations
[DEBUG ] LazyLoaded proxmox.avail_sizes
[DEBUG ] LazyLoaded azurearm.get_configured_provider
[WARNING ] The cloud driver, 'azurearm', configured under the 'azurearm-conf' cloud provider alias, could not be loaded. Please check your provider configuration files and ensure all required dependencies are installed for the 'azurearm' driver.
In rare cases, this could indicate the 'azurearm.get_configured_provider()' function could not be found.
Removing 'azurearm' from the available providers list
[ERROR ] There was a profile error: 'azurearm-conf'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/salt/cloud/cli.py", line 290, in run
ret = mapper.run_profile(self.options.profile, self.config.get("names"))
File "/usr/lib/python3/dist-packages/salt/cloud/init.py", line 1392, in run_profile
provider_details = self.opts["providers"][alias][driver].copy()
KeyError: 'azurearm-conf'
Got following output:
[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/azurearm.conf'
[DEBUG ] Reading configuration from /etc/salt/cloud.providers.d/azurearm.conf
[DEBUG ] Missing configuration file: /etc/salt/cloud.profiles
[DEBUG ] Including configuration from '/etc/salt/cloud.profiles.d/azurearm.conf'
[DEBUG ] Reading configuration from /etc/salt/cloud.profiles.d/azurearm.conf
[DEBUG ] Configuration file path: /etc/salt/cloud
[WARNING ] Insecure logging configuration detected! Sensitive data may be logged.
[INFO ] salt-cloud starting
[WARNING ] Missing dependency: 'azurearm'. The azurearm driver requires 'azurearm' to be installed.
[DEBUG ] Marking 'base64_encode' as a jinja filter
[DEBUG ] Marking 'base64_decode' as a jinja filter
[DEBUG ] Marking 'md5' as a jinja filter
[DEBUG ] Marking 'sha1' as a jinja filter
[DEBUG ] Marking 'sha256' as a jinja filter
[DEBUG ] Marking 'sha512' as a jinja filter
[DEBUG ] Marking 'hmac' as a jinja filter
[DEBUG ] Marking 'hmac_compute' as a jinja filter
[DEBUG ] Marking 'random_hash' as a jinja filter
[DEBUG ] Marking 'rand_str' as a jinja filter
[DEBUG ] Marking 'file_hashsum' as a jinja filter
[DEBUG ] Marking 'http_query' as a jinja filter
[DEBUG ] Marking 'strftime' as a jinja filter
[DEBUG ] Marking 'date_format' as a jinja filter
[DEBUG ] Marking 'raise' as a jinja global
[DEBUG ] Marking 'match' as a jinja test
[DEBUG ] Marking 'equalto' as a jinja test
[DEBUG ] Marking 'skip' as a jinja filter
[DEBUG ] Marking 'sequence' as a jinja filter
[DEBUG ] Marking 'to_bool' as a jinja filter
[DEBUG ] Marking 'indent' as a jinja filter
[DEBUG ] Marking 'tojson' as a jinja filter
[DEBUG ] Marking 'quote' as a jinja filter
[DEBUG ] Marking 'regex_escape' as a jinja filter
[DEBUG ] Marking 'regex_search' as a jinja filter
[DEBUG ] Marking 'regex_match' as a jinja filter
[DEBUG ] Marking 'regex_replace' as a jinja filter
[DEBUG ] Marking 'uuid' as a jinja filter
[DEBUG ] Marking 'unique' as a jinja filter
[DEBUG ] Marking 'min' as a jinja filter
[DEBUG ] Marking 'max' as a jinja filter
[DEBUG ] Marking 'avg' as a jinja filter
[DEBUG ] Marking 'union' as a jinja filter
[DEBUG ] Marking 'intersect' as a jinja filter
[DEBUG ] Marking 'difference' as a jinja filter
[DEBUG ] Marking 'symmetric_difference' as a jinja filter
[DEBUG ] Marking 'method_call' as a jinja filter
[DEBUG ] Marking 'yaml_dquote' as a jinja filter
[DEBUG ] Marking 'yaml_squote' as a jinja filter
[DEBUG ] Marking 'yaml_encode' as a jinja filter
[DEBUG ] Could not LazyLoad parallels.avail_sizes: 'parallels' virtual returned False
[DEBUG ] LazyLoaded parallels.avail_locations
[DEBUG ] LazyLoaded proxmox.avail_sizes
[DEBUG ] LazyLoaded azurearm.get_configured_provider
[WARNING ] The cloud driver, 'azurearm', configured under the 'azurearm-conf' cloud provider alias, could not be loaded. Please check your provider configuration files and ensure all required dependencies are installed for the 'azurearm' driver.
In rare cases, this could indicate the 'azurearm.get_configured_provider()' function could not be found.
Removing 'azurearm' from the available providers list
Error: There was an error listing images: No cloud providers matched 'azurearm-conf'. Available selections:
Versions Report
Salt Version:
Salt: 3002.2
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: 2.7.3
docker-py: Not Installed
gitdb: 2.0.6
gitpython: 3.0.7
Jinja2: 2.10.1
libgit2: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack: 0.6.2
msgpack-pure: Not Installed
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: 3.6.1
pygit2: Not Installed
Python: 3.8.5 (default, Jul 28 2020, 12:59:40)
python-gnupg: 0.4.5
PyYAML: 5.3.1
PyZMQ: 18.1.1
smmap: 2.0.5
timelib: Not Installed
Tornado: 4.5.3
ZMQ: 4.3.2
System Versions:
dist: ubuntu 20.04 focal
locale: utf-8
machine: x86_64
release: 5.4.0-1031-azure
system: Linux
version: Ubuntu 20.04 focal
The text was updated successfully, but these errors were encountered: