libopenstorage / openstorage

A multi-host clustered implementation of the open storage specification
Apache License 2.0
520 stars 118 forks source link

volume mount should take volume-name instead of Volume ID #11

Closed kunalkushwaha closed 8 years ago

kunalkushwaha commented 8 years ago

To mount volume created by is osd, VolumeID is required for reference. This can be fixed using lookup-function for volume-name which returns the volumeID from KVDB

Current Implementation.

$ sudo osd localfs create vol1
cfbb378d-1e0b-4321-8946-63cbb76ccd4d

$ docker run -it -v cfbb378d-1e0b-4321-8946-63cbb76ccd4d:/data --volume-driver localfs ubuntu bash

Expected behavior

$ sudo osd localfs create vol1
cfbb378d-1e0b-4321-8946-63cbb76ccd4d

$ docker run -it -v vol1:/data --volume-driver localfs ubuntu bash
jvinod commented 8 years ago

VolumeID is a string. The driver implementation generates a unique value to be used as the volume passed in to docker. We don't need two strings (volume ID and the proposed name) for the same purpose which is to uniquely identify a volume. In other words the ID and the name can be the same. Let's re-examine this in the context of https://github.com/libopenstorage/openstorage/issues/7

kunalkushwaha commented 8 years ago

I think unique VolumeID has its own role. ( volume-name + driver ) should be unique, but same volume-name can exist in different drivers.

Now, if osd mount volumes in same folder, lets say /var/lib/osd/mounts, volumeID will make each volume across the drivers unique on host machine.

yeah, I will next work on #7

gourao commented 8 years ago

Let us resolve the name and the ID confusion in the context of #7 - will that work for you @kunalkushwaha?

kunalkushwaha commented 8 years ago

Yes, I agree :+1:

kunalkushwaha commented 8 years ago

I see, with latest code volumes can be mounted with volume name also.

But current implementation introduces new bug.

The bug is , Data written in remains there, and are different. Mount either with volume-id and volume-name should map to same folder internally and same data should reflect in both cases.

jvinod commented 8 years ago

As it stands, it can only be mounted with the VolumeID string returned from volume.Create(..). Are you seeing something different?

kunalkushwaha commented 8 years ago

Sorry, My mistake, I was testing with some different code base.

gourao commented 8 years ago

Closing