我已注册 Azure Files NFSv4 预览版,但似乎找不到在 ACI 上挂载 NFS 文件共享的方法。我尝试了以下方法:
- 在 Eastus 中创建了一个具有两个子网的虚拟网络,一个特定于 aci
- 将 NFS 存储帐户网络更改为仅允许来自上述 vnet 的连接:
- 使用以下 json 部署容器:
{ "type": "Microsoft.ContainerInstance/containerGroups", "apiVersion": "2019-12-01", "location": "eastus", "name": "nfs-test", "properties": { "osType": "Linux", "containers": [ { "name": "sshd", "properties": { "image": "boldidea.azurecr.io/ssh-test", "ports": [ { "port": 22, "protocol": "TCP" } ], "resources": { "requests": { "cpu": 1, "memoryInGB": 1.5 } }, "volumeMounts": [ { "mountPath": "/mnt/user-storage", "name": "user-storage" } ] } } ], "volumes": [ { "azureFile": { "shareName": "ide-user-storage", "storageAccountKey": "(redacted)", "storageAccountName": "ideworkspacestoragenfs" }, "name": "user-storage" } ], "imageRegistryCredentials": [ { "server": "(redacted)", "username": "(redacted)", "password": "(redacted)" } ], "ipAddress": { "type": "Private", "ports": [ { "port": 22, "protocol": "TCP" } ] }, "networkProfile": { "id": "/subscriptions/(redacted)/resourceGroups/ideResourceGroup/providers/Microsoft.Network/networkProfiles/aci-network-profile-ide-vnet-eastus-aci" } } }
部署挂起大约 30 分钟,然后出现错误“无法挂载 Azure 文件卷”。我究竟做错了什么?
我通过 Azure 支持解决了这个问题,最后找到了 ACI 团队,他们确认容器实例当前不支持 NFS。