vagrant-openstack-provider icon indicating copy to clipboard operation
vagrant-openstack-provider copied to clipboard

ERROR Bad authentication endpoint.

Open cally725 opened this issue 5 years ago • 2 comments

using vagrant-openstack-provider (0.13.0) Vagrant 1.8.1 openstack newton

I get Bad authentication endpoint error when running vagrant up --provider openstack with the following vagrant file:

require 'vagrant-openstack-provider'

Vagrant.configure('2') do |config|

  config.ssh.username = 'cirros'
  config.ssh.password = 'gocubsgo'

  config.vm.provider :openstack do |os|
    os.openstack_auth_url = 'http://10.10.20.30:5000/v3'
    os.username           = 'admin`'
    os.password           = 'Passw0rd@stellia'
    os.tenant_name        = 'admin'
    os.flavor             = 'm1.tiny'
    os.image              = 'cirros'
    os.floating_ip_pool   = 'provider'
  end
end

When sourcing my ./openrc I can execute openstack command but not when using vagrant

I saw the the pluggin is adding /token to the auth_url. My url is : openstack_auth_url = 'http://10.10.20.30:5000/v3' but the plugin show in the debug that it use : openstack_auth_url = 'http://10.10.20.30:5000/v3/tokens'

No sure why it concatenate /tokens but that seems to be causing the problem ?

Here is the debug info:

2019-01-18 23:09 |  INFO | Authenticating on Keystone
2019-01-18 23:09 |  INFO | Authentication on project admin with user admin`
2019-01-18 23:09 | DEBUG | request  => method  : POST
2019-01-18 23:09 | DEBUG | request  => url     : http://10.10.20.30:5000/v3/tokens
2019-01-18 23:09 | DEBUG | request  => headers : {:content_type=>:json, :accept=>:json}
2019-01-18 23:09 | DEBUG | request  => body    : {"auth":{"tenantName":"admin","passwordCredentials":{"username":"admin`","password":"****"}}}
2019-01-18 23:09 | DEBUG | response => code    : 404
2019-01-18 23:09 | DEBUG | response => headers : {:date=>"Fri, 18 Jan 2019 22:09:32 GMT", :server=>"Apache", :vary=>"X-Auth-Token", :x_openstack_request_id=>"req-cb089dc5-c7ae-4d14-abd3-84b0d9bbdbd6", :content_length=>"93", :content_type=>"application/json"}
2019-01-18 23:09 | DEBUG | response => body    : {"error": {"message": "The resource could not be found.", "code": 404,
"title": "Not Found"}}
~

Please help

cally725 avatar Jan 18 '19 22:01 cally725

I have the same issue.

I'm using Openstack rocky.

mpiscaer avatar May 08 '19 11:05 mpiscaer

Hi,

Vargrant OpenStack Provider supports both keystone v2 and v3 authentication endpoints but it uses v2 by default. Depending if you use v2 or v3 endpoint and credentials, configuration will be different.

For v2, you have to populate os.tenant_name, os.username and os.password. For v3, instead of os.tenant_name you have to use os.project_name. In addition, you have to set domains information with os.user_domain_name and os.project_domain_name. Last but not least, set os.identity_api_version = '3' to tell the provider you're using v3 API.

Here are Vagrantfile examples for v2 and v3

Hope it helps.

ggiamarchi avatar May 15 '19 08:05 ggiamarchi