[英]RelativeMountPath under Azure Batch Pool
我需要为 RelativeMountPath 提供什么值才能使用 Windows 计算节点将文件共享装载到批处理池?
根据文档,它说“将挂载文件系统的计算节点上的相对路径”
目前,当它向池中添加节点时,我收到“MountConfigurationException:不正确的调用或权限”错误。
我尝试同时使用 powershell 和 C# 代码。 在这两种情况下,它都不起作用。 下面是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;
}
请注意您使用的API 是BatchAI
API, azure-batch
也有一个单独的 API,我也会修复标签。 在回答你的帖子之前,我想先弄清楚这一点:)
为了完整起见,我将在下面提到 Azue-batch vanilla mount API 的详细信息和链接。
关于BatchAI
API,我认为它与批处理 vanilla api 相同,其中RelativeMountPath
是使用环境变量可访问的文件夹的相对目录结构,即AZ_BATCHAI_MOUNT_ROOT + <dir_name_supplied>
例如:如果您提供相对挂载目录名称作为 foo 那么在批处理级别成功创建池后,将可以通过以下方式访问挂载目录: 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%
等访问。 阿尔。
此外, MountConfigurationException: Incorrect invocation or permissions
表示您提供了错误信息,导致配置错误,因此批处理返回权限错误。 上面提到的文件应该可以指导。
或有关单独批次级别 API 的额外信息
Azure-Batch Vanilla mount API(注意:您没有使用它,但我只是提供此信息仅供参考)
这个文档有很好的细节作为开始,在池上安装虚拟文件系统。
对于这个特定的 API 在 azurefile 系统的 mount 中, RelativeMountPath
对于通过AZ_BATCH_NODE_MOUNTS_DIR
环境变量在节点上访问的标准fsmounts
目录创建的目录结构的RelativeMountPath
的上下文。: AZ_BATCH_NODE_MOUNTS_DIR
相对挂载路径或来源:在计算节点上挂载的文件系统的位置,相对于通过
AZ_BATCH_NODE_MOUNTS_DIR
在节点上访问的标准 fsmounts 目录。 确切位置因节点上使用的操作系统而异。 例如,Ubuntu 节点上的物理位置映射到mnt\\batch\\tasks\\fsmounts
,而在 CentOS 节点上它映射到mnt\\resources\\batch\\tasks\\fsmounts
。
在 Windows 节点中,它将位于fsmounts
寡妇级别文件目录中的fsmounts
更多详细信息或环境变量在这里https://docs.microsoft.com/en-us/azure/batch/batch-compute-node-environment-variables
这应该能够引导您走向正确的方向。 谢谢!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.