HewlettPackard / terraform-provider-oneview

Automates the provisioning of physical infrastructure from a private cloud using templates from HPE OneView with Terraform
Apache License 2.0
49 stars 30 forks source link

question about using oneview_logical_interconnect_group #493

Closed rismoney closed 2 years ago

rismoney commented 2 years ago

I have a resource oneview_logical_interconnect_group "lig_5frame", that I importe.d On it, there is an uplink set with 20 network_urls. If I add an additional url to the LIG, can it then idempotently update the logical enclosure?

Currenly I am not yet managing logical enclosures, but was wondering if I should import their configuration, and how the LE should trigger an inherit for the actual usage of the change. I want to be super cautious here and understand what works and doesn't, because there are dozens of machines that would be impacted by a LIG change.

nabhajit-ray commented 2 years ago

Hi Rismoney,

In the SDK, we have update from group example which shows how to trigger 'updatefrom group'

https://github.com/HewlettPackard/terraform-provider-oneview/blob/master/examples/logical_enclosures/update_resource.tf

We will test it and get back to you.

nabhajit-ray commented 2 years ago

We have tested it again . Once LE is in inconsistent state we can run update from group using below configuration:

resource "oneview_logical_enclosure" "LogicalEnclosure" { name = "LE" enclosure_uris = ["/rest/enclosures/0000000000A66101", "/rest/enclosures/0000000000A66102", "/rest/enclosures/0000000000A66103"] enclosure_group_uri = "/rest/enclosure-groups/7b178e4f-32bd-4584-8538-385f98ef3d80" update_type = "updateByGroup" }

This will bring the LE to an consistent state with the updated LIG

rismoney commented 2 years ago

will this be 0 changes (noop) when an LE is already consistent or after this is run 1x?

nabhajit-ray commented 2 years ago

Once you run the update using _updatetype = "updateByGroup" the LE will be consistent and for idempotency we have to remove _updatetype = "updateByGroup" from the configuration file during next run