Azure / azurefile-dockervolumedriver

Docker Volume Driver for Azure File Service over SMB/CIFS :whale:
Apache License 2.0
169 stars 57 forks source link

Error when mounting volume to container #50

Closed garrardkitchen closed 8 years ago

garrardkitchen commented 8 years ago

Hi,

I have successfully followed all the install steps. I created the volume and I can see it via azure portal. However, when I come to attach volume to container it throws an exception. I'm using 16.04.1 LTS (Xenial Xerus) and VM is on premise.

Here's the output:

[garrard@SERVER133 util]$ sudo docker volume create -d azurefile --name myvol -o share=myvol2
myvol
[garrard@SERVER133 util]$ docker volume ls
DRIVER              VOLUME NAME
azurefile           myvol
[garrard@SERVER133 util]$ sudo docker run -i -t -v myvol:/data busybox
docker: Error response from daemon: VolumeDriver.Mount: mount failed: exit status 32
output="mount.cifs kernel mount options: ip=137.135.194.210,unc=\\\\saaaspocstorage.file.core.windows.net\\myvol2,vers=3.0,file_mode=0777,dir_mode=0777,uid=0,gid=0,user=saaaspocstorage,pass=********\nmount error(13): Permission denied\nRefer to the mount.cifs(8) manual page (e.g. man mount.cifs)\n".

What am I doing wrong?

Warmest regards,

Garrard.

ahmetb commented 8 years ago

@garrardkitchen can you please send systemctl status azurefile-dockervolumedriver and journalctl -au azurefile-dockervolumedriver

ahmetb commented 8 years ago

Oh wait, no need. This is happening because your distribution does not support SMB encryption and I bet your VM and the storage account are in different Azure regions (that's when the encryption is enforced). Some distros are starting to support SMB encryption but it is happening slowly.

Check this article and its comments for more info https://azure.microsoft.com/documentation/articles/storage-how-to-use-files-linux/ If you think this is the problem, please close the issue.

garrardkitchen commented 8 years ago

Hi @ahmetalpbalkan, the VM is from a local rack server and not an Azure VM. The Storage account is in the North Europe region and so am I (UK). I have successfully mounted several Azure Storage File Shares to PCs and at least one MBP in the UK so are you telling me that:

I appreciate your help.

Warmest regards,

Garrard.

ahmetb commented 8 years ago

is it just because I am mounting the file share to a Docker Volume?

no it is a limitation of the version of SMB shipped with your machine. In this case apparently your VM did not have new enough SMB/CIFS driver.

Please refer to the link I pasted above and search for encryption.

garrardkitchen commented 8 years ago

Hi @ahmetalpbalkan, I have cifs-utils 2:6.4-1ubuntu1 installed. If I try to install it again I get

cifs-utils is already the newest version (2:6.4-1ubuntu1)

So therefore I can't mount because SMB is lacking encryption and there just is no newer / other client I can install to get this working on Ubuntu?

Warmest regards,

Garrard.

ahmetb commented 8 years ago

@garrardkitchen I'm not familiar with distro supports on CIFS topic. I'm not sure what the latest version is, I just know that most distros are not there yet. Please feel free to raise a comment on the article I linked, folks are very responsive as you can see in the comments section of the article.

There is not much docker volume driver can do about this unfortunately, so closing this issue.

M3ssman commented 8 years ago

Sorry for re-commenting this Issue, but I run into a familiar Issue.

I think what @garrardkitchen was trying to explain is, that a Volume created within a VM from a local Computer an not hosted on Azure can't be mounted using the azurefile-dockervolumedriver.

When I create a Volume within a UbuntuVM on my local Windows PC (which I can do), I receive a Mounting Error each time I try to start a Docker Container within this Ubuntu VM that resides on my local PC:

docker: Error response from daemon: VolumeDriver.Mount: mount failed: exit status 32
output="mount.cifs kernel mount options: ip=40.68.232.28,unc=\\\\ka3dsfatbv7u4swarm0.file.core.windows.net\\teleport-ci-share,vers=3.0,file_mode=0777,dir_mode=0777,uid=0,gid=0,user=ka3dsfatbv7u4swarm0,pass=********\nmount error(13): Permission denied\nRefer to the mount.cifs(8) manual page (e.g. man mount.cifs)\n".
See 'docker run --help'.

BUT

When I'm on a LinuxVM hosted @ Azure I can use these Azurefile Volumes for mapping without any Problems.
I was even able to map an Azure File-Service Storage that I created forehand in my local UbuntuVM with the Docker-Container hosted by Azure.

ahmetb commented 8 years ago

@M3ssman I answered this above. https://github.com/Azure/azurefile-dockervolumedriver/issues/50#issuecomment-237600307

The issue is not about this driver. Your Linux distro does not support SMB encryption.