Azure / azure-rest-api-specs

The source for REST API specifications for Microsoft Azure.
MIT License
2.56k stars 5k forks source link

Type Mismatch: VirtualMachineScaleSet.virtualMachineProfile.storageProfile.diskControllerType: string vs string[] #25202

Open Navigatron opened 1 year ago

Navigatron commented 1 year ago

The Azure Rest API expects and returns a string value for the diskControllerType option on the storage profile for VM Scaleset VM profiles.

Documentation can be found here: https://github.com/Azure/azure-rest-api-specs/blob/main/specification/compute/resource-manager/Microsoft.Compute/ComputeRP/stable/2023-03-01/virtualMachineScaleSet.json#L4092

Public facing documentation specifies that this value should instead be a string[]: https://learn.microsoft.com/en-us/rest/api/compute/virtual-machine-scale-sets/create-or-update?tabs=HTTP#virtualmachinescalesetstorageprofile

As a result, downstream tools (Pulumi's azure-native provider) provide / expect a string array - and encounter an error when a string is provided back, or the provided string array is rejected.

Related Issue: https://github.com/pulumi/pulumi-azure-native/issues/2639

mikhailshilkov commented 1 year ago

The type is actually define as a string and as an array. I believe it's not correct:

"diskControllerType": {
  "type": "string",
  "items": {
    "$ref": "./computeRPCommon.json#/definitions/DiskControllerType",
    "description": "Specifies the disk controller type configured for the virtual machines in the scale set. **Note:** You need to deallocate the virtual machines in the scale set before updating its disk controller type based on the upgrade mode configured for the scale set. Minimum api-version: 2022-08-01."
  }
}