microsoft / service-fabric

Service Fabric is a distributed systems platform for packaging, deploying, and managing stateless and stateful distributed applications and containers at large scale.
https://docs.microsoft.com/en-us/azure/service-fabric/
MIT License
3.03k stars 399 forks source link

Azure Service Fabric file mount on linux docker containers #503

Open brechtvhb opened 4 years ago

brechtvhb commented 4 years ago

Hello,

On my test & staging environment I managed to mount an azure file share. I followed this procedure: https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-containers-volume-logging-drivers

I can't get it to work on my production cluster however. Which is weird as everything is automated through ARM templates / DevOps.

I have no clue about where I should look foor log files that can help me. This is the errror I am getting: 'System.Hosting' reported Error for property 'CodePackageActivation:Code:EntryPoint:132253608762086366'. There was an error during CodePackage activation.Service host failed to activate. Error:FABRIC_E_INVALID_OPERATION

When I remove the mount in my ApplicationManifest.xml I can start the application. Anyone who can point me in the right direction?

gkhanna79 commented 4 years ago

Hi @brechtvhb

Can you please confirm that docker is installed and works as expected in the production cluster and that the AzureFileDisk VolumeDriver service is in healthy state before your application is deployed?

CC @wangcai0124

brechtvhb commented 4 years ago

Docker is installed as the container starts when I remove the directive. The AzureFileDisk is also in a healthy state before the app is being deployed.

If you want to, I can give you the resourceID of our cluster, with 1 application in this state.

wangcai0124-zz commented 4 years ago

Please share resourceID and region that we can look at SF trace.

brechtvhb commented 4 years ago

I sent them to gkhanna79 2 weeks ago as I can't find your e-mail address but haven't gotten response since.

gkhanna79 commented 4 years ago

@brechtvhb Are you trying this on Windows host OS or Linux host OS? SF does not support Linux containers on Windows host OS.

brechtvhb commented 4 years ago

Host OS is Ubuntu.

brechtvhb commented 4 years ago

Still no progress on this one?

brechtvhb commented 4 years ago

I just found out that when I run this command sudo docker container run -it -v azfiles:/mnt/services busybox sh

I get this error: error while mounting volume '': mount failed:/bin/mount complete with exit code 32. Output: Error:mount error(13): Permission denied Refer to the mount.cifs(8) manual page (e.g. man mount.cifs).

What output should I excpect when running the command sudo docker volume inspect azfiles

here's what i get right now

[
    {
        "CreatedAt": "0001-01-01T00:00:00Z",
        "Driver": "sfazurefile",
        "Labels": null,
        "Mountpoint": "",
        "Name": "azfiles",
        "Options": {
            "shareName": "services",
            "storageAccountKey": "xxx",
            "storageAccountName": "xxx"
        },
        "Scope": "global"
    }
]

Mounting the folder directly within ubuntu does work, so it does not seem to be a network related issue. Command used

sudo sudo mount -t cifs //xxx.file.core.windows.net/services /mnt/testazfiles -o vers=3.0,username=xxx,password=xxx,dir_mode=0777,file_mode=0777,serverino

Manualy creating the docker volume seems to make it work too sudo docker volume create --driver sfazurefile --opt shareName=services --opt storageAccountKey=xxx --opt storageAccountName=xxx azfiles

The output of the inspect is slightly diffirent. Note the labels property

[
    {
        "CreatedAt": "0001-01-01T00:00:00Z",
        "Driver": "sfazurefile",
        "Labels": {},
        "Mountpoint": "",
        "Name": "azfiles",
        "Options": {
            "shareName": "services",
            "storageAccountKey": "xxx",
            "storageAccountName": "xxx"
        },
        "Scope": "global"
    }
]