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

catalystcenter_ip_pool_reservation incorrectly trigger update on pool with ipv6 #156

Open
jolstorn opened this issue Dec 3, 2024 · 0 comments

Comments

@jolstorn
Copy link

jolstorn commented Dec 3, 2024

If a reserved pool has dual stack ipv4 and ipv6 assigned, catalystcenter_ip_pool_reservation will update the resource each run.

  # catalystcenter_ip_pool_reservation.pool_reserved["prep_siteb_borderlink"] will be updated in-place
  ~ resource "catalystcenter_ip_pool_reservation" "pool_reserved" {
        id                 = "17c55d35-d5dd-4d61-9cbd-bc0a64585ac4"
      ~ ipv4_gateway       = "2a05:ec0:cf01:100::201" -> "100.126.24.1"
        name               = "prep_siteb_borderlink"
        # (13 unchanged attributes hidden)
    }

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

This happens even though state shows normal values:

[ghrunner@sds-iacmt-01 tf-dnac]$ terraform state show 'catalystcenter_ip_pool_reservation.pool_reserved["prep_siteb_borderlink"]'
# catalystcenter_ip_pool_reservation.pool_reserved["prep_siteb_borderlink"]:
resource "catalystcenter_ip_pool_reservation" "pool_reserved" {
    id                 = "17c55d35-d5dd-4d61-9cbd-bc0a64585ac4"
    ipv4_dhcp_servers  = []
    ipv4_gateway       = "100.126.24.1"
    ipv4_global_pool   = "100.126.24.0/23"
    ipv4_prefix        = true
    ipv4_prefix_length = 23
    ipv4_subnet        = "100.126.24.0"
    ipv6_address_space = true
    ipv6_gateway       = "2a05:ec0:cf01:100::201"
    ipv6_global_pool   = "2a05:ec0:cf01:100::/119"
    ipv6_prefix        = true
    ipv6_prefix_length = 119
    ipv6_subnet        = "2a05:ec0:cf01:100::"
    name               = "prep_siteb_borderlink"
    site_id            = "beef9f65-83be-45fa-bb09-7ee0a1206d14"
    type               = "Generic"
}

Querying catcenter api also show normal values:

{
    "response": [
        {
            "id": "17c55d35-d5dd-4d61-9cbd-bc0a64585ac4",
            "groupName": "prep_siteb_borderlink",
            "ipPools": [
                {
                    "ipPoolName": "prep_siteb_borderlink",
                    "dhcpServerIps": [],
                    "gateways": [
                        "2a05:ec0:cf01:100::201"
                    ],
                    "createTime": 1713529113376,
                    "lastUpdateTime": 1733221320101,
                    "totalIpAddressCount": 512,
                    "usedIpAddressCount": 136,
                    "parentUuid": "a6fafa20-abc5-4f56-9c2f-1ddf220db871",
                    "owner": "DNAC",
                    "shared": true,
                    "overlapping": false,
                    "configureExternalDhcp": false,
                    "usedPercentage": "26",
                    "clientOptions": {},
                    "groupUuid": "17c55d35-d5dd-4d61-9cbd-bc0a64585ac4",
                    "unavailableIpAddressCount": 0,
                    "availableIpAddressCount": 0,
                    "totalAssignableIpAddressCount": 510,
                    "dnsServerIps": [],
                    "hasSubpools": false,
                    "defaultAssignedIpAddressCount": 2,
                    "context": [
                        {
                            "owner": "DNAC",
                            "contextKey": "reserved_by",
                            "contextValue": "DNAC"
                        },
                        {
                            "owner": "DNAC",
                            "contextKey": "siteId",
                            "contextValue": "beef9f65-83be-45fa-bb09-7ee0a1206d14"
                        },
                        {
                            "owner": "DNAC",
                            "contextKey": "slaacSupport",
                            "contextValue": "false"
                        }
                    ],
                    "ipv6": true,
                    "id": "1b09e145-d887-4c13-8059-ad99c067171b",
                    "ipPoolCidr": "2a05:ec0:cf01:100::200/119"
                },
                {
                    "ipPoolName": "prep_siteb_borderlink",
                    "dhcpServerIps": [],
                    "gateways": [
                        "100.126.24.1"
                    ],
                    "createTime": 1701160408661,
                    "lastUpdateTime": 1733221320098,
                    "totalIpAddressCount": 512,
                    "usedIpAddressCount": 136,
                    "parentUuid": "c673ac3b-e4b0-44bf-8388-3f5045855d54",
                    "owner": "DNAC",
                    "shared": true,
                    "overlapping": false,
                    "configureExternalDhcp": false,
                    "usedPercentage": "26",
                    "clientOptions": {},
                    "groupUuid": "17c55d35-d5dd-4d61-9cbd-bc0a64585ac4",
                    "unavailableIpAddressCount": 0,
                    "availableIpAddressCount": 0,
                    "totalAssignableIpAddressCount": 509,
                    "dnsServerIps": [],
                    "hasSubpools": false,
                    "defaultAssignedIpAddressCount": 3,
                    "context": [
                        {
                            "owner": "DNAC",
                            "contextKey": "siteId",
                            "contextValue": "beef9f65-83be-45fa-bb09-7ee0a1206d14"
                        },
                        {
                            "owner": "DNAC",
                            "contextKey": "reserved_by",
                            "contextValue": "DNAC"
                        }
                    ],
                    "ipv6": false,
                    "id": "16f0564f-d890-4050-9629-70d80c688dd5",
                    "ipPoolCidr": "100.126.24.0/23"
                }
            ],
            "siteId": "beef9f65-83be-45fa-bb09-7ee0a1206d14",
            "siteHierarchy": "Global/prep/siteb",
            "type": "generic",
            "groupOwner": "DNAC"
        }
    ],
    "version": "1.0"
}

The change is successful but will be repeated on next apply.

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

catalystcenter_ip_pool_reservation.pool_reserved["prep_siteb_borderlink"]: Modifying... [id=17c55d35-d5dd-4d61-9cbd-bc0a64585ac4]
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catalystcenter_ip_pool_reservation.pool_reserved["prep_siteb_borderlink"]: Still modifying... [id=17c55d35-d5dd-4d61-9cbd-bc0a64585ac4, 10s elapsed]
catalystcenter_ip_pool_reservation.pool_reserved["prep_siteb_borderlink"]: Modifications complete after 17s [id=17c55d35-d5dd-4d61-9cbd-bc0a64585ac4]

Apply complete! Resources: 0 added, 1 changed, 0 destroyed.
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