RavinderReddyF5 / terraform-provider-bigip-version0.12

Terraform resources that can configure F5 BIGIP products
Mozilla Public License 2.0
0 stars 0 forks source link

[CLOSED] Unable to modify/update data group #279

Open RavinderReddyF5 opened 4 years ago

RavinderReddyF5 commented 4 years ago

Issue by wwftw Tuesday Feb 25, 2020 at 19:51 GMT Originally opened as https://github.com/terraform-providers/terraform-provider-bigip/issues/248


I don't know what prompted this change https://github.com/terraform-providers/terraform-provider-bigip/commit/ae9c44d9800d57356356349367ed5300c368034e but it appears to break updates to data group resource.

Error I'm getting:

An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
  ~ update in-place

Terraform will perform the following actions:

  # module.bigip_config.bigip_ltm_datagroup.datagroup["example-datagroup"] will be updated in-place
  ~ resource "bigip_ltm_datagroup" "datagroup" {
        id   = "/Common/example-datagroup"
        name = "/Common/example-datagroup"
        type = "string"

      - record {
          - name = "64" -> null
        }
      - record {
          - name = "dev" -> null
        }
      - record {
          - name = "pro" -> null
        }
      - record {
          - name = "sol" -> null
        }
      - record {
          - name = "sols" -> null
        }
      - record {
          - name = "t18" -> null
        }
      + record {
          + name = "64"
        }
      + record {
          + name = "dev"
        }
      + record {
          + name = "pro"
        }
      + record {
          + name = "sols"
        }
    }

Plan: 0 to add, 1 to change, 0 to destroy.

Do you want to perform these actions?
  Terraform will perform the actions described above.
  Only 'yes' will be accepted to approve.

  Enter a value: yes

module.bigip_config.bigip_ltm_datagroup.datagroup["example-datagroup"]: Modifying... [id=/Common/example-datagroup]

Error: Error modifying Data Group List /Common/example-datagroup: "type" may not be specified in the context of the "modify" command. "type" may be specified using the following commands: create, edit, list

  on .terraform/modules/bigip_config/f5_routing/main.tf line 26, in resource "bigip_ltm_datagroup" "datagroup":
  26: resource "bigip_ltm_datagroup" "datagroup" {

Releasing state lock. This may take a few moments...
RavinderReddyF5 commented 4 years ago

Comment by dannyk81 Tuesday Feb 25, 2020 at 20:05 GMT


https://github.com/terraform-providers/terraform-provider-bigip/pull/184

RavinderReddyF5 commented 4 years ago

Comment by dannyk81 Tuesday Feb 25, 2020 at 20:06 GMT


the fix was also tested on several version of BigIP and worked fine https://github.com/terraform-providers/terraform-provider-bigip/issues/180

what version do you have on your BigIP?

RavinderReddyF5 commented 4 years ago

Comment by wwftw Tuesday Feb 25, 2020 at 20:13 GMT


BIG-IP 13.0.0 Build 3.0.1679 Hotfix HF3

RavinderReddyF5 commented 4 years ago

Comment by wwftw Tuesday Feb 25, 2020 at 20:19 GMT


It looks like a non-passive change in BIG-IP 14?

RavinderReddyF5 commented 4 years ago

Comment by dannyk81 Wednesday Feb 26, 2020 at 01:45 GMT


I was only able to test it on 12.x.x and 14.x.x and it worked on both...

RavinderReddyF5 commented 4 years ago

Comment by papineni87 Wednesday Feb 26, 2020 at 14:15 GMT


I am able to see the issue on big 13.x.x

RavinderReddyF5 commented 4 years ago

Comment by dannyk81 Wednesday Feb 26, 2020 at 14:19 GMT


Looks like this API is very unstable on BigIP end and changes radically in behaviour between major versions...

@papineni87 is there a middle ground here that would work on all 3 supported majorversions?

RavinderReddyF5 commented 4 years ago

Comment by papineni87 Wednesday Feb 26, 2020 at 16:33 GMT


To port that REST API fix in bigip 13.x.x , customer SR should be raised so that it will work in all major versions. Another quick approach is cut new terraform provider minor release( 1.1.2 ) specific to big 13.x.x with old code and update in Read me, so that people can use that specific release for this particular issue ( Just a thought )

RavinderReddyF5 commented 4 years ago

Comment by dannyk81 Wednesday Feb 26, 2020 at 16:48 GMT


To port that REST API fix in bigip 13.x.x , customer SR should be raised so that it will work in all major versions. Another quick approach is cut new terraform provider minor release( 1.1.2 ) specific to big 13.x.x with old code and update in Read me, so that people can use that specific release for this particular issue ( Just a thought )

this is possible... but I would encourage against as you'll have to maintain two version trees and update both with any future change you introduce, otherwise it'll become stale.

we could perhaps retrieve the BigIP version in the Read and apply a different method based on the device version.

RavinderReddyF5 commented 4 years ago

Comment by papineni87 Thursday Feb 27, 2020 at 07:23 GMT


Yes, that makes sense only if it is just for this single rest API but it will be difficult to handle all the differences between various bigip versions.

@wwftw is it possible for you to upgrade bigip from 13.x.x to 14.x.x ? so that current code works for datagroups and you will be having new features in 14.x.x .

RavinderReddyF5 commented 4 years ago

Comment by wwftw Friday Feb 28, 2020 at 16:10 GMT


It would be good if this update function could handle different versions of BigIP API and passively handle the operation.

@papineni87 Unfortunately, it may take a while for us to get all of our instances to 14.x.x, we are still running BigIP 12.x.x in production (some instances on 11.x.x), we found the issue in development environment which is running 13.x.x

RavinderReddyF5 commented 4 years ago

Comment by papineni87 Saturday Feb 29, 2020 at 13:13 GMT


@wwftw That makes sense, we will try to check the bigip version in code and make respective function call

RavinderReddyF5 commented 4 years ago

Comment by papineni87 Thursday Mar 19, 2020 at 09:44 GMT


Fixed in latest release v1.1.2, @wwftw can you try it now

RavinderReddyF5 commented 4 years ago

Comment by wwftw Thursday Mar 19, 2020 at 16:57 GMT


@papineni87 I was able to test provider v1.1.2 on BigIP version 13.0.0, it works now!

Assuming this also works for BigIP 12 since looks like the non-passive change was introduced by BigIP 14.

RavinderReddyF5 commented 4 years ago

Comment by papineni87 Thursday Mar 19, 2020 at 17:02 GMT


Yes, i tested it on bigip 12 and it works