GithubHelp home page GithubHelp logo

linode / docker-volume-linode Goto Github PK

View Code? Open in Web Editor NEW
46.0 12.0 21.0 215 KB

Docker Volume driver for Linode Block Storage

License: Apache License 2.0

Go 81.89% Dockerfile 1.87% Makefile 13.45% Jinja 2.78%
docker volume docker-plugin docker-volume golang go

docker-volume-linode's People

Contributors

amisiorek-akamai avatar bsdlp avatar dependabot[bot] avatar displague avatar jriddle-linode avatar lbgarber avatar lgarber-akamai avatar phillc avatar ricardorg79 avatar riramir-rei avatar ykim-1 avatar zliang-akamai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-volume-linode's Issues

Can't enable the driver

docker plugin enable linode/docker-volume-linode
Error response from daemon: dial unix /run/docker/plugins/dbc67ba543ec1cac789bbaaa9ad1b8d33664e95b7345277265e4fc3cc86a011e/linode-driver.sock: connect: no such file or directory

consider using chiefy/linodego

https://github.com/chiefy/linodego/ seeks to become an official Linode APIv4 Go client. It already has some support for volumes, but could use more users and interested developers.

The custom linode/lib.go API calls could be replaced or simplified by relying on the linodego client.

This client is also being used in https://github.com/displague/docker-machine-linode and https://github.com/displague/terraform-provider-linode .. The additional eyes and support in the API wrapper will benefit all of those projects.

Thanks
</shameless_plug>

Error response from daemon: error while mounting volume

Hi

i have the following volume defined:

dv ls
DRIVER VOLUME NAME
linode:latest aanc-staging

When I run the command below i get the error displayed:

docker run --rm -it -v aanc-staging:/mnt busybox touch /mnt/file-to-persist.txt
Unable to find image 'busybox:latest' locally
latest: Pulling from library/busybox
90e01955edcd: Pull complete
Digest: sha256:2a03a6059f21e150ae84b0973863609494aad70f0a80eaeb64bddd8d92465812
Status: Downloaded newer image for busybox:latest
docker: Error response from daemon: error while mounting volume '/mnt/aanc-staging': Post http://%2Frun%2Fdocker%2Fplugins%2F250ad1ac82ee49d84474a5c55e0b2ed241ce379ec66fbbd759cae65d8c20e3ae%2Flinode.sock/VolumeDriver.Mount: net/http: request canceled (Client.Timeout exceeded while awaiting headers)

Thanks
Eric

Usage with multiple linodes

I use swarm and linode, is there a way to have this driver attaching to multiple linodes in a swarm cluster?
Today I have to keep my data on the manager node, and only use the worker node on applications that dont need volume mounting.

Migrating to Linode Plugin API for easy installation

** I have created this issue to track ongoing work **

Currently the docker-volume-linode process has to be downloaded and run in the background manually. An upstart or systemd script is required to keep the process ruining between bounces.

The proposed change is to migrate the current installation to the new Plugin API to alllow installing of the driver with docker:

docker plugin install libgolang/docker-volume-linode

Required Changes

The driver needs to be packaged in a docker image and published.

  • I have already created the repository libgolang//docker-volume-linode
  • Dockerfile have already been created
  • Travis scripts have been created, but need to be cleaned up.

Using wrong API call to list volumes

Volume listing is calling ListInstanceVolumes instead of ListVolumes. Only volumes attached to the current node are listed. Need to change to make the driver work in swarm mode.

Bug: driver fails to mount remoted moutned volume

Condition to reproduce issue:

  • In swarm mode
  • volume mounted on remote node and not in use by node or container.
  • remote node silently did not unmount the volume.
  • try mounting the volume locally node.
  • plugin fails to mount with "failed to attach volume.. already attached"

Cause:

  • plugin tries to attach the volume while it is already associated to another node

Fix:

  • submit detach request if volume already associated with another node.
  • Kernel unmounts volume when detach request is made.

Create and attach the volume in a single API calls

The POST /v4/volumes/ endpoint accepts a Linode ID (Config ID is optional and will be inferred similar to how it will be inferred on the /boot endpoint).

This will prevent provisioning a volume if it would ultimately fail to attach.

Error when installing plugin: linode.sock not found

The recent 0.14 version fails when installed on CoreOS:

core@lixxx ~ $ docker plugin install --alias linode --grant-all-permissions linode/docker-volume-linode linode-token=...
latest: Pulling from linode/docker-volume-linode
3b1c429d6c02: Download complete
Digest: sha256:466cb47045a480e23b3360df5d72c8e4bb2d73a84fd6a8ab30217822fec50c6f
Status: Downloaded newer image for linode/docker-volume-linode:latest
Error response from daemon: dial unix /run/docker/plugins/b218ceb9e6dc495079cf31235fc541045988f4e85e09515b971b869e14893847/linode.sock: connect: no such file or directory

Remove docker volume without removing the physical volume

When migrating my swarm to a different server, I did a docker volume rm on an important linode volume, thinking this would just remove the docker volume since it was no longer needed on that Linode. Unfortunately, this permanently deleted the actual volume with no warning and no way to recover ๐Ÿคฆ.

It would be really nice if this plugin didn't destroy any data. I'm not sure what's possible in a volume driver, but perhaps upon removing a volume, it could also give a warning message to say the physical volume hasn't been deleted?

Must provide a region or a Linode ID

I'm unable to get a volume created and get the following error

Error response from daemon: create my-test-volume: VolumeDriver.Create: Create(my-test-volume) Failed: [400] Must provide a region or a Linode ID

I followed all the steps of the README including setting the linode-region and linode-label on the plugin.

Any thoughts what I'm doing wrong?

I also tried to specify --opt region=us-southeast, --opt linode-region=us-southeast, and --opt linode.region=us-southeast to the docker volume create command with no luck.

Thanks!

After volume attached to other host, volume need to remove manually

If a volume attached to a host (Host A), then exit the host A container.
Then attached the volume to the other host (host B).
After that, exit the host B container, and try mount that volume on host A, it will return error
"error while mounting volume '': VolumeDriver.Mount: EOF"

After remove the docker dummy volume pointer, the volume can mount to host A again.

docker volume rm [volume name]

it seem related to driver.go line 303 ?
Even the local docker api volume report volume is already exist, the mount function should ensure does it really attached.

driver.go line 303

// else... linode already attached to current host
https://github.com/linode/docker-volume-linode/blob/be8f94b4eb7bd4615e550defa0cf76d98bd23ed6/driver.go

===============

Host A:
docker run -it --rm --mount volume-driver=linode,source=test-vol,destination=/test,volume-opt=size=10 alpine

#(exit container)

Host B:
docker run -it --rm --mount volume-driver=linode,source=test-vol,destination=/test,volume-opt=size=10 alpine

#(exit container)

Host A:
docker run -it --rm --mount volume-driver=linode,source=test-vol,destination=/test,volume-opt=size=10 alpine
return API error (500): error while mounting volume '': VolumeDriver.Mount: EOF

docker volume rm test-vol

Better Volume detachment

  • Call Detach when Unmount is called. (when the container exits)
  • Use Docker API to find if a volume is in use by a container.
  • Fail Attach/Mount if volume is already in use by a container.
  • If Volume not in use, call Detach ( a just in case scenario)

Use Docker API to find out if volume is in use.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.