Azure 批处理池下的 RelativeMountPath [英] RelativeMountPath under Azure Batch Pool

查看:98
本文介绍了Azure 批处理池下的 RelativeMountPath的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要为 RelativeMountPath 提供什么值才能将文件共享装载到具有 Windows 计算节点的批处理池?

What value do I need to provide for RelativeMountPath to mount a file share to the batch pool with windows compute nodes?

https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.management.batchai.models.azurefilesharereference.relativemountpath?view=azure-dotnet

根据文档,它说将挂载文件系统的计算节点上的相对路径"

目前,当它向池中添加节点时,我收到MountConfigurationException:不正确的调用或权限"错误.

Currently, I get "MountConfigurationException: Incorrect invocation or permissions" error, when it adds a node to the pool.

我尝试同时使用 powershell 和 C# 代码.在这两种情况下,它都不起作用.下面是C#代码

I tried using both powershell and C# code. In both scenarios, it didnt work. Below is the C# code

private static void CreateBatchPool(BatchClient batchClient, CloudServiceConfiguration cloudServiceConfiguration)
        {
                CloudPool pool = batchClient.PoolOperations.CreatePool(
                    poolId: PoolId,
                    targetDedicatedComputeNodes: PoolNodeCount,
                    virtualMachineSize: PoolVMSize,
                    targetLowPriorityComputeNodes: 0,
                    cloudServiceConfiguration: cloudServiceConfiguration);
                pool.MaxTasksPerComputeNode = 8;
                pool.ApplicationPackageReferences = CreateAppPackageReferences();
                pool.TaskSchedulingPolicy = new TaskSchedulingPolicy(ComputeNodeFillType.Pack);
                pool.MountConfiguration = new List<MountConfiguration>();
                pool.MountConfiguration.Add(new MountConfiguration(CreateFileShareConfiguration(batchClient)));

                pool.Commit();
}

            private static AzureFileShareConfiguration CreateFileShareConfiguration(BatchClient batchClient)
        {
            string url = @"https://storage.file.core.windows.net/fileshare";
            AzureFileShareConfiguration fileShareConfiguration = new AzureFileShareConfiguration(StorageAccountName, url, "foo", StorageAccountKey);
            return fileShareConfiguration;
        }

推荐答案

请注意您使用的 API 是 BatchAI API 和azure-batch 也有一个单独的 API,我也会修复这个标签.我想在回答你的帖子之前先清除它:)

Please note the API you are using is the BatchAI API and azure-batch has a separate API as well, I will fix the tag as well. I wanted to clear that first before answering to your post :)

为了完整起见,我将在下面提到 Azue-batch vanilla mount API 的详细信息和链接.

for completeness I will mention the Azue-batch vanilla mount API below with detail and link.

  • 关于 BatchAI API 我认为它与批处理 vanilla api 相同,其中 RelativeMountPath 是相对目录使用环境变量可访问的文件夹,即 AZ_BATCHAI_MOUNT_ROOT + <dir_name_supplied> 例如:如果您提供相对挂载目录名称作为 foo 那么一旦在批处理级别成功创建池,挂载目录将可以访问通过:AZ_BATCHAI_MOUNT_ROOT\foo

  • Regarding the BatchAI API I think it is same as the batch vanilla api where RelativeMountPath is the relative directory structure of the folder accessible by using the environment variable i.e. AZ_BATCHAI_MOUNT_ROOT + <dir_name_supplied> Say for example: if you supply relative mount directory name as foo then once pool is successfully created at the Batch Level the mounted directory will be accessible via : AZ_BATCHAI_MOUNT_ROOT\foo

进一步访问环境变量的详细信息如下:https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables#command-line-expansion-of-environment-variables 就像在 Windows 中一样,您可以通过 %MY_ENV_VAR% 等访问.其他.

further accessing environment variable is detailed here: https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables#command-line-expansion-of-environment-variables like in windows you can access via %MY_ENV_VAR% et. al.

此外,MountConfigurationException: Incorrect invocation or permissions 表示您提供了错误信息,导致配置错误,因此批处理返回权限错误.上面提到的文档应该可以引导.

Further, the MountConfigurationException: Incorrect invocation or permissions represent that you have supplied wrong information which is causing the mis-configuration hence batch is returning the permission error. The document mentioned above should be able to guide.

OR 关于单独批处理级 API 的额外信息

Azure-Batch Vanilla mount API(注意:你没有使用这个,但我只是给这个信息仅供参考)

Azure-Batch Vanilla mount API (Note: You are not using this but I am giving this information just as fyi)

这个文档有很好的细节开始,Mount virtual池中的文件系统.

This document has good detail to start with, Mount virtual file system on a pool.

对于这个特定的 API 在 azurefile 系统的 mount 中,RelativeMountPath 的上下文是相对于通过 AZ_BATCH_NODE_MOUNTS_DIR 在节点上访问的标准 fsmounts 目录创建的目录结构代码>环境变量.:ie

For this specific API In mount for azurefile system the context of RelativeMountPath for directory structure created relative to standard fsmounts directory accessible on the node via AZ_BATCH_NODE_MOUNTS_DIR environment variable.:i.e.

相对挂载路径或源:文件系统挂载的位置在计算节点上,相对于标准 fsmounts 目录通过 AZ_BATCH_NODE_MOUNTS_DIR 在节点上访问.最正确位置因节点上使用的操作系统而异.例如,一个 Ubuntu 节点上的物理位置被映射到mnt\batch\tasks\fsmounts,并在 CentOS 节点上映射到mnt\resources\batch\tasks\fsmounts.

Relative mount path or Source: The location of the file system mounted on the compute node, relative to standard fsmounts directory accessible on the node via AZ_BATCH_NODE_MOUNTS_DIR. The exact location varies depending on the operating system used on the node. For example, the physical location on an Ubuntu node is mapped to mnt\batch\tasks\fsmounts, and on a CentOS node it is mapped to mnt\resources\batch\tasks\fsmounts.

在 Windows 节点中,它将位于 fsmounts 的寡妇级文件目录中的某个位置,更多详细信息或环境变量在此处 https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables

In windows nodes it will be somewhere at widows level file directory of fsmounts more details or environment variable is here https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables

这应该能够引导您走向正确的方向.谢谢!

This should be able to guide you to right direction. Thanks!

这篇关于Azure 批处理池下的 RelativeMountPath的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