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

Failed: Set labels of disk - in GCP #39

Closed pzi123 closed 2 years ago

pzi123 commented 3 years ago

While building Cloud-manger connector with provider version 21.3.0 in GCP the VM fails to build after trying to set label on created boot disk. The error message in activity log after successful disk creation is (replaced sensitive info with xxxxx...):

Failed: Set labels of disk

xxxxxxxxxxxxxxxxxx@cloudservices.gserviceaccount.com failed to set labels of disk xxxxxxx-dev-vm-disk-boot April 2, 2021 at 9:39:32 PM GMT-6

User xxxxxxxxxxxxxxxx@cloudservices.gserviceaccount.com

Resource name projects/xxxxxxxxxxxxxxxxx/zones/us-west1-a/disks/xxxxxxxxxxxx-vm-disk-boot

Error message Invalid argument (HTTP 400): Labels fingerprint either invalid or resource labels have changed

Response > error Code 412 Errors Errors 1 Domain global Location If-Match Location type header Message Labels fingerprint either invalid or resource labels have changed Reason conditionNotMet Message Labels fingerprint either invalid or resource labels have changed

pzi123 commented 3 years ago

After some debugging it turns out this disk labeling error is non-fatal and if the following steps complete the connector is working fine. It would be nice not to see this as it may be misleading.

lonico commented 3 years ago

Since this is an error reported in the log, this is not visible from the Terraform provider.

How were you setting the label on the boot disk? Could you show the Terraform resource file?

pzi123 commented 3 years ago

It is very basic:

pzi@pzi-s2-ub1:/zp0/arch/g/bld/gcp/cvo$ cat main.tf terraform { required_providers { netapp-cloudmanager = { source = "NetApp/netapp-cloudmanager" version = "21.3.0" } } }

provider "netapp-cloudmanager" { refresh_token = var.cloudmanager_refresh_token }

resource "netapp-cloudmanager_connector_gcp" "this" { provider = netapp-cloudmanager name = var.project_name project_id = var.project_id zone = var.zone company = "pzi" service_account_email = var.service_account_email service_account_path = var.service_account_path account_id = var.account_id }

pzi@pzi-s2-ub1:/zp0/arch/g/bld/gcp/cvo$ cat terraform.tfvars region = "us-west1" zone = "us-west1-a" project_name = "yyyy-???" project_id = "yyyy-?????" cloudmanager_refresh_token = "?????" service_account_email = "pz5-457@????????.iam.gserviceaccount.com" service_account_path = "/home/pzi/????????.json" account_id = "account-?????"

lonico commented 3 years ago

What is the error reported by the provider when running terraform apply?