我正在使用现有映像通过ARM模板在Azure中创建一个VM。该映像已具有数据风险。在创建虚拟机时,我正在尝试通过ARM模板添加额外的数据盘。我可以这样做吗?我得到下面列出的错误:-
Can not add property dataDisks to Newtonsoft.Json.Linq.JObject. Property with the same name already exists on object发布于 2020-10-16 15:06:54
如果您的映像已经有数据磁盘,那么当您通过ARM模板创建VM时,您还需要为现有的数据磁盘配置datadisk块。只需用值fromImage设置createOption即可。然后像往常一样设置附加数据盘。例如,您的镜像有一个数据盘,而您还需要附加另一个数据盘,那么dataDisk块将如下所示:
"dataDisks": [
{
"lun": 0,
"createOption": "fromImage",
"caching": "ReadOnly",
"writeAcceleratorEnabled": false,
"id": null,
"name": null,
"storageAccountType": "Premium_LRS",
"diskSizeGB": null,
"diskEncryptionSet": null
},
{
"lun": 1,
"createOption": "attach",
"caching": "None",
"writeAcceleratorEnabled": false,
"id": null,
"name": "azurevm_DataDisk_1",
"storageAccountType": null,
"diskSizeGB": null,
"diskEncryptionSet": null
}
]这只是一个例子,你可以根据需要改变值,对你来说最重要的是createOption。第一个是对于现有的数据盘,相同的类型,其他东西也应该与镜像中的相同。
https://stackoverflow.com/questions/64278817
复制相似问题