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

[ISSUE] intersight_bulk_mo_merger change between 1.0.47 and higher versions #291

Open
3 tasks done
scotttyso opened this issue Sep 13, 2024 · 0 comments
Open
3 tasks done

Comments

@scotttyso
Copy link

scotttyso commented Sep 13, 2024

Bug Report Checklist

  • Have you provided a full/minimal configuration to reproduce the issue?
  • Have you [tested with the latest master] to confirm the issue still exists?
  • Have you provided the terraform console logs with environment variable set to TF_LOG=trace?
Description
Terraform-provider-intersight version

all version lower than 1.0.47 - Works as expected
all versions higher than 1.0.47 - Wants to always rebuild the resource intersight_bulk_mo_merger

Configuration file
common:
  profiles:
    server:
      - action: No-op
        attach_template: true
        target_platform: FIAttached
        targets:
          - name: bulk_issue
            serial_number: unknown
        ucs_server_profile_template: aci-M5-intel-virtual-M2-pxe

please see the example here:
https://github.com/terraform-cisco-modules/easy-imm/bulk_issue

The only thing you need to modify to use my example is the org name common and the name of the server_profile_template

The initial Plan will do:

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

Then applying the plan:

tyscott@TYSCOTT-DESKTOP:~/terraform-cisco-modules/easy-imm/bulk_issue$ tfa
module.profiles["map"].intersight_server_profile.reservations["common/bulk_issue"]: Creating...
module.profiles["map"].intersight_server_profile.reservations["common/bulk_issue"]: Creation complete after 1s [id=66e44bf377696e3201fa935a]
module.profiles["map"].intersight_server_profile.map["common/bulk_issue"]: Creating...
module.profiles["map"].intersight_server_profile.map["common/bulk_issue"]: Creation complete after 1s [id=66e44bf377696e3201fa935a]
module.profiles["map"].intersight_bulk_mo_merger.trigger_profile_update["common/bulk_issue"]: Creating...
module.profiles["map"].intersight_bulk_mo_merger.trigger_profile_update["common/bulk_issue"]: Creation complete after 1s [id=1726237685]
module.profiles["map"].intersight_server_profile.deploy["common/bulk_issue"]: Creating...
module.profiles["map"].intersight_server_profile.deploy["common/bulk_issue"]: Creation complete after 0s [id=66e44bf377696e3201fa935a]

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

With 1.0.47 on the next subsequent Plan I will get

data.utils_yaml_merge.model: Reading...
data.utils_yaml_merge.model: Read complete after 0s [id=76384e43e23403ce3f4a3e601b406e5fecb49ca5]
module.organizations["map"].data.intersight_organization_organization.map: Reading...
module.organizations["map"].data.intersight_organization_organization.map: Read complete after 1s [id=5ddea1e16972652d32b6493a]
module.profiles["map"].data.intersight_server_profile_template.map["aci-M5-intel-virtual-M2-pxe"]: Reading...
module.profiles["map"].data.intersight_server_profile_template.map["aci-M5-intel-virtual-M2-pxe"]: Read complete after 0s [id=65d378a977696e3201f89a65]
module.profiles["map"].intersight_server_profile.reservations["common/bulk_issue"]: Refreshing state... [id=66e44bf377696e3201fa935a]
module.profiles["map"].intersight_server_profile.map["common/bulk_issue"]: Refreshing state... [id=66e44bf377696e3201fa935a]
module.profiles["map"].intersight_bulk_mo_merger.trigger_profile_update["common/bulk_issue"]: Refreshing state... [id=1726237685]
module.profiles["map"].intersight_server_profile.deploy["common/bulk_issue"]: Refreshing state... [id=66e44bf377696e3201fa935a]

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.

If I update the provider to 1.0.55, as that is the latest release, on the next plan I will get:

tyscott@TYSCOTT-DESKTOP:~/terraform-cisco-modules/easy-imm/bulk_issue$ tfp
data.utils_yaml_merge.model: Reading...
data.utils_yaml_merge.model: Read complete after 0s [id=76384e43e23403ce3f4a3e601b406e5fecb49ca5]
module.organizations["map"].data.intersight_organization_organization.map: Reading...
module.organizations["map"].data.intersight_organization_organization.map: Read complete after 1s [id=5ddea1e16972652d32b6493a]
module.profiles["map"].data.intersight_server_profile_template.map["aci-M5-intel-virtual-M2-pxe"]: Reading...
module.profiles["map"].data.intersight_server_profile_template.map["aci-M5-intel-virtual-M2-pxe"]: Read complete after 0s [id=65d378a977696e3201f89a65]
module.profiles["map"].intersight_server_profile.reservations["common/bulk_issue"]: Refreshing state... [id=66e44bf377696e3201fa935a]
module.profiles["map"].intersight_server_profile.map["common/bulk_issue"]: Refreshing state... [id=66e44bf377696e3201fa935a]
module.profiles["map"].intersight_bulk_mo_merger.trigger_profile_update["common/bulk_issue"]: Refreshing state... [id=1726237685]
module.profiles["map"].intersight_server_profile.deploy["common/bulk_issue"]: Refreshing state... [id=66e44bf377696e3201fa935a]

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.
tyscott@TYSCOTT-DESKTOP:~/terraform-cisco-modules/easy-imm/bulk_issue$ tfu
Initializing the backend...
Upgrading modules...
Downloading file:///home/tyscott/terraform-cisco-modules/terraform-intersight-organizations for organizations...
- organizations in .terraform/modules/organizations
Downloading registry.terraform.io/terraform-cisco-modules/policies/intersight 4.2.11-16711 for policies...
- policies in .terraform/modules/policies
Downloading registry.terraform.io/terraform-cisco-modules/pools/intersight 4.2.11-16711 for pools...
- pools in .terraform/modules/pools
Downloading registry.terraform.io/terraform-cisco-modules/profiles/intersight 4.2.11-16711 for profiles...
- profiles in .terraform/modules/profiles
Initializing provider plugins...
- Finding hashicorp/time versions matching ">= 0.9.1, 0.9.1"...
- Finding netascode/utils versions matching ">= 0.1.3"...
- Finding ciscodevnet/intersight versions matching ">= 1.0.47, 1.0.55"...
- Installing ciscodevnet/intersight v1.0.55...
- Installed ciscodevnet/intersight v1.0.55 (signed by a HashiCorp partner, key ID 7FA19DB0A5A44572)
- Using previously-installed hashicorp/time v0.9.1
- Using previously-installed netascode/utils v0.2.6
Partner and community providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
https://www.terraform.io/docs/cli/plugins/signing.html
Terraform has made some changes to the provider dependency selections recorded
in the .terraform.lock.hcl file. Review those changes and commit them to your
version control system if they represent changes you intended to make.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
tyscott@TYSCOTT-DESKTOP:~/terraform-cisco-modules/easy-imm/bulk_issue$ tfp
data.utils_yaml_merge.model: Reading...
data.utils_yaml_merge.model: Read complete after 0s [id=76384e43e23403ce3f4a3e601b406e5fecb49ca5]
module.organizations["map"].data.intersight_organization_organization.map: Reading...
module.organizations["map"].data.intersight_organization_organization.map: Read complete after 1s [id=5ddea1e16972652d32b6493a]
module.profiles["map"].data.intersight_server_profile_template.map["aci-M5-intel-virtual-M2-pxe"]: Reading...
module.profiles["map"].data.intersight_server_profile_template.map["aci-M5-intel-virtual-M2-pxe"]: Read complete after 0s [id=65d378a977696e3201f89a65]
module.profiles["map"].intersight_server_profile.reservations["common/bulk_issue"]: Refreshing state... [id=66e44bf377696e3201fa935a]
module.profiles["map"].intersight_server_profile.map["common/bulk_issue"]: Refreshing state... [id=66e44bf377696e3201fa935a]
module.profiles["map"].intersight_bulk_mo_merger.trigger_profile_update["common/bulk_issue"]: Refreshing state... [id=1726237685]
module.profiles["map"].intersight_server_profile.deploy["common/bulk_issue"]: Refreshing state... [id=66e44bf377696e3201fa935a]

Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # module.profiles["map"].intersight_bulk_mo_merger.trigger_profile_update["common/bulk_issue"] will be created
  + resource "intersight_bulk_mo_merger" "trigger_profile_update" {
      + account_moid         = (known after apply)
      + ancestors            = (known after apply)
      + async_result         = (known after apply)
      + class_id             = "bulk.MoMerger"
      + create_time          = (known after apply)
      + domain_group_moid    = (known after apply)
      + id                   = (known after apply)
      + merge_action         = "Merge"
      + mod_time             = (known after apply)
      + moid                 = (known after apply)
      + object_type          = "bulk.MoMerger"
      + organization         = (known after apply)
      + owners               = (known after apply)
      + parent               = (known after apply)
      + permission_resources = (known after apply)
      + responses            = (known after apply)
      + shared_scope         = (known after apply)
      + sources              = [
          + {
              + account_moid         = (known after apply)
              + ancestors            = (known after apply)
              + class_id             = "server.ProfileTemplate"
              + create_time          = (known after apply)
              + domain_group_moid    = (known after apply)
              + mod_time             = (known after apply)
              + moid                 = "65d378a977696e3201f89a65"
              + object_type          = "server.ProfileTemplate"
              + owners               = (known after apply)
              + parent               = (known after apply)
              + permission_resources = (known after apply)
              + shared_scope         = (known after apply)
              + tags                 = (known after apply)
              + version_context      = (known after apply)
            },
        ]
      + tags                 = (known after apply)
      + target_config        = (known after apply)
      + targets              = [
          + {
              + account_moid         = (known after apply)
              + ancestors            = (known after apply)
              + class_id             = "server.Profile"
              + create_time          = (known after apply)
              + domain_group_moid    = (known after apply)
              + mod_time             = (known after apply)
              + moid                 = "66e44bf377696e3201fa935a"
              + object_type          = "server.Profile"
              + owners               = (known after apply)
              + parent               = (known after apply)
              + permission_resources = (known after apply)
              + shared_scope         = (known after apply)
              + tags                 = (known after apply)
              + version_context      = (known after apply)
            },
        ]
      + version_context      = (known after apply)
    }

Plan: 1 to add, 0 to change, 0 to destroy.
╷
│ Warning: BulkMoMerger object 1726237685 not found. Removing from statefile
│
│   with module.profiles["map"].intersight_bulk_mo_merger.trigger_profile_update["common/bulk_issue"],
│   on .terraform/modules/profiles/server_template.tf line 44, in resource "intersight_bulk_mo_merger" "trigger_profile_update":44: resource "intersight_bulk_mo_merger" "trigger_profile_update" {
│
╵

───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────

Saved the plan to: main.plan

To perform exactly these actions, run the following command to apply:
    terraform apply "main.plan"
tyscott@TYSCOTT-DESKTOP:~/terraform-cisco-modules/easy-imm/bulk_issue$
Actual output (Attach screenshots if applicable)
Related issues/PRs
Suggest a fix

Although I know the intersight_bulk_mo_merger is not a stateful object, I don't want to re-create the object on subsequent plans.

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