rancher / convoy

A Docker volume plugin, managing persistent container volumes.
Apache License 2.0
1.31k stars 135 forks source link

EBS volumes in Available state not re-used on another host. #148

Open dtx opened 8 years ago

dtx commented 8 years ago

I am using Convoy as my EBS volume driver, the use case is for a volume to follow a container even if the host changes. Convoy works well as long as the volume is attached to a host and re-uses the volume, but the moment the volume is detached from the host and I run a request on a host (same or different) to create a docker container with the same volume name and a new volume is created in EBS while the old one still exists in an available state.

What this means is every time my container moves to new host or is created with an --rm flag, I cannot reuse the volume as Convoy will create a new one with the same name but different ConvoyUUID.

screen shot 2016-08-04 at 2 48 31 pm
dtx commented 8 years ago

The issue seems to be at https://github.com/rancher/convoy/blob/91037ca9984804b7b1ac11d99b99dc1d49ffc67b/ebs/ebs.go#L480

Convoy expects the local json file about the volume to be present when creating a volume. if it cannot find it, then it goes ahead and creates a new volume. If we change that line to actually go to AWS (EBSService in this) and lookup a volume by the tag "name", we can fix this.

Working at a solution at our end on this.

zbyte64 commented 8 years ago

Also reported as issue #135

yasker commented 8 years ago

@dtx for use in the different host, you need to manually create the volume with same EBS Volume-ID first(e.g. vol-d4d99e5d).

See https://github.com/rancher/convoy/blob/master/docs/ebs.md#create

Just use --id parameter to create the convoy volume because use it in the host, it should work.