NetApp / terraform-provider-netapp-cloudmanager

Terraform provider to create NetAPP OCCM instances, CVO resources, volumes, snapshots, ... in Azure, AWS, GCP.
Mozilla Public License 2.0
17 stars 27 forks source link

Inconsistent TF state when adding an unsupported number of Google Persistent Disks to an existing aggregate #208

Open pablogarciaarevalo opened 1 week ago

pablogarciaarevalo commented 1 week ago

Cloud Volumes ONTAP supports up to 6 disks (persistent disks) per aggregate on Google Cloud https://docs.netapp.com/us-en/cloud-volumes-ontap-relnotes/reference-limits-gcp.html#aggregate-limits

Creating a new aggregate with an unsupported number of disks, for example 'number_of_disks = 7', fails as expected with the below error: code: 400, message: {"message":"Allowed number of disks is 1 to 6","causeMessage":"BadRequestException: Allowed number of disks is 1 to 6"

Trying to increase the number disks of an existent aggregate using an unsupported number of disks, it fails with the below error: Error: code: 400, message: {"message":"Aggregate disks limit of 6 will be exceeded","causeMessage":"BadRequestException: Aggregate disks limit of 6 will be exceeded"

So far so good, but the issue is that the Terraform state keeps the number_of_disks to the new unsupported value instead of the origin value. After that, trying to modify the number of disks with a supported number of disks , for example 'number_ofdisks = 5', it fails with the below error: 'Aggregate: number_ofdisks cannot be reduced'

Attached the terraform output enabling the debug mode. terraform_debug.txt