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] resource intersight_resourcepool_qualification_policy ignoring additional properties on various qualification types #311

Open
3 tasks done
scotttyso opened this issue Jan 22, 2025 · 0 comments

Comments

@scotttyso
Copy link

scotttyso commented Jan 22, 2025

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

When I run a plan I am finding that the resource intersight_resourcepool_qualification_policy is ignoring the additional_properties attributes for the following ObjectTypes:

  • resource.BladeQualifier
  • resource.DomainQualifier
  • resource.RackServerQualifier
  • resource.TagQualifier

It is working for the following ObjectTypes:

  • resource.NetworkAdaptorQualifier
  • resource.ProcessorQualifier
  • resource.GpuQualifier
  • resource.MemoryQualifier
Terraform-provider-intersight version
Configuration file
resource "intersight_resourcepool_qualification_policy" "test" {
  description = "dummy"
  name        = "dummy"
  qualifiers = [
    {
      additional_properties = jsonencode(
        {
          AdaptersRange = {
            ConditionType = "RANGE"
            MaxValue      = 2
            MinValue      = 1
            ObjectType    = "AdaptersRangeFilter"
          }
        }
      )
      class_id    = "resource.NetworkAdaptorQualifier"
      object_type = "resource.NetworkAdaptorQualifier"
    },
    {
      additional_properties = jsonencode(
        {
          AssetTags = []
          ChassisAndSlotIdRange = [
            {
              ChassisIdRange = {
                ClassId       = "resource.ChassisIdRangeFilter"
                ConditionType = "RANGE"
                MaxValue      = 5
                MinValue      = 1
                ObjectType    = "resource.ChassisIdRangeFilter"
              }
              ObjectType = "resource.ChassisAndSlotQualification"
              SlotIdRanges = [
                {
                  ClassId       = "resource.SlotIdRangeFilter"
                  ConditionType = "RANGE"
                  MaxValue      = 3
                  MinValue      = 1
                  ObjectType    = "resource.SlotIdRangeFilter"
                },
                {
                  ClassId       = "resource.SlotIdRangeFilter"
                  ConditionType = "RANGE"
                  MaxValue      = 6
                  MinValue      = 5
                  ObjectType    = "resource.SlotIdRangeFilter"
                },
              ]
            },
          ]
          ChassisPids = []
          Pids        = []
          UserLabels  = []
        }
      )
      class_id    = "resource.BladeQualifier"
      object_type = "resource.BladeQualifier"
    },
    {
      additional_properties = jsonencode(
        {
          CPUCoresRange = {
            ConditionType = "RANGE"
            MaxValue      = 48
            MinValue      = 24
            ObjectType    = "CPUCoreRangeFilter"
          }
          Pids = []
          SpeedRange = {
            ConditionType = "RANGE"
            MaxValue      = 0
            MinValue      = 0
            ObjectType    = "CpuSpeedRangeFilter"
          }
          Vendor = ""
        }
      )
      class_id    = "resource.ProcessorQualifier"
      object_type = "resource.ProcessorQualifier"
    },
    {
      additional_properties = jsonencode(
        {
          DomainNames = []
          FabricInterConnectPids = [
            "UCS-FI-6454",
          ]
        }
      )
      class_id    = "resource.DomainQualifier"
      object_type = "resource.DomainQualifier"
    },
    {
      additional_properties = jsonencode(
        {
          GpuControllersRange = {
            ConditionType = "RANGE"
            MaxValue      = 0
            MinValue      = 0
            ObjectType    = "GpuControllersRangeFilter"
          }
          GpuEvaluationType = "ServerWithoutGpu"
          Pids              = []
          Vendor            = ""
        }
      )
      class_id    = "resource.GpuQualifier"
      object_type = "resource.GpuQualifier"
    },
    {
      additional_properties = jsonencode(
        {
          MemoryCapacityRange = {
            ConditionType = "RANGE"
            MaxValue      = 512
            MinValue      = 256
            ObjectType    = "MemoryCapacityRangeFilter"
          }
          MemoryUnitsRange = {
            ConditionType = "RANGE"
            MaxValue      = 0
            MinValue      = 0
            ObjectType    = "MemoryUnitsRangeFilter"
          }
        }
      )
      class_id    = "resource.MemoryQualifier"
      object_type = "resource.MemoryQualifier"
    },
    {
      additional_properties = jsonencode(
        {
          AssetTags = []
          Pids      = []
          RackIdRange = [
            {
              ConditionType = "RANGE"
              MaxValue      = 5
              MinValue      = 1
              ObjectType    = "resource.RackIdRangeFilter"
            },
          ]
          UserLabels = []
        }
      )
      class_id    = "resource.RackServerQualifier"
      object_type = "resource.RackServerQualifier"
    },
    {
      additional_properties = jsonencode(
        {
          ChassisTags = [
            {
              Key        = "dummy1"
              ObjectType = "resource.Tag"
              Value      = "dummy2"
            },
          ]
          DomainProfileTags = []
          ServerTags = [
            {
              Key        = "dummy5"
              ObjectType = "resource.Tag"
              Value      = "dummy6"
            },
          ]
        }
      )
      class_id    = "resource.TagQualifier"
      object_type = "resource.TagQualifier"
    },
  ]
  tags = [

  ]
}
Actual output (Attach screenshots if applicable)
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:

  # intersight_resourcepool_qualification_policy.test will be created
  + resource "intersight_resourcepool_qualification_policy" "test" {
      + account_moid         = (known after apply)
      + ancestors            = (known after apply)
      + class_id             = "resourcepool.QualificationPolicy"
      + create_time          = (known after apply)
      + description          = "dummy"
      + domain_group_moid    = (known after apply)
      + id                   = (known after apply)
      + mod_time             = (known after apply)
      + moid                 = (known after apply)
      + name                 = "dummy"
      + object_type          = "resourcepool.QualificationPolicy"
      + organization         = (known after apply)
      + owners               = (known after apply)
      + parent               = (known after apply)
      + permission_resources = (known after apply)
      + qualifiers           = [
          + {
              + additional_properties = jsonencode(
                    {
                      + AdaptersRange = {
                          + ConditionType = "RANGE"
                          + MaxValue      = 2
                          + MinValue      = 1
                          + ObjectType    = "AdaptersRangeFilter"
                        }
                    }
                )
              + class_id              = "resource.NetworkAdaptorQualifier"
              + object_type           = "resource.NetworkAdaptorQualifier"
            },
          + {
              + class_id    = "resource.BladeQualifier"
              + object_type = "resource.BladeQualifier"
            },
          + {
              + additional_properties = jsonencode(
                    {
                      + CPUCoresRange = {
                          + ConditionType = "RANGE"
                          + MaxValue      = 48
                          + MinValue      = 24
                          + ObjectType    = "CPUCoreRangeFilter"
                        }
                      + Pids          = []
                      + SpeedRange    = {
                          + ConditionType = "RANGE"
                          + MaxValue      = 0
                          + MinValue      = 0
                          + ObjectType    = "CpuSpeedRangeFilter"
                        }
                      + Vendor        = ""
                    }
                )
              + class_id              = "resource.ProcessorQualifier"
              + object_type           = "resource.ProcessorQualifier"
            },
          + {
              + class_id    = "resource.DomainQualifier"
              + object_type = "resource.DomainQualifier"
            },
          + {
              + additional_properties = jsonencode(
                    {
                      + GpuControllersRange = {
                          + ConditionType = "RANGE"
                          + MaxValue      = 0
                          + MinValue      = 0
                          + ObjectType    = "GpuControllersRangeFilter"
                        }
                      + GpuEvaluationType   = "ServerWithoutGpu"
                      + Pids                = []
                      + Vendor              = ""
                    }
                )
              + class_id              = "resource.GpuQualifier"
              + object_type           = "resource.GpuQualifier"
            },
          + {
              + additional_properties = jsonencode(
                    {
                      + MemoryCapacityRange = {
                          + ConditionType = "RANGE"
                          + MaxValue      = 512
                          + MinValue      = 256
                          + ObjectType    = "MemoryCapacityRangeFilter"
                        }
                      + MemoryUnitsRange    = {
                          + ConditionType = "RANGE"
                          + MaxValue      = 0
                          + MinValue      = 0
                          + ObjectType    = "MemoryUnitsRangeFilter"
                        }
                    }
                )
              + class_id              = "resource.MemoryQualifier"
              + object_type           = "resource.MemoryQualifier"
            },
          + {
              + class_id    = "resource.RackServerQualifier"
              + object_type = "resource.RackServerQualifier"
            },
          + {
              + class_id    = "resource.TagQualifier"
              + object_type = "resource.TagQualifier"
            },
        ]
      + resource_pools       = (known after apply)
      + shared_scope         = (known after apply)
      + tags                 = []
      + version_context      = (known after apply)
    }

