mat128 / vagrant-openstack-cloud-provider

Use Vagrant to manage OpenStack Cloud instances.
MIT License
24 stars 17 forks source link

"Could not find service network" error #11

Open awinder opened 10 years ago

awinder commented 10 years ago

Getting the following error when I try to run vagrant up:

Could not find service network.  Have compute, ec2, identity, image, s3, volume

/Users/---/.vagrant.d/gems/gems/fog-1.15.0/lib/fog/openstack.rb:145:in `authenticate_v2'
/Users/---/.vagrant.d/gems/gems/fog-1.15.0/lib/fog/openstack/network.rb:279:in `authenticate'
/Users/---/.vagrant.d/gems/gems/fog-1.15.0/lib/fog/openstack/network.rb:210:in `initialize'
/Users/---/.vagrant.d/gems/gems/fog-1.15.0/lib/fog/core/service.rb:68:in `new'
/Users/---/.vagrant.d/gems/gems/fog-1.15.0/lib/fog/core/service.rb:68:in `new'
/Users/---/.vagrant.d/gems/gems/fog-1.15.0/lib/fog/network.rb:17:in `new'
/Users/---/.vagrant.d/gems/gems/vagrant-openstack-1.0.0/lib/vagrant-openstack/action/create_server.rb:30:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/---/.vagrant.d/gems/gems/vagrant-openstack-1.0.0/lib/vagrant-openstack/action/warn_networks.rb:14:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/builtin/set_hostname.rb:16:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/---/.vagrant.d/gems/gems/vagrant-openstack-1.0.0/lib/vagrant-openstack/action/sync_folders.rb:17:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/builtin/provision.rb:52:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
/Users/---/.vagrant.d/gems/gems/vagrant-openstack-1.0.0/lib/vagrant-openstack/action/connect_openstack.rb:29:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:95:in `block in finalize_action'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/builder.rb:116:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/runner.rb:69:in `block in run'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/util/busy.rb:19:in `busy'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/runner.rb:69:in `run'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/builtin/call.rb:51:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/builtin/config_validate.rb:25:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/builtin/handle_box_url.rb:24:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/warden.rb:34:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/builder.rb:116:in `call'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/runner.rb:69:in `block in run'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/util/busy.rb:19:in `busy'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/action/runner.rb:69:in `run'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/machine.rb:147:in `action'
/Applications/Vagrant/embedded/gems/gems/vagrant-1.4.3/lib/vagrant/batch_action.rb:63:in `block (2 levels) in run'
mat128 commented 10 years ago

This error happens because you configured networks (os.networks) but your provider (or private OpenStack cluster) does not support them (support for this appeared in Openstack Grizzly). This happens with public providers that don't have quantum (or neutron) exposed. Setting os.networks to nil (os.networks = nil) should do it. I have done that successfully with Rackspace, where my instance was provisioned with PublicNet and ServiceNet.

I'll leave this issue opened to better handle this behavior, as this error is somewhat cryptic to the general public.

treshenry commented 10 years ago

I see the same and I have no os.network or os.networks defined. The issue is that this PR: https://github.com/cloudbau/vagrant-openstack-plugin/commit/9c5441db359b34f2bbf66d30853c97b0896a494b ensures that if both "network" and "networks" are undefined in the config then "networks" will be set to an empty array: https://github.com/cloudbau/vagrant-openstack-plugin/blob/master/lib/vagrant-openstack-plugin/action/create_server.rb#L53

That will cause this check: https://github.com/cloudbau/vagrant-openstack-plugin/blob/master/lib/vagrant-openstack-plugin/action/connect_openstack.rb#L41 to always pass. If the OpenStack environment used has Neutron installed then it works fine either way, however, if the service catalog does not contain an entry for network you will get the exception above. I'll try and get up a PR a little later today with the fix.

treshenry commented 10 years ago

Upstream PR: https://github.com/cloudbau/vagrant-openstack-plugin/pull/58