Support for adding a host with Openstack?

I haven’t gone over all of the docs with a fine toothed comb, but I seems that adding hosts in Openstack is not supported. Docker Machine supports Openstack so I sort of assumed Rancher would as well.

Are there plans to support Openstack?

It’s in the API (along with all the other drivers from machine) but there isn’t a UI for it yet. We plan on adding an “Other” button soon that will give you generic access to all the drivers and their options that don’t have one of the nicer first-class buttons.

Can you point me to the documentation for the API?

I think I found it: https://github.com/rancher/api-spec/blob/master/specification.md

it may be a good idea to point to this form the docs. Or make it easier to find, for knuckleheads like me. :smile:

sorry, should have read the “specification.md” first. I found was just general information about how to use the API and such. Not an actual spec. please, help.

I don’t suppose there in example for creating/removing a VM instance in Openstack.

In order to access the API UI, open up the UI for rancher by using a browser and going to the rancher homepage.

Then go to APIs & Keys Page

Click on the endpoint link there

This will take you to the API UI, logged in as the correct user

Then you need to open the machines page by clicking on the machines link in this page

In the machine page, click on create

This will open up a form. In the form the "name" field is a required field. The rest of the fields are optional.

In our case, the openstackConfig config field is the most interesting one. You can specify the configuration for the new Openstack VM in the field openstackConfig as a json.

The allowed fields in the openstackConfig json can be seen by clicking on the type link next to the fieldname in the form. Fill up this json with the appropriate values and click on create, and then follow self link to kick of the creation of the VM.

Note that this step may take a while. At this point, revert back to using the normal UI, and under the Hosts tab the machine creation will be shown. Wait until the host is in active state.

Then you can use the normal UI to manage the host, and delete It.

These sequence of steps can be automated by directly making a http POST request with the openstackConfig json to the /v1/machines endpoint.

curl -u "${CATTLE_ACCESS_KEY}:${CATTLE_SECRET_KEY}" \
-X POST \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '{"name":"dsfdsf", "openstackConfig":{"endpointType":"type", "domainId": "dId"}}' \
'http://localhost:8080/v1/projects/1a5/machines'

where CATTLE_ACCESS_KEY and CATTLE_SECRET_KEY are API key public and secret values respsectively.

Note that several more fields than that are required for it to actually create a machine… I don’t have OpenStack lying around to try it but at least authUrl, username, password and tenantId or
tenantName.

Whatever you would pass to docker-machine from the CLI can be passed in the appropriate JSON field of the API.

Thanks vincent, the concept is very cool! I set the other openstack data I set for docker machine, but I’m getting this error:
transitioningMessage": “No suitable endpoint could be found in the service catalog.”

I’m not sure what the “endpoint” should be.

My fault: I had a type-o in the region name. I fixed that and it worked.

The error message was a bit misleading. I searched for the error, and found a person using terraform with openstack had a similar problem, and he figured out that his “region” setting was incorrect…so I checked my region setting and found the mistake.

Thanks for your help on this.

Everything is basically just passed through to docker-machine, so that message is coming from them and they’re not always terribly helpful. I think in this case that means the authUrl is wrong and it therefore can’t find the list of services in the keystone catalog to figure out where Nova is and talk to it.

It would probably be easier to debug by installing docker-machine on your computer and work out what incantation of arguments works for OpenStack there, then pass those same values into the Rancher API once you figure it out :slight_smile: .

sorry, I edited my previous post. It was just a type-o on my part.