Skip to content

Incorrect cachingType validation for Ultra disks as data disks #2429

@damdo

Description

@damdo

/kind bug

Preamble:
Azure Ultra disks only support un-cached read/writes, see Azure Ultra disks limitations.

What steps did you take and what happened:
An Azure Machine with the following data disk was created:

        - nameSuffix: mydata
          diskSizeGB: 256
          lun: 1
          managedDisk:
            storageAccountType: "UltraSSD_LRS"
          cachingType: ReadWrite

No validation error was observed when storageAccountType is was set to UltraSSD_LRS and cachingType to ReadOnly or ReadWrite or when no value is set for cachingType (this is currently defaulted to ReadWrite by the Defaulting Webhook).

Instead a failure was observed at vm creation time:

E0627 10:02:14.628416      45 controller.go:317] controller/azuremachine "msg"="Reconciler error" "error"="failed to reconcile AzureMachine: failed to reconcile AzureMachine service virtualmachine: failed to create resource default-11551/default-11551-control-plane-wbsz8 (service: virtualmachine): compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code=\"InvalidParameter\" Message=\"Storage Account type UltraSSD_LRS is not supported with caching type ReadWrite. Please use caching type None.\" Target=\"dataDisk.caching\"" "name"="default-11551-control-plane-wbsz8" "namespace"="default" "reconciler group"="infrastructure.cluster.x-k8s.io" "reconciler kind"="AzureMachine" 

What did you expect to happen:
When one or more data disks are defined with storageAccountType UltraSSD_LRS (the keyword for Ultra disks), no cachingType option should be accepted rather than: None.
If cachingType is not set or empty and storageAccountType is set to UltraSSD_LRS, cachingType should be defaulted to None.

Environment:

  • cluster-api-provider-azure version: v1.3.2
  • Kubernetes version: (use kubectl version): v1.23.x

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions