citrix / terraform-provider-citrix

Terraform Provider for Citrix
https://registry.terraform.io/providers/citrix/citrix/latest
Apache License 2.0
45 stars 5 forks source link

[Bug] Writeback cache is causing inconsistent result after apply #124

Open AlanCitrix opened 3 days ago

AlanCitrix commented 3 days ago

Describe the bug

Summary of the issue

When provisioning_scheme.azure_machine_config.writeback_cache, getting errors when any of its booleans are False:

│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to citrix_machine_catalog.ndj-test-catalog-tenant, provider
│ "provider[\"registry.terraform.io/citrix/citrix\"]" produced an unexpected new value:
│ .provisioning_scheme.azure_machine_config.writeback_cache.persist_wbc: was cty.False, but now null.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵
╷
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to citrix_machine_catalog.ndj-test-catalog-tenant, provider
│ "provider[\"registry.terraform.io/citrix/citrix\"]" produced an unexpected new value:
│ .provisioning_scheme.azure_machine_config.writeback_cache.storage_cost_saving: was cty.False, but now null.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵
╷
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to citrix_machine_catalog.ndj-test-catalog-tenant, provider
│ "provider[\"registry.terraform.io/citrix/citrix\"]" produced an unexpected new value:
│ .provisioning_scheme.azure_machine_config.writeback_cache.persist_os_disk: was cty.False, but now null.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵
╷
│ Error: Provider produced inconsistent result after apply
│
│ When applying changes to citrix_machine_catalog.ndj-test-catalog-tenant, provider
│ "provider[\"registry.terraform.io/citrix/citrix\"]" produced an unexpected new value:
│ .provisioning_scheme.azure_machine_config.writeback_cache.persist_vm: was cty.False, but now null.
│
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

Versions

Terraform: 1.9.5 citrix/citrix provider: 1.0.3

Terraform configuration files

resource "citrix_machine_catalog" "test" {
...
            writeback_cache = {
                wbc_disk_storage_type = "Standard_LRS"
                writeback_cache_disk_size_gb = 127
                writeback_cache_memory_size_mb = 256
                persist_os_disk = false
                persist_vm = false
                storage_cost_saving = false
                persist_wbc = false
            }
...
}
TimBennett13 commented 2 days ago

Hello, I commented out the block for write back cache and ran the job again with the same error terraform-debug.log . I captured another log file and attached.

thanks, tim

AlanCitrix commented 2 days ago

Interesting. This is hard to debug because Terraform isn't returning what attribute is inconsistent when there's a nested sensitive attribute in the object. From what I can see in the logs there might be an issue with the network_mapping[0].network, but it looks good to me.

Are you able to try the same inputs with a non-domain joined catalog? Set provisioning_scheme.identity_type = "Workgroup" and remove provisioning_scheme.machine_domain_identity. I'm hoping that will let Terraform print all of the inconsistencies. That is how I was able to reproduce the error messages for write back cache that I put in the bug description.