Notice how the additional_properties is being stripped on the ObjectTypes that I listed above. But If I do a terraform import from an existing object in Intersight the Terraform configuration that I have above matches the import.

tyscott@TYSCOTT-DESKTOP:~/terraform-cisco-modules/terraform-intersight-pools/rpq$ terraform state show intersight_resourcepool_qualification_policy.name
# intersight_resourcepool_qualification_policy.name:
resource "intersight_resourcepool_qualification_policy" "name" {
    account_moid          = "5981bd053e95200001fd5632"
    additional_properties = jsonencode(
        {
            AccountMoid         = "5981bd053e95200001fd5632"
            Ancestors           = []
            CreateTime          = "2024-12-13T11:11:30.544Z"
            Description         = ""
            DomainGroupMoid     = "5b2541887a7662743465ce9c"
            ModTime             = "2025-01-22T00:13:53.519Z"
            Moid                = "675c166269627531014d27d1"
            Name                = "SPQD"
            Owners              = [
                "5981bd053e95200001fd5632",
            ]
            PermissionResources = [
                {
                    ClassId    = "mo.MoRef"
                    Moid       = "5ddea1e16972652d32b6493a"
                    ObjectType = "organization.Organization"
                    link       = "https://intersight.com/api/v1/organization/Organizations/5ddea1e16972652d32b6493a"
                },
            ]
            SharedScope         = ""
            Tags                = []
        }
    )
    ancestors             = []
    class_id              = "resourcepool.QualificationPolicy"
    create_time           = "2024-12-13 11:11:30.544 +0000 UTC"
    description           = null
    domain_group_moid     = "5b2541887a7662743465ce9c"
    id                    = "675c166269627531014d27d1"
    mod_time              = "2025-01-22 00:13:53.519 +0000 UTC"
    moid                  = "675c166269627531014d27d1"
    name                  = "SPQD"
    object_type           = "resourcepool.QualificationPolicy"
    organization          = [
        {
            additional_properties = null
            class_id              = "mo.MoRef"
            moid                  = "5ddea1e16972652d32b6493a"
            object_type           = "organization.Organization"
            selector              = null
        },
    ]
    owners                = [
        "5981bd053e95200001fd5632",
    ]
    parent                = []
    permission_resources  = [
        {
            additional_properties = null
            class_id              = "mo.MoRef"
            moid                  = "5ddea1e16972652d32b6493a"
            object_type           = "organization.Organization"
            selector              = null
        },
    ]
    qualifiers            = [
        {
            additional_properties = jsonencode(
                {
                    DomainNames            = []
                    FabricInterConnectPids = [
                        "UCS-FI-6454",
                    ]
                }
            )
            class_id              = "resource.DomainQualifier"
            object_type           = "resource.DomainQualifier"
        },
        {
            additional_properties = jsonencode(
                {
                    AssetTags   = []
                    Pids        = [
                        "UCSC-C220-M5",
                    ]
                    RackIdRange = [
                        {
                            ClassId       = "resource.RackIdRangeFilter"
                            ConditionType = "RANGE"
                            MaxValue      = 4
                            MinValue      = 1
                            ObjectType    = "resource.RackIdRangeFilter"
                        },
                    ]
                    UserLabels  = []
                }
            )
            class_id              = "resource.RackServerQualifier"
            object_type           = "resource.RackServerQualifier"
        },
        {
            additional_properties = jsonencode(
                {
                    AssetTags             = []
                    ChassisAndSlotIdRange = [
                        {
                            ChassisIdRange = {
                                ClassId       = "resource.ChassisIdRangeFilter"
                                ConditionType = "RANGE"
                                MaxValue      = 7
                                MinValue      = 6
                                ObjectType    = "resource.ChassisIdRangeFilter"
                            }
                            ClassId        = "resource.ChassisAndSlotQualification"
                            ObjectType     = "resource.ChassisAndSlotQualification"
                            SlotIdRanges   = []
                        },
                        {
                            ChassisIdRange = {
                                ClassId       = "resource.ChassisIdRangeFilter"
                                ConditionType = "RANGE"
                                MaxValue      = 5
                                MinValue      = 4
                                ObjectType    = "resource.ChassisIdRangeFilter"
                            }
                            ClassId        = "resource.ChassisAndSlotQualification"
                            ObjectType     = "resource.ChassisAndSlotQualification"
                            SlotIdRanges   = [
                                {
                                    ClassId       = "resource.SlotIdRangeFilter"
                                    ConditionType = "RANGE"
                                    MaxValue      = 8
                                    MinValue      = 1
                                    ObjectType    = "resource.SlotIdRangeFilter"
                                },
                            ]
                        },
                    ]
                    ChassisPids           = []
                    Pids                  = [
                        "UCSB-B200-M5",
                    ]
                    UserLabels            = []
                }
            )
            class_id              = "resource.BladeQualifier"
            object_type           = "resource.BladeQualifier"
        },
        {
            additional_properties = jsonencode(
                {
                    ChassisTags       = [
                        {
                            ClassId    = "resource.Tag"
                            Key        = "Module"
                            ObjectType = "resource.Tag"
                            Value      = "easy-imm"
                        },
                    ]
                    DomainProfileTags = []
                    ServerTags        = [
                        {
                            ClassId    = "resource.Tag"
                            Key        = "Module"
                            ObjectType = "resource.Tag"
                            Value      = "easy-imm"
                        },
                    ]
                }
            )
            class_id              = "resource.TagQualifier"
            object_type           = "resource.TagQualifier"
        },
        {
            additional_properties = jsonencode(
                {
                    MemoryCapacityRange = {
                        ClassId       = "resource.MemoryCapacityRangeFilter"
                        ConditionType = "RANGE"
                        MaxValue      = 512
                        MinValue      = 1
                        ObjectType    = "resource.MemoryCapacityRangeFilter"
                    }
                    MemoryUnitsRange    = {
                        ClassId       = "resource.MemoryUnitsRangeFilter"
                        ConditionType = "RANGE"
                        MaxValue      = 0
                        MinValue      = 0
                        ObjectType    = "resource.MemoryUnitsRangeFilter"
                    }
                }
            )
            class_id              = "resource.MemoryQualifier"
            object_type           = "resource.MemoryQualifier"
        },
        {
            additional_properties = jsonencode(
                {
                    GpuControllersRange = {
                        ClassId       = "resource.GpuControllersRangeFilter"
                        ConditionType = "RANGE"
                        MaxValue      = 0
                        MinValue      = 0
                        ObjectType    = "resource.GpuControllersRangeFilter"
                    }
                    GpuEvaluationType   = "ServerWithoutGpu"
                    Pids                = []
                    Vendor              = ""
                }
            )
            class_id              = "resource.GpuQualifier"
            object_type           = "resource.GpuQualifier"
        },
        {
            additional_properties = jsonencode(
                {
                    CpuCoresRange = {
                        ClassId       = "resource.CpuCoreRangeFilter"
                        ConditionType = "RANGE"
                        MaxValue      = 0
                        MinValue      = 0
                        ObjectType    = "resource.CpuCoreRangeFilter"
                    }
                    Pids          = []
                    SpeedRange    = {
                        ClassId       = "resource.CpuSpeedRangeFilter"
                        ConditionType = "RANGE"
                        MaxValue      = 0
                        MinValue      = 0
                        ObjectType    = "resource.CpuSpeedRangeFilter"
                    }
                    Vendor        = "Intel(R) Corporation"
                }
            )
            class_id              = "resource.ProcessorQualifier"
            object_type           = "resource.ProcessorQualifier"
        },
    ]
    resource_pools        = []
    shared_scope          = null
    tags                  = []
    version_context       = []
}
Related issues/PRs
Suggest a fix
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