Using CloudStor to mount an EFS volume to a container

Is it possible to use CloudStor outside of a Swarm? I’d like to be able to store data from a container on a stand-alone docker host on an EFS volume.

I think there are a couple good options for that use case, for example this one: https://store.docker.com/plugins/rex-ray-for-aws-efs

@jicowan Another option if you want lots of volumes is to set up the EFS and mount targets (in each AZ that the swarm nodes span over) and install Cloudstor (on each node of the swarm) and point it to the EFS ID:

docker plugin install --alias cloudstor:aws --grant-all-permissions docker4x/cloudstor:17.06.0-ce-aws2 CLOUD_PLATFORM=AWS AWS_REGION=[region] AWS_STACK_ID=[any_string] EFS_SUPPORTED=1 EFS_ID_REGULAR=[EFS_ID] DEBUG=1

Thanks @ddebroy. I was trying to avoid using Swarm.

I missed that bit. In any case, the above should work outside of a swarm too i.e. in a stand alone fashion. Just make sure the mount target for the EFS is set up so that the Docker host can access and mount the EFS.

This won’t work. There appears to be a bug in the installation setup where the EFS_ID_REGULAR value isn’t read properly when creating the mount.

@jicowan Another option if you want lots of volumes is to set up the EFS and mount targets (in each AZ that the swarm nodes span over) and install Cloudstor (on each node of the swarm) and point it to the EFS ID:

docker plugin install --alias cloudstor:aws --grant-all-permissions docker4x/cloudstor:17.06.0-ce-aws2 CLOUD_PLATFORM=AWS AWS_REGION=[region] AWS_STACK_ID=[any_string] EFS_SUPPORTED=1 EFS_ID_REGULAR=[EFS_ID] DEBUG=1

Just saw the bug report @ https://github.com/docker/for-aws/issues/98

1 Like

@ddebroy Thanks for looking. I’m not sure, but perhaps if there was a way to set EnableCloudStorEfs to “yes” when creating a swarm via Docker Cloud that would help.

For those landing here, a workaround was recommended by @ddebroy at https://github.com/docker/for-aws/issues/98 that worked for me: To avoid errors while enabling/installing cloudstor:aws with EFS support, make sure to set both EFS_ID_REGULAR and EFS_ID_MAXIO for the install scripts to succeed. If you do not need two EFS, create them anyway and just ignore one. AWS will not charge you for an unused EFS.

2 Likes