Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bigipnext_cm_deploy_f5os // Terraform fails with client error after the initial successful run #45

Open
dgst77 opened this issue Dec 6, 2024 · 1 comment

Comments

@dgst77
Copy link

dgst77 commented Dec 6, 2024

Terraform Version

terraform -v
Terraform v1.9.8
on darwin_arm64

  • provider registry.terraform.io/f5networks/bigipnext v1.2.1
  • provider registry.terraform.io/f5networks/f5os v1.4.0
  • provider registry.terraform.io/hashicorp/vault v4.3.0

Affected Resource(s)

Please list the resources as a list, for example:

  • bigipnext_cm_deploy_f5os

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

terraform {
  required_version = ">= 1.5.7"

  required_providers {
    f5os = {
      source  = "f5networks/f5os"
      version = ">= 1.4.0"
    }
    bigipnext = {
      source  = "f5networks/bigipnext"
      version = "<1.2.2"
    }
    vault = {
      source  = "hashicorp/vault"
      version = "4.3.0"
    }
  }
}



provider "bigipnext" {
  username     = data.vault_generic_secret.e_username.data["e_username"]
  password     = data.vault_generic_secret.e_password.data["e_password"]
  host         = "https://1.1.1.1"
  # teem_disable = true
}


# add provider- provider1 to BIGIP NEXT CENTRAL MANAGER

resource "bigipnext_cm_provider" "rseries02" {
  name = "rseries01"
  type = "RSERIES"
  address = "1.1.1.1:443"
  username     = data.vault_generic_secret.qic-f5-username.data["username"]
  password     = data.vault_generic_secret.qic-f5-password.data["password"]

}


# add provider- provider2 to BIGIP NEXT CENTRAL MANAGER

resource "bigipnext_cm_provider" "rseries01" {
  name = "rseries02"
  type = "RSERIES"
  address = "1.1.1.2:443"
  username     = data.vault_generic_secret.qic-f5-username.data["username"]
  password     = data.vault_generic_secret.qic-f5-password.data["password"]

}


resource "bigipnext_cm_deploy_f5os" "lab-a-tier2-01" {
  f5os_provider = {
    provider_name = "rseries01"
    provider_type = "rseries"
  }
  instance = {
    instance_hostname = "labrseries01"
    management_address = "10.145.80.213"
    management_prefix = 22
    management_gateway = "10.145.80.1"
    management_user = "admin-cm"
    management_password = var.management_password_instance
    vlan_ids = [532, 542, 3902]
    tenant_image_name = "BIG-IP-Next-20.3.0-2.716.2+0.0.50"
    tenant_deployment_file = "BIG-IP-Next-20.3.0-2.716.2+0.0.50.yaml"
    cpu_cores = 4
    disk_size = 30
    slot_ids = [1]
  }
  depends_on =[bigipnext_cm_provider.rseries01, bigipnext_cm_provider.rseries02]
}


resource "bigipnext_cm_deploy_f5os" "lab-a-tier2-02" {
  f5os_provider = {
    provider_name = "rseries02"
    provider_type = "rseries"
  }
  instance = {
    instance_hostname = "labrseries02"
    management_address = "10.145.80.214"
    management_prefix = 22
    management_gateway = "10.145.80.1"
    management_user = "admin-cm"
    management_password = var.management_password_instance
    vlan_ids = [532, 542, 3902]
    tenant_image_name = "BIG-IP-Next-20.3.0-2.716.2+0.0.50"
    tenant_deployment_file = "BIG-IP-Next-20.3.0-2.716.2+0.0.50.yaml"
    cpu_cores = 4
    disk_size = 30
    slot_ids = [ 1 ]
  }
  depends_on =[bigipnext_cm_provider.rseries01, bigipnext_cm_provider.rseries02]
}

Debug Output

initial run is sucessful - provider is created as well as next instances

