0

我在创建磁盘之后创建了一个共享磁盘,当我尝试将其附加到 VM更新 VM时,我得到 createOption 无法更改。以下是完整的错误,

Disk attachment failed, request response is - {
  "error": {
    "code": "PropertyChangeNotAllowed",
    "message": "Changing property 'dataDisk.createOption' is not allowed.",
    "target": "dataDisk.createOption"
  }

创建数据磁盘的请求正文(请注意这是共享磁盘),

{
  "location": LOCATION,
  "sku": {
    "name": "Premium_LRS"
  },
  "properties": {
    "creationData": {
      "createOption": "empty"
    },
    "osType": "linux",
    "diskSizeGB": SIZE,
    "maxShares": 5,
    "networkAccessPolicy": "AllowAll"
  }
}

VM 补丁请求的请求正文,

{
  "properties": {
    "storageProfile": {
      "dataDisks": [
      {
        "caching" : "ReadOnly",
        "createOption": "Attach",
        "lun": 0,
        "managedDisk" : {
          "id": disk_id,  //-> this disk_id is id of the created disk above
          "storageAccountType": "Premium_LRS"
        }
      }
      ]
    }
  }
}

有人可以指出我做错了什么。我没有通过 API找到很多关于共享磁盘附件的文档。

4

1 回答 1

0

如我所见,更新 V​​M 的请求正文没有问题。我现在试了一下,效果很好。我使用与您相同的请求正文。因此,您需要再次检查磁盘,例如lun0 是否已在使用中。

于 2021-03-16T06:56:49.153 回答