equinix / terraform-provider-metal

DEPRECATED Equinix Metal standalone TF provider. Use the unified Equinix Terraform Provider.
https://registry.terraform.io/providers/equinix/equinix/latest/docs/guides/migration_guide_equinix_metal
Mozilla Public License 2.0
14 stars 11 forks source link

metal_device read does not import deployed_hardware_reservation_id correctly #166

Closed displague closed 3 years ago

displague commented 3 years ago

When importing a device which was deployed with a hardware reservation, the device hardware_reservation field only included { "href": "... }. The deployed_hardware_reservation_id was imported as "" rather than the actual ID.

The last change that affects this was in v2.1.0:

https://github.com/equinix/terraform-provider-metal/commit/ac3d51fd275d0ed813c41c9c32d42fc8eef4b7a9#diff-5df9df8428506bc7c56a65c2dd8142d3de585470a98954dc825f5c51f09a8195R499-R502

I suspect the Device.Get needs to Include the hardware reservation details.

displague commented 3 years ago

If we have any "next-available" tests, we should add an import step to test deployed_hardware_reservation_id is stable after refresh/import.

enkelprifti98 commented 3 years ago

@displague I can confirm that this also happens when migrating from packet provider 3.2.1 which has the "deployed_hardware_reservation_id" field set to the correct UUID to equinix metal provider, then running terraform refresh will set the "deployed_hardware_reservation_id" to an empty string "".