簡體   English   中英

Azure 批處理池下的 RelativeMountPath

[英]RelativeMountPath under Azure Batch Pool

我需要為 RelativeMountPath 提供什么值才能使用 Windows 計算節點將文件共享裝載到批處理池?

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

根據文檔,它說“將掛載文件系統的計算節點上的相對路徑

目前,當它向池中添加節點時,我收到“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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM