[英]RelativeMountPath under Azure Batch Pool
What value do I need to provide for RelativeMountPath to mount a file share to the batch pool with windows compute nodes?我需要为 RelativeMountPath 提供什么值才能使用 Windows 计算节点将文件共享装载到批处理池?
https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.management.batchai.models.azurefilesharereference.relativemountpath?view=azure-dotnet https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.management.batchai.models.azurefilesharereference.relativemountpath?view=azure-dotnet
As per the documentation, it says " The relative path on the compute node where the file system will be mounted "根据文档,它说“将挂载文件系统的计算节点上的相对路径”
Currently, I get "MountConfigurationException: Incorrect invocation or permissions" error, when it adds a node to the pool.目前,当它向池中添加节点时,我收到“MountConfigurationException:不正确的调用或权限”错误。
I tried using both powershell and C# code.我尝试同时使用 powershell 和 C# 代码。 In both scenarios, it didnt work.
在这两种情况下,它都不起作用。 Below is the C# code
下面是C#代码
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;
}
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.请注意您使用的API 是
BatchAI
API, azure-batch
也有一个单独的 API,我也会修复标签。 I wanted to clear that first before answering to your post :)
在回答你的帖子之前,我想先弄清楚这一点
:)
for completeness I will mention the Azue-batch vanilla mount API below with detail and link.为了完整起见,我将在下面提到 Azue-batch vanilla mount API 的详细信息和链接。
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 ie 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
关于
BatchAI
API,我认为它与批处理 vanilla api 相同,其中RelativeMountPath
是使用环境变量可访问的文件夹的相对目录结构,即AZ_BATCHAI_MOUNT_ROOT + <dir_name_supplied>
例如:如果您提供相对挂载目录名称作为 foo 那么在批处理级别成功创建池后,将可以通过以下方式访问挂载目录: AZ_BATCHAI_MOUNT_ROOT\\foo
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.进一步访问环境变量的详细信息如下: https : //docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables#command-line-expansion-of-environment-variables就像在 Windows 中一样您可以通过
%MY_ENV_VAR%
等访问。 al.阿尔。
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.此外,
MountConfigurationException: Incorrect invocation or permissions
表示您提供了错误信息,导致配置错误,因此批处理返回权限错误。 The document mentioned above should be able to guide.上面提到的文件应该可以指导。
OR Extra information about separate batch level API或有关单独批次级别 API 的额外信息
Azure-Batch Vanilla mount API (Note: You are not using this but I am giving this information just as fyi) Azure-Batch Vanilla mount API(注意:您没有使用它,但我只是提供此信息仅供参考)
This document has good detail to start with,Mount virtual file system on a pool .这个文档有很好的细节作为开始,在池上安装虚拟文件系统。
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.:ie对于这个特定的 API 在 azurefile 系统的 mount 中,
RelativeMountPath
对于通过AZ_BATCH_NODE_MOUNTS_DIR
环境变量在节点上访问的标准fsmounts
目录创建的目录结构的RelativeMountPath
的上下文。: AZ_BATCH_NODE_MOUNTS_DIR
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
.相对挂载路径或来源:在计算节点上挂载的文件系统的位置,相对于通过
AZ_BATCH_NODE_MOUNTS_DIR
在节点上访问的标准 fsmounts 目录。 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 tomnt\\resources\\batch\\tasks\\fsmounts
.例如,Ubuntu 节点上的物理位置映射到
mnt\\batch\\tasks\\fsmounts
,而在 CentOS 节点上它映射到mnt\\resources\\batch\\tasks\\fsmounts
。
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在 Windows 节点中,它将位于
fsmounts
寡妇级别文件目录中的fsmounts
更多详细信息或环境变量在这里https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables
This should be able to guide you to right direction.这应该能够引导您走向正确的方向。 Thanks!
谢谢!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.