docker / machine

Machine management for a container-centric world
https://docs.docker.com/machine/
Apache License 2.0
6.63k stars 1.97k forks source link

OpenStack Driver uses deprecated keystone /v2 endpoint and not /v3 - failing to create VMs #4775

Open stefanandres opened 4 years ago

stefanandres commented 4 years ago

When using a OpenStack Cloud that only supports the /v3 keystone identity endpoint, docker-machine will fail with

Dec 10 09:26:14 gitlab-runner gitlab-runner[950]: #033[31;1mERROR: {"error": {"message": "(https://keystone.cloud.XXX.net:5000//v2.0/tenants): The resource could not be found.", "code": 404, "title": "Not Found"}}#033[0;m  #033[31;1mdri
ver#033[0;m=openstack #033[31;1mname#033[0;m=runner-57c2b40c-gitlabci-cbk-multi-1575966368-1427eff2 #033[31;1moperation#033[0;m=create

client.go uses https://github.com/gophercloud/gophercloud/tree/master/openstack/identity/v2/tenants, but https://github.com/gophercloud/gophercloud/tree/master/openstack/identity/v3/projects should be used to get the project id.

See also https://specs.openstack.org/openstack/neutron-specs/specs/newton/moving-to-keystone-v3.html.

This happens even though I've set openstack-auth-url to the /v3 url, but this just isn't used for the code above.

As a workaround, you can pass --openstack-tenant-id instead of --openstack-tenant-name to docker-machine.

dhrp commented 4 years ago

I've found the rancher/machine/drivers to be up to date (unlike these) https://github.com/rancher/machine/tree/master/drivers/openstack

You can build it with this gist. https://gist.github.com/dhrp/0d5ff87c71b01231f6009d2293e95121

Hopefully we can also merge the improvements back upstream.