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

no handling for "keep-alive-interval disabled" in fastl4 profile #69

Closed mnaumiuk closed 3 years ago

mnaumiuk commented 3 years ago

Environment

Summary

For fastl4 profile with "keep-alive-interval disabled" validation error "['/tenant_3/application_3/fastL4.FW_3.profile/keepAliveInterval: should be integer']" is returned.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Convert following config:

    app-service none
    defaults-from /Common/fastL4
    hardware-syn-cookie enabled
    idle-timeout 28800
    ip-tos-to-client pass-through
    ip-tos-to-server pass-through
    keep-alive-interval disabled. <----------
    ...
  2. Observe the following error message:

    iControl REST error: code: 422, message: declaration is invalid, errors: ['/tenant_3/application_3/fastL4.FW_3.profile/keepAliveInterval: should be integer']

The default value for fastl4 profile "keep-alive-interval" is disabled. *The default value (disabled) is not present in the config from the beginning, but if this value is changed to a different value and changed back to 0/disabled, then "keep-alive-interval disabled" is present in the config.

Reproduced by modifying keep-alive-interval for fastl4 profile:

root@(bigip_as3)(cfg-sync Standalone)(Active)(/Common)(tmos)# list ltm profile fastl4 keep_allive_test keep-alive-interval
ltm profile fastl4 keep_allive_test {
    keep-alive-interval 1
}
root@(bigip_as3)(cfg-sync Standalone)(Active)(/Common)(tmos)# modify ltm profile fastl4 keep_allive_test keep-alive-interval 0
root@(bigip_as3)(cfg-sync Standalone)(Active)(/Common)(tmos)# list ltm profile fastl4 keep_allive_test keep-alive-interval
ltm profile fastl4 keep_allive_test {
    keep-alive-interval disabled
}
root@(bigip_as3)(cfg-sync Standalone)(Active)(/Common)(tmos)#
[root@bigip_as3:Active:Standalone] config # grep "/Common/keep_allive_test" -A3 bigip.conf
ltm profile fastl4 /Common/keep_allive_test {
    app-service none
    keep-alive-interval disabled
}
[root@bigip_as3:Active:Standalone] config #

Additionally, it seems that this is specific to (at least) fastl4 profile, for example, the tcp profile cannot take value "disabled" but "0":

root@(bigip_as3)(cfg-sync Standalone)(Active)(/Common)(tmos)# list ltm profile tcp keep_allive_testtcp keep-alive-interval
ltm profile tcp keep_allive_testtcp {
    keep-alive-interval 1
}
root@(bigip_as3)(cfg-sync Standalone)(Active)(/Common)(tmos)# modify ltm profile tcp keep_allive_testtcp keep-alive-interval disabled
Data Input Error: "keep-alive-interval":"disabled" integer value is out of range
root@(bigip_as3)(cfg-sync Standalone)(Active)(/Common)(tmos)# modify ltm profile tcp keep_allive_testtcp keep-alive-interval 0
root@(bigip_as3)(cfg-sync Standalone)(Active)(/Common)(tmos)# list ltm profile tcp keep_allive_testtcp keep-alive-interval
ltm profile tcp keep_allive_testtcp {
    keep-alive-interval 0
}
root@(bigip_as3)(cfg-sync Standalone)(Active)(/Common)(tmos)#

Expected Behavior

For fastl4 profile no error with "keep-alive-interval disabled"

Actual Behavior

/tenant_3/application_3/fastL4.FW_3.profile/keepAliveInterval: should be integer

jszczepanskif5 commented 3 years ago

Just to clarify the expected behavior: If keep-alive-interval is set to disabled in an ltm profile fastl4 object, set the AS3 keepAliveInterval value to 0.

mdditt2000 commented 3 years ago

@jszczepanski correct! keepAliveInterval (integer) set the value to number of seconds between keep-alive probes. A value of 0 seconds disables the feature. ACC is indeed converting incorrectly

[2021-10-26T19:33:01.428Z] [INFO]: ACC METADATA {
  recognized: {
    'ltm profile fastl4 /Common/keep_allive_test': { 'app-service': 'none', 'keep-alive-interval': 'disabled' }
  },
  supported: {
    'ltm profile fastl4 /Common/keep_allive_test': { 'app-service': 'none', 'keep-alive-interval': 'disabled' }
  },
  unSupported: {},
  declarationInfo: {
    classes: { L4_Profile: 1 },
    maps: {
      applications: [ '/Common/Shared' ],
      objects: [ '/Common/Shared/keep_allive_test' ],
      tenants: [ '/Common' ]
    },
    total: 1
  }
}

After

{
    "class": "ADC",
    "schemaVersion": "3.30.0",
    "id": "urn:uuid:4e5adae1-b6e8-4dec-a980-1d2bdbed5ca1",
    "label": "Converted Declaration",
    "remark": "Auto-generated by AS3 Config Converter",
    "Common": {
        "class": "Tenant",
        "Shared": {
            "class": "Application",
            "template": "shared",
            "keep_allive_test": {
                "keepAliveInterval": "disabled",  ------- Should be a (integer)
                "class": "L4_Profile"
            }
        }
    }
}
mdditt2000 commented 3 years ago

Merge branch 'develop' into CHARON-508-fastl4-keep-alive-interval

mdditt2000 commented 3 years ago

Merge branch 'CHARON-508-fastl4-keep-alive-interval' into 'develop'