3

Is there a way to specify the mfsymlinks option when mounting an Azure Files share to an ACI container instance?

As shown on learn.microsoft.com symlinks can be supported in Azure Files when mounted in Linux with this mfsymlinks option enabling Minshall+French symlinks.

I would like to use an Azure Files share mounted to an Azure Container Instance but I need to be able to use symlinks in the mounted file system, but I cannot find a way to specify this. Does anyone know of a way to do this?

Darran
  • 593
  • 2
  • 13

3 Answers3

2

As a workaround that suits my use case, once the file structure, including symlinks, has been created on the container's local FS, I tar up the files onto the Azure Files share: tar -cpzf /mnt/letsencrypt/etc.tar.gz -C / etc/letsencrypt/ Then when the container runs again, it extracts from the tarball, preserving the symlinks: tar -xzf /mnt/letsencrypt/etc.tar.gz -C /

I'll leave this open for now to see if ACI comes to support the option natively.

Darran
  • 593
  • 2
  • 13
  • 1
    I've raised a feature suggestion for this. See and add comments/vote here: https://feedback.azure.com/forums/602224-azure-container-instances/suggestions/36641311-allow-customisation-of-azure-file-cifs-mount-optio – Jason Royals Jan 26 '19 at 23:53
  • Cool work around, do you think `set -e` is enough to make sure the container fails to launch if there's an error un-tarring the file? edit2: Do you run this as part of the certbot deploy hook? – Yolo Perdiem Dec 28 '20 at 21:31
1

Unfortunately, as far as I know, when you create the container and mount the Azure File Share through the CLI command az container create with parameters such as

--azure-file-volume-account-key
--azure-file-volume-account-name
--azure-file-volume-mount-path
--azure-file-volume-share-name

You cannot set the symlinks as you want and there also no parameter for you to set it.

In addition, if you take a look at the Template for Azure Container Instance, then you can find that there no property shows the setting about symlinks. In my opinion, it means you cannot set the symlinks for Azure Container Instance as you want. Hope this will help you.

Charles Xu
  • 29,862
  • 2
  • 22
  • 39
  • what value should be enter for --azure-file-volume-mount-path? – Reza May 30 '19 at 02:36
  • @RezaRahmati I think all the path inside the container is available. Not sure, but it describes [here](https://learn.microsoft.com/en-us/cli/azure/container?view=azure-cli-latest#az-container-create). – Charles Xu May 30 '19 at 02:41
1

Update from Azure docs (azure-files-volume#mount-options):

apiVersion: v1
kind: PersistentVolume
metadata:
  name: azurefile
spec:
  capacity:
    storage: 5Gi
  accessModes:
    - ReadWriteMany
  azureFile:
    secretName: azure-secret
    shareName: aksshare
    readOnly: false
  mountOptions:
  - dir_mode=0777
  - file_mode=0777
  - uid=1000
  - gid=1000
  - mfsymlinks
  - nobrl
Evgeniy
  • 367
  • 1
  • 4
  • 13