# Add machine-driver

**URL:** <https://forums.suse.com/t/add-machine-driver/2209>\
**Category:** Rancher 1.x\
**Created:** [March 29, 2016, 4:57pm UTC](https://forums.suse.com/t/add-machine-driver/2209 "2016-03-29T16:57:20Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![renaudManda](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/renaudmanda/32/2444_2.png) [@renaudManda](https://forums.suse.com/u/renaudManda)\
**Post date:** [March 29, 2016, 4:57pm UTC](https://forums.suse.com/t/add-machine-driver/2209/1 "2016-03-29T16:57:21Z")

</div>

I try to understand how to add a custom machine-driver in Rancher 1.0.

I wish to use OVH (Public Cloud Instance) to create dynamic servers, they used an openstack compatible api (so I can try with rancher openstack driver) however (and because I like OVH as provider) I wish to be able to use their specific machine-driver available at [https://github.com/yadutaf/docker-machine-driver-ovh](https://github.com/yadutaf/docker-machine-driver-ovh)

I added the binary (available in release) in admin\>settings

So now I see one line on top of the others drivers labeled as “requested”.

My question is, is it the right way to add a new driver ? And howto push custom info to the driver as describe here: [https://github.com/yadutaf/docker-machine-driver-ovh/blob/master/README.md#2-create-a-configuration-file](https://github.com/yadutaf/docker-machine-driver-ovh/blob/master/README.md#2-create-a-configuration-file)

Cheers,  
Renaud

---

<div class="post-metadata">

**Author:** ![cjellick](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/cjellick/32/2876_2.png) [@cjellick](https://forums.suse.com/u/cjellick)\
**Post date:** [March 30, 2016, 4:39pm UTC](https://forums.suse.com/t/add-machine-driver/2209/2 "2016-03-30T16:39:22Z")

</div>

@renaudManda yes that is the intended way to add a driver. However, it sounds like something went wrong because Rancher should pick up that requested driver and activate it.

A couple debugging quwestions:

1. Is this a fresh Rancher 1.0 install?
2. On the settings page where the OVH driver is listed, there should be entries for Packet and Ubiquity. Are those both active? If either are in an error state, you should be able to retry them by clicking the drop down next to the state.

---

<div class="post-metadata">

**Author:** ![renaudManda](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/renaudmanda/32/2444_2.png) [@renaudManda](https://forums.suse.com/u/renaudManda)\
**Post date:** [March 30, 2016, 4:55pm UTC](https://forums.suse.com/t/add-machine-driver/2209/3 "2016-03-30T16:55:09Z")

</div>

@cjellick

1. nope, it’s an upgrade from the previous release.
2. yes both are active

bellow the API export

```auto
{
"id": "1md4",
"type": "machineDriver",
"links": {
"self": "…/v1/machinedrivers/1md4",
"account": "…/v1/machinedrivers/1md4/account",
},
"actions": {
"remove": "…/v1/machinedrivers/1md4/?action=remove",
},
"name": "ovh",
"state": "requested",
"accountId": "1a1",
"created": "2016-03-29T16:40:32Z",
"createdTS": 1459269632000,
"data": { },
"description": null,
"kind": "machineDriver",
"md5checksum": null,
"removeTime": null,
"removed": null,
"transitioning": "no",
"transitioningMessage": null,
"transitioningProgress": null,
"uri": "https://github.com/yadutaf/docker-machine-driver-ovh/releases/download/v0.5.0/docker-machine-driver-ovh-linux-amd64",
"uuid": "e6a83b7f-798a-4e6b-9152-94df4464b010",
}

```

Cheers,  
Renaud

---

<div class="post-metadata">

**Author:** ![cjellick](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/cjellick/32/2876_2.png) [@cjellick](https://forums.suse.com/u/cjellick)\
**Post date:** [March 30, 2016, 5:23pm UTC](https://forums.suse.com/t/add-machine-driver/2209/4 "2016-03-30T17:23:16Z")

</div>

I’m assuming you are running rancher/server as a single all-in-one container and not in the “HA” setup. If that is not accurate, let me know.

Assuming that you are, can you provide the output from this command?

```auto
docker logs <name of your rancher server container> 2>&1 | grep -e '^time'

```

I ask for this because there is a process (which logs to standard out with the prefix time) that is called go-machine-service that is responsible for all machine driver activities. My guess is that it is misbehaving. This command will give us the logs for it.

After doing that, you cold also kill the go-machine-service process via `killall -3 go-machine-service` to force it to restart and try again. Note that doing the killall -3 will cause go-machine-service to do a stack dump. You’ll see this in the container’s logs as a bunch of stacktraces look something like this:

```auto
goroutine 90 [syscall]:
syscall.Syscall(0x3, 0x1a, 0xc820115000, 0x1000, 0x0, 0x0, 0x0)

```

If you could grab that and share it as well (preferrably in a gist) that would be useful as well.

---

<div class="post-metadata">

**Author:** ![renaudManda](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/renaudmanda/32/2444_2.png) [@renaudManda](https://forums.suse.com/u/renaudManda)\
**Post date:** [March 31, 2016, 5:51pm UTC](https://forums.suse.com/t/add-machine-driver/2209/5 "2016-03-31T17:51:47Z")

</div>

Please find bellow the links on gist with each asked actions:

- docker logs: [https://gist.github.com/renaudManda/ab21bf347679de67484606bac6f14009#file-gistfile1-txt](https://gist.github.com/renaudManda/ab21bf347679de67484606bac6f14009#file-gistfile1-txt)
- kill go-machine-service: [https://gist.github.com/renaudManda/bffd71fe41b5b9cf8016b08f78bf9f20#file-gistfile1-txt](https://gist.github.com/renaudManda/bffd71fe41b5b9cf8016b08f78bf9f20#file-gistfile1-txt)

But after doing that (I killed twice due the go-machine-service due to other errors and low buffer memory on the ‘logs screen’), and now I see the driver active.

So my assomption is the go-machine-service probably not executing the pending tasks. Maybe I can find thje first kill output in console ?

Now I gona try to make the ovh driver works 😉

Renaud

---

<div class="post-metadata">

**Author:** ![nmoturi](https://avatars.discourse-cdn.com/v4/letter/n/54ee81/32.png) [@nmoturi](https://forums.suse.com/u/nmoturi)\
**Post date:** [July 20, 2016, 12:48am UTC](https://forums.suse.com/t/add-machine-driver/2209/6 "2016-07-20T00:48:32Z")

</div>

Is the OVH machine driver worked…? I couldn’t get this working, looking at the rancher server log, I could notice some usage errors of docker-machine create command. I am using the latest OVH driver ([https://github.com/yadutaf/docker-machine-driver-ovh/releases/download/v1.0.0/docker-machine-driver-ovh-linux-amd64](https://github.com/yadutaf/docker-machine-driver-ovh/releases/download/v1.0.0/docker-machine-driver-ovh-linux-amd64)). I also didn’t find all the options available in the Add Host Interface when this driver is selected

* * *

time=“2016-07-20T00:23:17Z” level=info msg=“stdout: Incorrect Usage.” resourceId: =1ph14  
time=“2016-07-20T00:23:17Z” level=info msg="stdout: " resourceId: =1ph14  
time=“2016-07-20T00:23:17Z” level=info msg=“stdout: Usage: docker-machine create [OPTIONS] [arg…]” resourceId: =1ph14  
time=“2016-07-20T00:23:17Z” level=info msg="stdout: " resourceId: =1ph14  
time=“2016-07-20T00:23:17Z” level=info msg=“stdout: Create a machine” resourceId: =1ph14  
time=“2016-07-20T00:23:17Z” level=info msg="stdout: " resourceId: =1ph14  
time=“2016-07-20T00:23:17Z” level=info msg=“stdout: Description:” resourceId: =1ph14  
time=“2016-07-20T00:23:17Z” level=info msg=“stdout: Run ‘docker-machine create --driver name’ to include the create flags for that driver in the help text.” resourceId: =1ph14  
time=“2016-07-20T00:23:17Z” level=info msg=“stdout: " resourceId: =1ph14  
time=“2016-07-20T00:23:17Z” level=info msg=“stdout: Options:” resourceId: =1ph14  
time=“2016-07-20T00:23:17Z” level=info msg=“stdout: " resourceId: =1ph14  
time=“2016-07-20T00:23:17Z” level=info msg=“stdout: --driver, -d “none”\t\t\t\t\t\t\t\t\t\t\tDriver to create machine with.” resourceId: =1ph14  
time=“2016-07-20T00:23:17Z” level=info msg=“stdout: --engine-env [–engine-env option --engine-env option]\t\t\t\t\t\tSpecify environment variables to set in the engine” resourceId: =1ph14  
time=“2016-07-20T00:23:17Z” level=info msg=“stdout: --engine-insecure-registry [–engine-insecure-registry option --engine-insecure-registry option]\tSpecify insecure registries to allow with the created engine” resourceId: =1ph14  
time=“2016-07-20T00:23:17Z” level=info msg=“stdout: --engine-install-url “[https://get.docker.com](https://get.docker.com)”\t\t\t\t\t\t\tCustom URL to use for engine installation [$MACHINE\_DOCKER\_INSTALL\_URL]” resourceId: =1ph14  
time=“2016-07-20T00:23:17Z” level=info msg=“stdout: --engine-label [–engine-label option --engine-label option]\t\t\t\t\t\tSpecify labels for the created engine” resourceId: =1ph14  
time=“2016-07-20T00:23:17Z” level=info msg=“starting cleanup…” machine name=ovh-host2  
time=“2016-07-20T00:23:17Z” level=error msg=“Error processing event” err=“exit status 1” eventId=c1113176-c297-4e56-ae26-aa999b13a635 eventName=“physicalhost.create;handler=goMachineService” resourceId=1ph14  
time=“2016-07-20T00:24:00Z” level=info msg=“Stack Create Event Received” eventId=cf5275ca-1589-4aec-919f-90e2c385c8f8 resourceId=1e4  
time=“2016-07-20T00:24:00Z” level=info msg=“Stack Create Event Done” eventId=cf5275ca-1589-4aec-919f-90e2c385c8f8 resourceId=1e4  
time=“2016-07-20T00:31:34Z” level=info msg=“Purging Machine” eventId=559a3e23-498e-48c3-b69d-3015fc8fa453 resourceId=1ph14  
time=“2016-07-20T00:31:34Z” level=info msg=“Machine purged” machineDir=”/var/lib/cattle/machine/33d24829-4a8b-46f6-90e0-af941d8f80a8” machineExternalId=33d24829-4a8b-46f6-90e0-af941d8f80a8 resourceId=1ph14

---

<div class="post-metadata">

**Author:** ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)\
**Post date:** [July 20, 2016, 1:27am UTC](https://forums.suse.com/t/add-machine-driver/2209/7 "2016-07-20T01:27:01Z")

</div>

The URL you used is to `docker-machine-driver-ovh-linux-amd64`, but `docker-machine` expects the file to be named `docker-machine-driver-NAME` (i.e. `docker-machine-driver-ovh`). So we download and install the file but the call to `docker-machine create --driver=ovh ...` doesn’t find a driver binary.

Typically driver releases are uploaded as a tarball instead of a naked binary, named with the OS/architecture but containing an actual binary named just what docker-machine expects (e.g. [https://github.com/janeczku/docker-machine-vultr/releases](https://github.com/janeczku/docker-machine-vultr/releases)).

---

<div class="post-metadata">

**Author:** ![webofmars](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/webofmars/32/805_2.png) [@webofmars](https://forums.suse.com/u/webofmars)\
**Post date:** [May 19, 2017, 2:40pm UTC](https://forums.suse.com/t/add-machine-driver/2209/8 "2017-05-19T14:40:04Z")

</div>

Actually it seems still the case in 1.5.3. This is kind of annoying to restart the service for this case. Is there any sanity check that can be done there ?

Not really a machine-driver specialist but of i’m pointed to the right direction i might look into it
