gomorpheus / terraform-provider-morpheus

Terraform Morpheus provider
MIT License
17 stars 21 forks source link

bad management of service plan #209

Closed jigeay closed 7 months ago

jigeay commented 9 months ago

Hello, With this code :

`data "morpheus_price_set" "resource_price_set" { name = "Default Price Set" }

resource "morpheus_service_plan" "vmware" { for_each = var.vmware_plans name = each.key code = each.key active = true provision_type = "vmware" // Processors max_cores = each.value["cpu"] custom_cores = false cores_per_socket = 1

// Memory max_memory = each.value["ram"] memory_size_type = "mb" custom_memory = false

//Storage max_storage = 0 storage_size_type = "gb" customize_root_volume = true customize_extra_volumes = true add_volumes = true price_set_ids = [data.morpheus_price_set.resource_price_set.id] }`

it applies well and creates a service plan : image but when i try to use it in a working catalog, it does : image

If i get back to the ui, open the plan, and hit save, when i get back to the catalog : it works correctly.

Can you have a look on that ?

regards,

Matthieu

martezr commented 9 months ago

The cause of the issue is that the UI displays a value of 0 in the field but actually passes a null value to the system. The provider code has been updated to accommodate this by passing a null value if the max_disks_allowed is set to 0 or not defined. The fix will be available in the next release of the provider. A workaround in the interim is to define a non-zero value that is high enough that it is unlikely to be reached.

jigeay commented 9 months ago

thank you for the workaround : i will definitively do that 👍

martezr commented 7 months ago

This issue has been fixed in the latest release of the Terraform provider (v0.9.9)