f5devcentral / f5-automation-config-converter

Convert BIG-IP configs to AS3 and DO declarations
https://clouddocs.f5.com/products/extensions/f5-automation-config-converter/latest/
Apache License 2.0
35 stars 13 forks source link

Renaming a pool object without renaming its reference #93

Open wiksla opened 2 years ago

wiksla commented 2 years ago

Environment

Summary

ACC renames a pool, but doesn't rename a reference inside another object.

The configs are redacted and shared privately

Steps To Reproduce

Steps to reproduce the behavior:

  1. Convert a config containing following:

    ltm profile request-log /tenant_2/application_2/telemetry {
    request-log-pool /tenant_2/application_2/telemetry
    }
    ltm pool /tenant_2/application_2/telemetry {
    members {
        /tenant_2/application_2/<ip>:<port> {
            address <ip>
        }
    }
    monitor /Common/tcp
    }
    ltm virtual /tenant_2/application_2/web_app_backend_vs {
    profiles {
        /Common/tcp { }
        /tenant_2/application_2/telemetry { }
    }
    }
  2. Observe the following output:

    {
    "class": "ADC",
    "schemaVersion": "3.23.0",
    "id": "urn:uuid:ed727482-7f02-4858-ac1b-2ee979254366",
    "label": "Converted Declaration",
    "remark": "Generated by JOURNEYS",
    "tenant_2": {
    "class": "Tenant",
    "application_2": {
      "class": "Application",
      "template": "generic",
      "pool_telemetry_dup": {
        "class": "Pool",
        "members": [
          {
            "shareNodes": true,
            "servicePort": <port>,
            "serverAddresses": [
              "<ip>"
            ],
            "addressDiscovery": "static"
          }
        ],
        "monitors": [
          {
            "bigip": "/Common/tcp"
          }
        ]
      },
      "profile_telemetry_dup": {
        "class": "Traffic_Log_Profile",
        "parentProfile": {
          "bigip": "/Common/request-log"
        },
        "requestSettings": {
          "requestPool": {
            "use": "/tenant_2/application_2/telemetry"
          }
      },
      "web_app_backend_vs": {
        "pool": "pool_backend",
        "class": "Service_TCP",
        "profileTrafficLog": {
          "use": "/tenant_2/application_2/profile_telemetry_dup"
        },
      }
    }
    }
    }

Expected Behavior

Correct reference to pool_telemetry_dup within profile_telemetry_dup/requestSettings/requestPool/use

Actual Behavior

          "requestPool": {
            "use": "/tenant_2/application_2/telemetry"
          },
mdditt2000 commented 2 years ago

@wiksla please reach out to me automation_toolchain_pm@f5.com so i can understand you conversion/migration and prioritize this bug

azahajkiewicz commented 2 years ago

Hi Mark, in the classic config there is a profile and a pool named with the same name: telemetry. Because of that, ACC renamed those objects by adding: {classType}_telemetry_dup. While renaming class names, one reference was not updated (requestPool), so we ended up with:

"pool_telemetry_dup": {.        <----- updated name
        "class": "Pool",
        "members": [
          {
            "shareNodes": true,
            "servicePort": 6666,
            "serverAddresses": [
              "255.255.255.254"
            ],
            "addressDiscovery": "static"
         }
      },
      ...
      "profile_telemetry_dup": {.          <------ updated name
        "class": "Traffic_Log_Profile",
        "parentProfile": {
          "bigip": "/Common/request-log"
        },
        "requestSettings": {
          "requestPool": {
            "use": "/tenant_2/application_2/telemetry".       <------- old name!
          },
          "requestEnabled": false,
        ...
        }
      },
       ...
      "xxxxxxxxxxxx_vs": {
        "pool": "xxxxxx",
        "snat": "auto",
        "class": "Service_TCP",
        "layer4": "tcp",
        "profileTCP": {
          "bigip": "/Common/tcp"
        },
        "virtualPort": 8080,
        "virtualAddresses": [
          "10.10.10.10"
        ],
        "profileTrafficLog": {
          "use": "/tenant_2/application_2/profile_telemetry_dup".     <------ updated name
        },
        "translateServerPort": true,
        "translateServerAddress": true
      }