.net Azure批处理池下的RelativeMontPath
我需要为RelativeMountPath提供什么值才能将文件共享装载到具有windows计算节点的批处理池 根据文档,它表示“将装入文件系统的计算节点上的相对路径” 当前,当向池中添加节点时,我收到“MountConfigurationException:错误的调用或权限”错误 我尝试使用powershell和C代码。在这两种情况下,它都不起作用。下面是C代码.net Azure批处理池下的RelativeMontPath,.net,azure,mount,azure-batch,.net,Azure,Mount,Azure Batch,我需要为RelativeMountPath提供什么值才能将文件共享装载到具有windows计算节点的批处理池 根据文档,它表示“将装入文件系统的计算节点上的相对路径” 当前,当向池中添加节点时,我收到“MountConfigurationException:错误的调用或权限”错误 我尝试使用powershell和C代码。在这两种情况下,它都不起作用。下面是C代码 私有静态void CreateBatchPool(BatchClient BatchClient,CloudServiceConfi
私有静态void CreateBatchPool(BatchClient BatchClient,CloudServiceConfiguration CloudServiceConfiguration)
{
CloudPool pool=batchClient.PoolOperations.CreatePool(
poolId:poolId,
目标专用计算机节点:PoolNodeCount,
虚拟机化:poolvmize,
TargetLowPriorityComputes:0,
cloudServiceConfiguration:cloudServiceConfiguration);
pool.maxstaskspercomputenode=8;
pool.ApplicationPackageReferences=CreateAppPackageReferences();
pool.TaskSchedulingPolicy=新任务调度策略(ComputeNodeFillType.Pack);
pool.MountConfiguration=新列表();
添加(新的挂载配置(CreateFileShareConfiguration(batchClient));
pool.Commit();
}
专用静态AzureFileShareConfiguration CreateFileShareConfiguration(BatchClient BatchClient)
{
字符串url=@“https://storage.file.core.windows.net/fileshare";
AzureFileShareConfiguration fileShareConfiguration=新的AzureFileShareConfiguration(StorageAccountName,url,“foo”,StorageAccountKey);
返回文件共享配置;
}
请注意,您使用的API是BatchAI
API,azure batch
也有一个单独的API,我也会修复标签。在回答你的帖子之前,我想先弄清楚这一点。:)
为了完整起见,我将在下面详细介绍Azue批量香草挂载API和链接
- 关于
API,我认为它与batch vanilla API相同,其中BatchAI
是文件夹的相对目录结构,可通过使用环境变量访问,即RelativeMountPath
例如:如果您提供相对装载目录名称作为foo然后,一旦在批处理级别成功创建了池,就可以通过以下方式访问装入的目录:AZ\u BatchAI\u MOUNT\u ROOT+
AZ\u BATCHAI\u MOUNT\u ROOT\foo
- 这里详细介绍了进一步访问环境变量:与windows一样,您可以通过
等访问环境变量%MY\u ENV\u VAR%
- 此外,
表示您提供了错误的信息,这导致配置错误,因此批处理返回权限错误。上述文件应能起到指导作用MountConfigurationException:error invocation或permissions
fsmounts
目录结构创建的RelativeMountPath
上下文,可通过AZ\u BATCH\u node\u MOUNTS\u DIR
环境变量在节点上访问目录
相对装载路径或源:装载的文件系统的位置
在计算节点上,相对于标准fsmounts目录
可通过AZ\u BATCH\u node\u MOUNTS\u DIR
在节点上访问。确切的
位置因节点上使用的操作系统而异。
例如,Ubuntu节点上的物理位置映射到
mnt\batch\tasks\fsmounts
,并在CentOS节点上映射到它
mnt\resources\batch\tasks\fsmounts
在windows节点中,它将位于fsmounts
的widows级别文件目录中的某个位置。更多详细信息或环境变量在此处
这应该能够引导你走向正确的方向。谢谢 请注意,您使用的API是
BatchAI
API,而且azure批处理
也有一个单独的API,我也会修复标签。在回答你的帖子之前,我想先弄清楚这一点。:)
为了完整起见,我将在下面详细介绍Azue批量香草挂载API和链接
- 关于
API,我认为它与batch vanilla API相同,其中BatchAI
是文件夹的相对目录结构,可通过使用环境变量访问,即RelativeMountPath
例如:如果您提供相对装载目录名称作为foo然后,一旦在批处理级别成功创建了池,就可以通过以下方式访问装入的目录:AZ\u BatchAI\u MOUNT\u ROOT+
AZ\u BATCHAI\u MOUNT\u ROOT\foo
- 这里详细介绍了进一步访问环境变量:与windows一样,您可以通过
等访问环境变量%MY\u ENV\u VAR%
- 此外,
表示您提供了错误的信息,这导致配置错误,因此批处理返回权限错误。上述文件应能起到指导作用MountConfigurationException:error invocation或permissions
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;
}