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
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
Cheers,
Renaud
@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:
- Is this a fresh Rancher 1.0 install?
- 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.
@cjellick
- nope, itās an upgrade from the previous release.
- yes both are active
bellow the API export
{
"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
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?
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:
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.
Please find bellow the links on gist with each asked actions:
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
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). 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ā\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
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).
1 Like
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