Код: Выделить всё
storage_profile = {
"os_disk": {
"os_type": os_type,
"name": "myVMosdisk",
"createOption": "Attach",
"caching": "ReadWrite",
"managed_disk": {
"storage_account_type": storage_account_type
},
"disk_size_gb": data_disks[0]['disk_size_gb'],
},
"image_uri": get_custom_vhd_uri(portal_id),
"data_disks": data_disks[1:]
}
vm = compute_client.virtual_machines.begin_create_or_update(
GROUP_NAME,
VIRTUAL_MACHINE_NAME,
{
"location": armRegionName,
"tags": instance_tags,
"hardware_profile": {
"vm_size": "Standard_" + instance.replace(" ", "_")
},
"storage_profile": storage_profile,
"os_profile": {
"admin_username": username,
"computer_name": hostname,
"admin_password": password,
"windows_configuration": {
"enable_automatic_updates": True # need automatic update for reimage
}
},
"network_profile": {
"network_interfaces": [
{
"id": "/subscriptions/" + SUBSCRIPTION_ID + "/resourceGroups/" + GROUP_NAME + "/providers/Microsoft.Network/networkInterfaces/" + INTERFACE_NAME + "",
# "id": NIC_ID,
"properties": {
"primary": True
}
}
]
}
}
).result()
< /code>
Теперь я получаю: < /p>
error = (InvalidParameter) Required parameter 'osDisk.managedDisk.id' is missing (null).
Code: InvalidParameter
Message: Required parameter 'osDisk.managedDisk.id' is missing (null).
Target: osDisk.managedDisk.id
Подробнее здесь: https://stackoverflow.com/questions/794 ... disk-id-to