joeduffy / blocker

A simple AWS EBS volume plugin for Docker
Apache License 2.0
82 stars 13 forks source link

'Name not found' while trying to mount a volume #4

Open mvanholsteijn opened 8 years ago

mvanholsteijn commented 8 years ago

I am trying to load a volume, but blocker gives the error 'Name not found'.

2016/06/11 20:52:25 * /VolumeDriver.Path
2016/06/11 20:52:25     done: (vol-38386f82): (, Name not found.)
2016/06/11 20:52:25 * /VolumeDriver.Mount
2016/06/11 20:52:25     done: (vol-38386f82): (, Name not found.)
2016/06/11 20:52:25 * /VolumeDriver.Unmount
2016/06/11 20:52:25     done: (vol-38386f82): Name not found.

The volume is definitely there as it does list with

 aws ec2 describe-volumes --volume-ids vol-38386f82

I am running in eu-central-1.

monder commented 8 years ago

It could be that docker and blocker volume list is out of sync.

Modern docker versions do not call VolumeDriver.Create every time its mounted, thus ebs_driver.go#L71 not being populated.

It may happen because of blocker restart without removing the volumes first.

To workaround you can remove the volume manualy with

docker volume rm ...

or try a fork of mine which is completely stateless. I'm still not sure about merging it here, and if its the correct way to fix the issue. fyi #f94aca0

mvanholsteijn commented 8 years ago

I found out that Docker 1.9 does not call Volume.Create on blocker.

When I add it using curl, the volume is attached and mounted.

curl --unix-socket /var/run/blocker.sock http://localhost/VolumeDriver.Create -d '{ "Name": "vol-38386f82" }'

@monder I like your stateless implementation :-)

joeduffy commented 8 years ago

(I guess I had notifications turned off for this repo .. whoops.)

I prefer the stateless implementation too. Happy to merge if you submit a PR.

monder commented 8 years ago

Hey. I dont think that it would be possible to keep it stateless. Especially with https://github.com/joeduffy/blocker/commit/ca190d917647f57c0a2a4c906dab6b8f8cb09fba and support of #5 since the driver api gives us only the name of the volume. We need to think of some kind of way for storing the state between daemon restarts.

zbyte64 commented 8 years ago

Strange, I've been running a stateless fork with volume create for a while now. Just use volume labels and EC2 calls to keep track of state.