No cloud provider for OpenStack and instance doesn't launch

129 views
Skip to first unread message

aishwarya adyanthaya

unread,
May 17, 2018, 1:23:54 AM5/17/18
to Salt-users
Hi,

I have installed salt-cloud on the salt-master and I created the provider file:

# cat /etc/salt/cloud.providers.d/openstack.conf

my-openstack-config:
  
  minion:
    master: 10.211.X.Y

  compute_name: nova
  protocol: ipv4

  compute_region: RegionOne

  user: admin
  password: root123
  tenant: admin

  driver: openstack

  insecure: false

I created a profile as below:
cat stack_micro.conf
stack_micro:                              
 provider: openstack.conf          
 size: c1.micro                           
 image: "051811e6-b7e0-47bd-ad1e-d87bf4a9eb32"       
 ssh_key_file: /home/oss/test   
 ssh_key_name: test                 
 ssh_interface: private_ips        
 ssh_username: ubuntu 


But when I try to create the instance, I am getting the error telling the cloud provider doesn't exist:
salt-cloud -m /etc/salt/cloud.maps.d/example.conf
[WARNING ] The required 'cloud' configuration setting is missing from the 'openstack' driver, which is configured under the 'my-openstack-config' alias.
[WARNING ] The cloud driver, 'openstack', configured under the 'my-openstack-config' cloud provider alias, could not be loaded. Please check your provider configuration files and ensure all required dependencies are installed for the 'openstack' driver.
In rare cases, this could indicate the 'openstack.get_configured_provider()' function could not be found.
Removing 'openstack' from the available providers list
[ERROR   ] The required profile, 'stack_micro', defined in the map does not exist. The defined nodes, 'web1.example.com', will not be created.
Found the following errors:
  stack_micro: The required profile, 'stack_micro', defined in the map does not exist. The defined nodes, 'web1.example.com', will not be created.

Can someone please point out if I am missing something in the configuration file.
Thank you.

Daniel Wallace

unread,
May 17, 2018, 9:30:28 AM5/17/18
to Salt-users
Which version of salt are you running?

If you are using 2017.7, you will need to install apache-libcloud
If you are using 2018.3, that configuration file won't work and you need to install shade.

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/salt-users/958159b3-469c-4461-8a94-8e2c644ea542%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

aishwarya adyanthaya

unread,
May 17, 2018, 12:26:40 PM5/17/18
to salt-...@googlegroups.com
I am using the 2018 version and I did install shade. But it didn't seem to work :(

To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/salt-users/CAA2%2B9hB5eNX1pM16Eox9zmP0AQ2S1f9_x4uPFe-8DJRgKa7xhg%40mail.gmail.com.

Jeroen van Nieuwenhuizen

unread,
May 17, 2018, 12:47:08 PM5/17/18
to salt-...@googlegroups.com
One of the problems I see is that you reference the provider in stack_micro.conf as
provider: openstack.conf

It should however point to the name of the provider definition (my-openstack-config). So:
provider: my-openstack-config

Furthermore it looks you use the configuration examples from the 2017 version and not the 2018 version (which can be found at https://docs.saltstack.com/en/latest/topics/cloud/openstack.html).

Hopefully this helps you in the right direction.

Kind regards,

Jeroen.

aishwarya adyanthaya

unread,
May 18, 2018, 12:13:14 AM5/18/18
to salt-...@googlegroups.com
Thank you for the reply. I guess that's right. I do have a doubt though. In the version 2017 of Salt, the file was saved and run as:
# salt-coud -m profile.conf

But does the command hold good for the version 2018 too? I saved the profile in my salt-master, both the provider and profile, tried running it but received back:

[ERROR   ] An un-handled exception was caught by salt's global exception handler:
AttributeError: 'unicode' object has no attribute 'setdefault'
Traceback (most recent call last):
  File "/usr/bin/salt-cloud", line 10, in <module>
    salt_cloud()
  File "/usr/lib/python2.7/dist-packages/salt/scripts.py", line 460, in salt_cloud
    client.run()
  File "/usr/lib/python2.7/dist-packages/salt/cloud/cli.py", line 95, in run
    mapper = salt.cloud.Map(self.config)
  File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 1672, in __init__
    self.rendered_map = self.read()
  File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 1850, in read
    overrides.setdefault('name', name)
AttributeError: 'unicode' object has no attribute 'setdefault'
Traceback (most recent call last):
  File "/usr/bin/salt-cloud", line 10, in <module>
    salt_cloud()
  File "/usr/lib/python2.7/dist-packages/salt/scripts.py", line 460, in salt_cloud
    client.run()
  File "/usr/lib/python2.7/dist-packages/salt/cloud/cli.py", line 95, in run
    mapper = salt.cloud.Map(self.config)
  File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 1672, in __init__
    self.rendered_map = self.read()
  File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 1850, in read
    overrides.setdefault('name', name)
AttributeError: 'unicode' object has no attribute 'setdefault'

Thank you.


To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/salt-users/ECE27955-9FAB-4CC1-AB03-C535F4DC5559%40gmail.com.

aishwarya adyanthaya

unread,
May 18, 2018, 6:50:12 AM5/18/18
to salt-...@googlegroups.com
I got it working! I'm able to establish a connection between my salt-master and OpenStack. It seemed that I had misplaced the files.

To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Salt-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to salt-users+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages