kiranchavala commented on PR #67:
URL: 
https://github.com/apache/cloudstack-terraform-provider/pull/67#issuecomment-3290493258

   > @kiranchavala - updates on these errors:
   > 
   > `cloudstack_secondary_storage`, did you terraform apply maintenance mode 
before running destroy? If you set the state on create to maintenance, its only 
available in the update API portion so a subsequent apply would resolve it. 
This is a limitation of the API.
   > 
   > Also, for the service provider error something deleted it. Did you happen 
to use `cloudstack_network_service_provider` and 
`cloudstack_network_service_provider_state` together? When creating a physical 
network many of the service providers are already created but in a disabled 
state.
   > 
   > `cloudstack_network_service_provider_state` was only meant to toggle them 
enabled/disabled. When destroying a service provider I set the provider to set 
it as disabled.
   > 
   > Here are the service providers I see created as part of a new initialized 
physical network.
   > 
   > ```json
   > {
   >     "listnetworkserviceprovidersresponse": {
   >         "count": 7,
   >         "networkserviceprovider": [
   >             {
   >                 "name": "ConfigDrive",
   >                 "physicalnetworkid": 
"220ed3ff-eb74-41b3-9547-e4995975e4e5",
   >                 "state": "Disabled",
   >                 "id": "5af78cb7-3486-4eaa-940f-3af93c4b1cc2",
   >                 "servicelist": [
   >                     "UserData"
   >                 ],
   >                 "canenableindividualservice": false
   >             },
   >             {
   >                 "name": "Tungsten",
   >                 "physicalnetworkid": 
"220ed3ff-eb74-41b3-9547-e4995975e4e5",
   >                 "state": "Disabled",
   >                 "id": "ad858b62-7935-404f-9469-a1a023503d51",
   >                 "servicelist": [
   >                     "Dhcp",
   >                     "Dns",
   >                     "Firewall",
   >                     "Lb",
   >                     "SourceNat",
   >                     "StaticNat",
   >                     "PortForwarding",
   >                     "SecurityGroup"
   >                 ],
   >                 "canenableindividualservice": true
   >             },
   >             {
   >                 "name": "InternalLbVm",
   >                 "physicalnetworkid": 
"220ed3ff-eb74-41b3-9547-e4995975e4e5",
   >                 "state": "Disabled",
   >                 "id": "262247b7-7366-4c07-ba3b-0be10192f464",
   >                 "servicelist": [
   >                     "Lb"
   >                 ],
   >                 "canenableindividualservice": true
   >             },
   >             {
   >                 "name": "BaremetalPxeProvider",
   >                 "physicalnetworkid": 
"220ed3ff-eb74-41b3-9547-e4995975e4e5",
   >                 "state": "Disabled",
   >                 "id": "76913e03-e263-4a54-be98-80c06b1580a6",
   >                 "servicelist": [],
   >                 "canenableindividualservice": false
   >             },
   >             {
   >                 "name": "VpcVirtualRouter",
   >                 "physicalnetworkid": 
"220ed3ff-eb74-41b3-9547-e4995975e4e5",
   >                 "state": "Disabled",
   >                 "id": "06113b93-f532-4002-9b3d-20787d7479b7",
   >                 "servicelist": [
   >                     "Vpn",
   >                     "Dhcp",
   >                     "Dns",
   >                     "Gateway",
   >                     "Lb",
   >                     "SourceNat",
   >                     "StaticNat",
   >                     "PortForwarding",
   >                     "UserData"
   >                 ],
   >                 "canenableindividualservice": true
   >             },
   >             {
   >                 "name": "SecurityGroupProvider",
   >                 "physicalnetworkid": 
"220ed3ff-eb74-41b3-9547-e4995975e4e5",
   >                 "state": "Disabled",
   >                 "id": "34a5dac1-1599-484a-9ded-7a54fa92593b",
   >                 "servicelist": [
   >                     "SecurityGroup"
   >                 ],
   >                 "canenableindividualservice": false
   >             },
   >             {
   >                 "name": "VirtualRouter",
   >                 "physicalnetworkid": 
"220ed3ff-eb74-41b3-9547-e4995975e4e5",
   >                 "state": "Enabled",
   >                 "id": "aa37a9cc-6638-4d72-a6b5-0da241df1e8d",
   >                 "servicelist": [
   >                     "Vpn",
   >                     "Dhcp",
   >                     "Dns",
   >                     "Gateway",
   >                     "Firewall",
   >                     "Lb",
   >                     "SourceNat",
   >                     "StaticNat",
   >                     "PortForwarding",
   >                     "UserData"
   >                 ],
   >                 "canenableindividualservice": true
   >             }
   >         ]
   >     }
   > }
   > ```
   > 
   > Here is my local destroy output.
   > 
   > ```shell
   > Terraform used the selected providers to generate the following execution 
plan. Resource actions are indicated with the following symbols:
   >   - destroy
   > 
   > Terraform will perform the following actions:
   > 
   >   # cloudstack_network_service_provider_state.virtualrouter will be 
destroyed
   >   - resource "cloudstack_network_service_provider_state" "virtualrouter" {
   >       - enabled             = true -> null
   >       - id                  = "d97959df-be50-4ec0-a888-ffc898d9b935" -> 
null
   >       - name                = "VirtualRouter" -> null
   >       - physical_network_id = "3eabff91-debb-42f0-bb97-63da296bc1b4" -> 
null
   >     }
   > 
   >   # cloudstack_physical_network.test will be destroyed
   >   - resource "cloudstack_physical_network" "test" {
   >       - broadcast_domain_range = "ZONE" -> null
   >       - id                     = "3eabff91-debb-42f0-bb97-63da296bc1b4" -> 
null
   >       - isolation_methods      = "VLAN" -> null
   >       - name                   = "test01" -> null
   >       - network_speed          = "1G" -> null
   >       - tags                   = "vlan" -> null
   >       - zone_id                = "8e1e5ae2-37dd-4215-a5cf-d6b223e94cba" -> 
null
   >         # (2 unchanged attributes hidden)
   >     }
   > 
   >   # cloudstack_zone.test will be destroyed
   >   - resource "cloudstack_zone" "test" {
   >       - allocation_state       = "Disabled" -> null
   >       - dhcp_provider          = "VirtualRouter" -> null
   >       - dns1                   = "8.8.8.8" -> null
   >       - dns2                   = "8.8.8.8" -> null
   >       - domain                 = "cloudstack.apache.org" -> null
   >       - id                     = "8e1e5ae2-37dd-4215-a5cf-d6b223e94cba" -> 
null
   >       - internal_dns1          = "8.8.4.4" -> null
   >       - internal_dns2          = "8.8.4.4" -> null
   >       - local_storage_enabled  = false -> null
   >       - name                   = "acctest" -> null
   >       - network_type           = "Advanced" -> null
   >       - security_group_enabled = false -> null
   >         # (4 unchanged attributes hidden)
   >     }
   > 
   > Plan: 0 to add, 0 to change, 3 to destroy.
   > 
   > Do you really want to destroy all resources?
   >   Terraform will destroy all your managed infrastructure, as shown above.
   >   There is no undo. Only 'yes' will be accepted to confirm.
   > 
   >   Enter a value: yes
   > 
   > cloudstack_network_service_provider_state.virtualrouter: Destroying... 
[id=d97959df-be50-4ec0-a888-ffc898d9b935]
   > cloudstack_network_service_provider_state.virtualrouter: Destruction 
complete after 0s
   > cloudstack_physical_network.test: Destroying... 
[id=3eabff91-debb-42f0-bb97-63da296bc1b4]
   > cloudstack_physical_network.test: Destruction complete after 0s
   > cloudstack_zone.test: Destroying... 
[id=8e1e5ae2-37dd-4215-a5cf-d6b223e94cba]
   > cloudstack_zone.test: Destruction complete after 0s
   > 
   > Destroy complete! Resources: 3 destroyed.
   > $ 
   > ```
   
   Thanks @poddm for the clarification


-- 
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]

Reply via email to