【问题标题】:AzureFileShareConfiguration mount drive disconnectedAzureFileShareConfiguration 挂载驱动器已断开连接
【发布时间】:2020-10-19 18:31:03
【问题描述】:

我正在尝试使用 Azure Batch 创建一个池。我已使用文件共享将内容上传到 Azure 存储。 我希望我的池将此 Azure 文件共享挂载为虚拟文件系统(参考:https://docs.microsoft.com/en-us/azure/batch/virtual-file-mount#mount-a-virtual-file-system-on-a-pool)。

我正在使用代码创建 AzureFileShareConfiguration 对象:

   mount_configuration=batchmodels.MountConfiguration(azure_file_share_configuration=batchmodels.AzureFileShareConfiguration(
account_name="mystorage",
azure_file_url="https://mystorage.file.core.windows.net/my-share1",
account_key="mystorage/key==",
relative_mount_path="S"
)
)

使用这个,我在 fsmounts 中得到“CMDKEY: Credentials added successfully”。但是当我 RDP 到池中的节点时,S 驱动器出现“断开连接”。

我的 Azure 批处理包版本是: 天蓝色批处理==8.0.0 azure-common==1.1.24

您能否帮助诊断问题或建议正确的用法?

提前致谢!

【问题讨论】:

    标签: azure-storage azure-batch azure-storage-files


    【解决方案1】:

    relative_mount_path: 将挂载文件系统的计算节点上的相对路径。所有文件系统都相对于 Batch 挂载目录进行挂载,可通过 AZ_BATCH_NODE_MOUNTS_DIR 环境变量访问。

    Azure Files 是标准的 Azure 云文件系统产品。要详细了解如何获取挂载配置代码示例中的任何参数,请参阅使用Azure Files share

    【讨论】:

    【解决方案2】:

    我认为这是您正在尝试的 Windows VM?只需查看驱动器号: )

    这是 RDP 权限的关键问题,这与您的代码运行和挂载时的批处理级别模型不同。

    在批处理级别,当您挂载 Drive: 并且您可以通过您的 Start task 看到它时,它正在工作。即批处理级别的权限模型,当您 RDP 进入 Node 时,您将作为“用户”登录。如果您想通过 UI RDP 用户查看,您应该从您的 RDP 登录重新运行命令以更新您拥有查看该驱动器的密钥。

    虽然已经说过尝试使用 /persistent:Yes 作为 mount_options。

    • 最好的测试将是 -- 你挂载驱动器并从你的启动任务通过S:\\Whatever_file.txt 进入挂载目录或读取挂载文件,将结果添加到stdout.txt批处理节点或可能只是 dir 它或其他东西。

    下面还有额外的东西

    试试这个mount_options value

    特别是这将有助于各种 SMB 版本等。人。支持:https://docs.microsoft.com/en-us/azure/storage/files/storage-how-to-use-files-windows 我想你已经知道了:https://docs.microsoft.com/en-us/azure/batch/virtual-file-mount#azure-files-share

    为了在 Azure 区域之外使用 Azure 文件共享,它是 托管在(例如本地或不同 Azure 区域)的操作系统中 必须支持 SMB 3.0。

    因此,将其添加到您的 API 并尝试一下:

    MountOptions = "/persistent:Yes"mount_options = "/persistent:Yes"

    另外:密钥必须是存储帐户密钥,即它不应该以 mystorage/key :) 开头,但可能是你隐藏了它,所以只是提一下并供参考。

    示例代码:

    我认为你拥有的 SDK 是 python?

       mount_configuration=batchmodels.MountConfiguration(azure_file_share_configuration=batchmodels.AzureFileShareConfiguration(
         account_name="mystorage",
         azure_file_url="https://mystorage.file.core.windows.net/my-share1",
         account_key="mystorage/key==",
         relative_mount_path="S",
         mount_options = "/persistent:Yes"
    )
    

    希望这会有所帮助!

    【讨论】:

    • @Tat_innit 这看起来很有帮助,但现在我不再关注这个要求了。
    猜你喜欢
    • 2020-02-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-11-24
    • 1970-01-01
    • 2018-05-04
    • 2015-09-18
    相关资源
    最近更新 更多