kiranchavala commented on issue #249: URL: https://github.com/apache/cloudstack-terraform-provider/issues/249#issuecomment-3416229301
Thanks @ilsaloving-gander was able to reproduce the issue @Pearl1594 can you take a look at this issue Steps to reproduce the issue 1. Have a cloudstack env with 2 different traffic types <img width="1151" height="244" alt="Image" src="https://github.com/user-attachments/assets/9068ef48-247d-4176-b808-8bca44175951" /> ``` (localcloud) 🐱 > list traffictypes physicalnetworkid=79213e81-1498-45f6-ae02-02524c3b9831 { "count": 2, "traffictype": [ { "id": "d952bc43-214d-4df6-addb-b055d2a842b2", "kvmnetworklabel": "cloudbr0", "physicalnetworkid": "79213e81-1498-45f6-ae02-02524c3b9831", "traffictype": "Management", "vmwarenetworklabel": "vSwitch0,,vmwaresvs", "xennetworklabel": "Network0" }, { "id": "d2d1c8f7-ae4f-45f4-9b29-e3f45ed8d0d9", "kvmnetworklabel": "cloudbr0", "physicalnetworkid": "79213e81-1498-45f6-ae02-02524c3b9831", "traffictype": "Storage", "vmwarenetworklabel": "vSwitch0,,vmwaresvs", "xennetworklabel": "Network0" } ] } ``` 2. Have a terraform config ``` resource "cloudstack_traffic_type" "management" { physical_network_id = "79213e81-1498-45f6-ae02-02524c3b9831" type = "Storage" kvm_network_label = "cloudbr0" xen_network_label = "xenbr0" vmware_network_label = "VM Network" } ``` 3. Apply terraform import ``` TF_LOG=DEBUG terraform import cloudstack_traffic_type.management "d2d1c8f7-ae4f-45f4-9b29-e3f45ed8d0d9" 2025-10-17T21:39:52.251+0530 [INFO] Terraform version: 1.12.1 2025-10-17T21:39:52.251+0530 [DEBUG] using github.com/hashicorp/go-tfe v1.74.1 2025-10-17T21:39:52.251+0530 [DEBUG] using github.com/hashicorp/hcl/v2 v2.23.1-0.20250203194505-ba0759438da2 2025-10-17T21:39:52.251+0530 [DEBUG] using github.com/hashicorp/terraform-svchost v0.1.1 2025-10-17T21:39:52.251+0530 [DEBUG] using github.com/zclconf/go-cty v1.16.2 2025-10-17T21:39:52.251+0530 [INFO] Go runtime version: go1.24.2 2025-10-17T21:39:52.251+0530 [INFO] CLI args: []string{"terraform", "import", "cloudstack_traffic_type.management", "d2d1c8f7-ae4f-45f4-9b29-e3f45ed8d0d9"} 2025-10-17T21:39:52.251+0530 [DEBUG] Attempting to open CLI config file: /Users/kiranchavala/.terraformrc 2025-10-17T21:39:52.251+0530 [DEBUG] File doesn't exist, but doesn't need to. Ignoring. 2025-10-17T21:39:52.252+0530 [DEBUG] checking for credentials in "/Users/kiranchavala/.terraform.d/plugins" 2025-10-17T21:39:52.252+0530 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins 2025-10-17T21:39:52.252+0530 [DEBUG] will search for provider plugins in /Users/kiranchavala/.terraform.d/plugins 2025-10-17T21:39:52.252+0530 [DEBUG] ignoring non-existing provider search directory /Users/kiranchavala/Library/Application Support/io.terraform/plugins 2025-10-17T21:39:52.252+0530 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins 2025-10-17T21:39:52.252+0530 [INFO] CLI command args: []string{"import", "cloudstack_traffic_type.management", "d2d1c8f7-ae4f-45f4-9b29-e3f45ed8d0d9"} 2025-10-17T21:39:52.286+0530 [DEBUG] checking for provisioner in "." 2025-10-17T21:39:52.291+0530 [DEBUG] checking for provisioner in "/opt/homebrew/bin" 2025-10-17T21:39:52.291+0530 [DEBUG] checking for provisioner in "/Users/kiranchavala/.terraform.d/plugins" 2025-10-17T21:39:52.295+0530 [DEBUG] Building and walking import graph 2025-10-17T21:39:52.296+0530 [DEBUG] Not attaching any node states: overall state is nil 2025-10-17T21:39:52.296+0530 [DEBUG] No state, no orphan outputs 2025-10-17T21:39:52.296+0530 [DEBUG] ProviderTransformer: "cloudstack_traffic_type.management (expand)" (*terraform.nodeExpandPlannableResource) needs provider["registry.terraform.io/cloudstack/cloudstack"] 2025-10-17T21:39:52.296+0530 [DEBUG] created provider logger: level=debug 2025-10-17T21:39:52.296+0530 [INFO] provider: configuring client automatic mTLS 2025-10-17T21:39:52.305+0530 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/cloudstack/cloudstack/0.6.0-rc3/darwin_arm64/terraform-provider-cloudstack args=[".terraform/providers/registry.terraform.io/cloudstack/cloudstack/0.6.0-rc3/darwin_arm64/terraform-provider-cloudstack"] 2025-10-17T21:39:52.308+0530 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/cloudstack/cloudstack/0.6.0-rc3/darwin_arm64/terraform-provider-cloudstack pid=84818 2025-10-17T21:39:52.308+0530 [DEBUG] provider: waiting for RPC address: plugin=.terraform/providers/registry.terraform.io/cloudstack/cloudstack/0.6.0-rc3/darwin_arm64/terraform-provider-cloudstack 2025-10-17T21:39:52.331+0530 [INFO] provider.terraform-provider-cloudstack: configuring server automatic mTLS: timestamp="2025-10-17T21:39:52.331+0530" 2025-10-17T21:39:52.341+0530 [DEBUG] provider.terraform-provider-cloudstack: plugin address: address=/var/folders/2f/6r19_y2s5p92vdzq4l29n0lr0000gn/T/plugin732356607 network=unix timestamp="2025-10-17T21:39:52.341+0530" 2025-10-17T21:39:52.341+0530 [DEBUG] provider: using plugin: version=6 2025-10-17T21:39:52.361+0530 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF" 2025-10-17T21:39:52.362+0530 [INFO] provider: plugin process exited: plugin=.terraform/providers/registry.terraform.io/cloudstack/cloudstack/0.6.0-rc3/darwin_arm64/terraform-provider-cloudstack id=84818 2025-10-17T21:39:52.362+0530 [DEBUG] provider: plugin exited 2025-10-17T21:39:52.362+0530 [DEBUG] ReferenceTransformer: "cloudstack_traffic_type.management (expand)" references: [] 2025-10-17T21:39:52.362+0530 [DEBUG] ReferenceTransformer: "var.cloudstack_api_url" references: [] 2025-10-17T21:39:52.362+0530 [DEBUG] ReferenceTransformer: "var.cloudstack_api_key" references: [] 2025-10-17T21:39:52.362+0530 [DEBUG] ReferenceTransformer: "var.cloudstack_secret_key" references: [] 2025-10-17T21:39:52.362+0530 [DEBUG] ReferenceTransformer: "provider[\"registry.terraform.io/cloudstack/cloudstack\"]" references: [var.cloudstack_api_key var.cloudstack_api_url var.cloudstack_secret_key] 2025-10-17T21:39:52.363+0530 [DEBUG] Starting graph walk: walkImport 2025-10-17T21:39:52.363+0530 [DEBUG] created provider logger: level=debug 2025-10-17T21:39:52.363+0530 [INFO] provider: configuring client automatic mTLS 2025-10-17T21:39:52.367+0530 [DEBUG] provider: starting plugin: path=.terraform/providers/registry.terraform.io/cloudstack/cloudstack/0.6.0-rc3/darwin_arm64/terraform-provider-cloudstack args=[".terraform/providers/registry.terraform.io/cloudstack/cloudstack/0.6.0-rc3/darwin_arm64/terraform-provider-cloudstack"] 2025-10-17T21:39:52.368+0530 [DEBUG] provider: plugin started: path=.terraform/providers/registry.terraform.io/cloudstack/cloudstack/0.6.0-rc3/darwin_arm64/terraform-provider-cloudstack pid=84819 2025-10-17T21:39:52.369+0530 [DEBUG] provider: waiting for RPC address: plugin=.terraform/providers/registry.terraform.io/cloudstack/cloudstack/0.6.0-rc3/darwin_arm64/terraform-provider-cloudstack 2025-10-17T21:39:52.381+0530 [INFO] provider.terraform-provider-cloudstack: configuring server automatic mTLS: timestamp="2025-10-17T21:39:52.381+0530" 2025-10-17T21:39:52.390+0530 [DEBUG] provider.terraform-provider-cloudstack: plugin address: address=/var/folders/2f/6r19_y2s5p92vdzq4l29n0lr0000gn/T/plugin3545733515 network=unix timestamp="2025-10-17T21:39:52.390+0530" 2025-10-17T21:39:52.390+0530 [DEBUG] provider: using plugin: version=6 2025-10-17T21:39:52.401+0530 [DEBUG] ReferenceTransformer: "cloudstack_traffic_type.management (import id \"d2d1c8f7-ae4f-45f4-9b29-e3f45ed8d0d9\")" references: [] cloudstack_traffic_type.management: Importing from ID "d2d1c8f7-ae4f-45f4-9b29-e3f45ed8d0d9"... cloudstack_traffic_type.management: Import prepared! Prepared cloudstack_traffic_type for import cloudstack_traffic_type.management: Refreshing state... [id=d2d1c8f7-ae4f-45f4-9b29-e3f45ed8d0d9] 2025-10-17T21:39:53.122+0530 [DEBUG] provider.stdio: received EOF, stopping recv loop: err="rpc error: code = Unavailable desc = error reading from server: EOF" 2025-10-17T21:39:53.125+0530 [INFO] provider: plugin process exited: plugin=.terraform/providers/registry.terraform.io/cloudstack/cloudstack/0.6.0-rc3/darwin_arm64/terraform-provider-cloudstack id=84819 2025-10-17T21:39:53.125+0530 [DEBUG] provider: plugin exited 2025-10-17T21:39:53.125+0530 [INFO] Writing state output to: Import successful! The resources that were imported are shown above. These resources are now in your Terraform state and will henceforth be managed by Terraform. ``` 4. The traffic type still shows as Mangement ``` terraform show # cloudstack_traffic_type.management: resource "cloudstack_traffic_type" "management" { id = "d2d1c8f7-ae4f-45f4-9b29-e3f45ed8d0d9" kvm_network_label = "cloudbr0" physical_network_id = "79213e81-1498-45f6-ae02-02524c3b9831" traffic_type = "Management" xen_network_label = "xenbr0" } ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
