0

I am trying to create a Pool using Azure Batch . I have uploaded content to Azure Storage using File Shares. I would like my Pool to mount this Azure File Share as virtual file system (ref: https://learn.microsoft.com/en-us/azure/batch/virtual-file-mount#mount-a-virtual-file-system-on-a-pool ).

I am creating AzureFileShareConfiguration object using code:

   mount_configuration=batchmodels.MountConfiguration(azure_file_share_configuration=batchmodels.AzureFileShareConfiguration(
account_name="mystorage",
azure_file_url="https://mystorage.file.core.windows.net/my-share1",
account_key="mystorage/key==",
relative_mount_path="S"
)
)

Using this, I get "CMDKEY: Credentials added successfully" in fsmounts. But when I RDP to the node in the pool, the S drive appears "Disconnected".

My Azure batch package versions are: azure-batch==8.0.0 azure-common==1.1.24

Can you please help diagnose the issue or suggest the right usage?

Thanks in Advance!

2 Answers 2

2

I think this is windows VM you are trying?, just by looking at the drive letter : ).

Here is the key issue with RDP permissions is different then your Batch level model when your code runs and mount.

At Batch level when you mount your Drive: and you can see it via your Start task then it is working. i.e. that a Batch level permissioning model and when you RDP into Node it will be as a "user" you are logged-in. If you want to see via UI RDP user you should re-run the command from your RDP login to update that you have key to see that drive.

Although having said that try it with /persistent:Yes as mount_options.

  • The best test is going to be -- You mount the drive and from your start task go to the mounted directory via : S:\\Whatever_file.txt or read the mounted file which will add the result in your stdout.txt of batch node or might be just dir it or something.

Rest extra stuff below

try with this mount_options value

Also specifically this will help for various SMB version et. al. support: https://learn.microsoft.com/en-us/azure/storage/files/storage-how-to-use-files-windows and I think this you already know : https://learn.microsoft.com/en-us/azure/batch/virtual-file-mount#azure-files-share

In order to use an Azure file share outside of the Azure region it is hosted in, such as on-premises or in a different Azure region, the OS must support SMB 3.0.

So add this to your API and give it a try:

MountOptions = "/persistent:Yes" i.e. mount_options = "/persistent:Yes"

Also: key needs to be Storage account Key, i.e. it should not start with mystorage/key :) but it could be you hiding it, so just a mention and fyi.

Sample code:

I think SDK you have is python?

   mount_configuration=batchmodels.MountConfiguration(azure_file_share_configuration=batchmodels.AzureFileShareConfiguration(
     account_name="mystorage",
     azure_file_url="https://mystorage.file.core.windows.net/my-share1",
     account_key="mystorage/key==",
     relative_mount_path="S",
     mount_options = "/persistent:Yes"
)

hope this helps!

1
  • 1
    @Tat_innit This looks helpful, but now I am no longer looking at that requirement. Aug 31, 2020 at 17:40
0

relative_mount_path: The relative path on the compute node where the file system will be mounted. All file systems are mounted relative to the Batch mounts directory, accessible via the AZ_BATCH_NODE_MOUNTS_DIR environment variable.

Azure Files is the standard Azure cloud file system offering. To learn more about how to get any of the parameters in the mount configuration code sample, see Use an Azure Files share.

1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.