Plan: 4 to add, 0 to change, 0 to destroy.
bigipnext_cm_provider.rseries01: Creating...
bigipnext_cm_provider.rseries02: Creating...
bigipnext_cm_provider.rseries02: Creation complete after 1s [id=2994019b-59a0-490d-bd4f-65e3b4690017]
bigipnext_cm_provider.rseries01: Creation complete after 1s [id=5bc5bd94-2311-49d5-a4e6-7e708ecdca40]
bigipnext_cm_deploy_f5os.lab-a-tier2-02: Creating...
bigipnext_cm_deploy_f5os.lab-a-tier2-01: Creating...
bigipnext_cm_deploy_f5os.lab-a-tier2-01: Still creating... [10s elapsed]
bigipnext_cm_deploy_f5os.lab-a-tier2-02: Still creating... [10s elapsed]
bigipnext_cm_deploy_f5os.lab-a-tier2-01: Still creating... [20s elapsed]
bigipnext_cm_deploy_f5os.lab-a-tier2-02: Still creating... [4m10s elapsed]
bigipnext_cm_deploy_f5os.lab-a-tier2-02: Still creating... [4m20s elapsed]
bigipnext_cm_deploy_f5os.lab-a-tier2-01: Still creating... [4m20s elapsed]
bigipnext_cm_deploy_f5os.lab-a-tier2-01: Still creating... [4m30s elapsed]
bigipnext_cm_deploy_f5os.lab-a-tier2-02: Still creating... [4m30s elapsed]
bigipnext_cm_deploy_f5os.lab-a-tier2-01: Still creating... [4m40s elapsed]
bigipnext_cm_deploy_f5os.lab-a-tier2-02: Still creating... [4m40s elapsed]
bigipnext_cm_deploy_f5os.lab-a-tier2-02: Still creating... [4m50s elapsed]
bigipnext_cm_deploy_f5os.lab-a-tier2-01: Still creating... [4m50s elapsed]
bigipnext_cm_deploy_f5os.lab-a-tier2-02: Still creating... [5m0s elapsed]
bigipnext_cm_deploy_f5os.lab-a-tier2-01: Still creating... [5m0s elapsed]
bigipnext_cm_deploy_f5os.lab-a-tier2-01: Still creating... [5m10s elapsed]
bigipnext_cm_deploy_f5os.lab-a-tier2-02: Still creating... [5m10s elapsed]
bigipnext_cm_deploy_f5os.lab-a-tier2-02: Still creating... [5m20s elapsed]
...
bigipnext_cm_deploy_f5os.lab-a-tier2-02: Still creating... [7m30s elapsed]
bigipnext_cm_deploy_f5os.lab-a-tier2-01: Still creating... [7m30s elapsed]
bigipnext_cm_deploy_f5os.lab-a-tier2-01: Creation complete after 7m31s [id=labrseries01]
bigipnext_cm_deploy_f5os.lab-a-tier2-02: Creation complete after 7m32s [id=labrseries02]

Apply complete! Resources: 4 added, 0 changed, 0 destroyed.

Panic Output

repeated terraform run of the above result is the error below

terraform plan -var=management_password_instance="xxxxxxxx"

Planning failed. Terraform encountered an error while generating this plan.


│ Error: Client Error

│ with bigipnext_cm_deploy_f5os.lab-a-tier2-01,
│ on main.tf line 92, in resource "bigipnext_cm_deploy_f5os" "lab-a-tier2-01":
│ 92: resource "bigipnext_cm_deploy_f5os" "lab-a-tier2-01" {

│ Failed to Read Device Info, got error: the requested device:labrseries01, was not found


│ Error: Client Error

│ with bigipnext_cm_deploy_f5os.lab-a-tier2-02,
│ on main.tf line 115, in resource "bigipnext_cm_deploy_f5os" "lab-a-tier2-02":
│ 115: resource "bigipnext_cm_deploy_f5os" "lab-a-tier2-02" {

│ Failed to Read Device Info, got error: the requested device:labrseries02, was not found

Expected Behavior

terraform plan should show zero to add as no change was made to the tf file

Actual Behavior

Planning failed. Terraform encountered an error while generating this plan.


│ Error: Client Error

│ with bigipnext_cm_deploy_f5os.lab-a-tier2-01,
│ on main.tf line 92, in resource "bigipnext_cm_deploy_f5os" "lab-a-tier2-01":
│ 92: resource "bigipnext_cm_deploy_f5os" "lab-a-tier2-01" {

│ Failed to Read Device Info, got error: the requested device:labrseries01, was not found


│ Error: Client Error

│ with bigipnext_cm_deploy_f5os.lab-a-tier2-02,
│ on main.tf line 115, in resource "bigipnext_cm_deploy_f5os" "lab-a-tier2-02":
│ 115: resource "bigipnext_cm_deploy_f5os" "lab-a-tier2-02" {

│ Failed to Read Device Info, got error: the requested device:labrseries02, was not found

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform init
  2. terraform plan

Important Factoids

none

References

none

@dgst77
Copy link
Author

dgst77 commented Dec 6, 2024

central manager is running 20.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant