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

Pool members aren't being added to AS3 pool #37

Closed raZorTT closed 3 years ago

raZorTT commented 3 years ago

Environment

Summary

Tried using vscode-f5-chariot (v1.12.0) to convert TMSH config into AS3. When I run the conversion over a simple virtual server with a single pool member, the member isn't part of the AS3 output.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Convert following config:

    ltm virtual /Common/vs_hcf_443 {
    destination /Common/192.168.0.1:443
    ip-protocol tcp
    mask 255.255.255.255
    pool /Common/hcf_80
    profiles {
        /Common/tcp { }
    }
    source 0.0.0.0/0
    translate-address enabled
    translate-port enabled
    }
    ltm pool /Common/hcf_80 {
    description hcf_80
    members {
        /Common/10.0.0.1:80 {
            address 10.0.0.1
        }
    }
    monitor /Common/http
    }
    ltm node /Common/10.0.0.1 {
    address 10.0.0.1
    }
  2. Observe the AS3 output:

    {
    "class": "ADC",
    "schemaVersion": "3.27.0",
    "id": "urn:uuid:d58e0962-5bce-4403-9bcf-8c863a24a181",
    "label": "Converted Declaration",
    "remark": "Auto-generated by AS3 Config Converter",
    "Common": {
        "class": "Tenant",
        "Shared": {
            "class": "Application",
            "template": "shared",
            "vs_hcf_443": {
                "layer4": "tcp",
                "pool": "hcf_80",
                "translateServerAddress": true,
                "translateServerPort": true,
                "class": "Service_Generic",
                "virtualAddresses": [
                    "192.168.0.1"
                ],
                "virtualPort": 443,
                "persistenceMethods": [],
                "snat": "none"
            },
            "hcf_80": {
                "remark": "hcf_80",
                "members": [
                    {
                        "addressDiscovery": "static",
                        "servicePort": null
                    }
                ],
                "monitors": [
                    {
                        "bigip": "/Common/http"
                    }
                ],
                "class": "Pool"
            }
        }
    }
    }
  3. Observe the ACC log output

    [2021-06-03T05:40:21.412Z] [INFO]: ACC METADATA {
    recognized: {
    'ltm virtual /Common/vs_hcf_443': {
      destination: '/Common/192.168.0.1:443',
      'ip-protocol': 'tcp',
      mask: '255.255.255.255',
      pool: '/Common/hcf_80',
      profiles: '{',
      '/Common/tcp': {},
      '}': '',
      source: '0.0.0.0/0',
      'translate-address': 'enabled',
      'translate-port': 'enabled'
    },
    'ltm pool /Common/hcf_80': {
      description: 'hcf_80',
      members: '{',
      '}': '',
      monitor: '/Common/http'
    },
    'ltm node /Common/10.0.0.1': { address: '10.0.0.1' }
    },
    supported: {
    'ltm virtual /Common/vs_hcf_443': {
      destination: '/Common/192.168.0.1:443',
      'ip-protocol': 'tcp',
      mask: '255.255.255.255',
      pool: '/Common/hcf_80',
      profiles: '{',
      '/Common/tcp': {},
      '}': '',
      source: '0.0.0.0/0',
      'translate-address': 'enabled',
      'translate-port': 'enabled'
    },
    'ltm pool /Common/hcf_80': {
      description: 'hcf_80',
      members: '{',
      '}': '',
      monitor: '/Common/http'
    }
    },
    unSupported: { 'ltm node /Common/10.0.0.1': { address: '10.0.0.1' } },
    declarationInfo: {
    classes: { Pool: 1, Service_Generic: 1 },
    maps: {
      applications: [ '/Common/Shared' ],
      objects: [ '/Common/Shared/vs_hcf_443', '/Common/Shared/hcf_80' ],
      tenants: [ '/Common' ]
    },
    total: 2
    }
    }

    Expected Behavior

    I am expecting to see the member (10.0.0.1) as part of the AS3 pool output.

Actual Behavior

As you can see from the output there is no pool member being output. Looking at the ACC log it seems to see the pool, but it doesn't output the member IP then either?

'ltm pool /Common/hcf_80': {
      description: 'hcf_80',
      members: '{',
      '}': '',
      monitor: '/Common/http'
    }
mdditt2000 commented 3 years ago

Added fine testing f5-chariot using mac

            "hcf_80": {
                "remark": "hcf_80",
                "members": [
                    {
                        "addressDiscovery": "static",
                        "servicePort": 80,
                        "serverAddresses": [
                            "10.0.0.1"
                        ],
                        "shareNodes": true
                    }
                ],
                "monitors": [
                    {
                        "bigip": "/Common/http"
                    }
                ],
                "class": "Pool"
            }

https://github.com/mdditt2000/f5-appsvcs-acc/tree/master/Github/37

Trying Windows

mdditt2000 commented 3 years ago

breaks using windows. Mac is fine https://github.com/mdditt2000/f5-appsvcs-acc/tree/master/Github/37

mdditt2000 commented 3 years ago

Create Jira CHARON-321 for PM tracking

v-zhuravlev-f5 commented 3 years ago
C:\Users\zhuravlev\acc\f5-as3-config-converter>node --version
v14.17.1

C:\Users\zhuravlev\acc\f5-as3-config-converter>npm install
Terminate batch job (Y/N)?
^C
C:\Users\zhuravlev\acc\f5-as3-config-converter>npm version
{
  'f5-as3-config-converter': '1.14.0',
  npm: '6.14.13',
 ares: '1.17.1',
  brotli: '1.0.9',
  cldr: '39.0',
  icu: '69.1',
  llhttp: '2.1.3',
  modules: '83',
  napi: '8',
  nghttp2: '1.42.0',
  node: '14.17.1',
  openssl: '1.1.1k',
  tz: '2021a',
  unicode: '13.0',
  uv: '1.41.0',
  v8: '8.4.371.23-node.67',
  zlib: '1.2.11'
}

C:\Users\zhuravlev\acc\f5-as3-config-converter>node init -c pool.conf --debug
2021-06-29 15:22:47 INFO 3 BIG-IP objects detected total
2021-06-29 15:22:47 INFO 3 BIG-IP objects recognized by AS3
2021-06-29 15:22:47 INFO 2 BIG-IP objects supported by ACC
2021-06-29 15:22:47 INFO 2 AS3 stanzas generated
2021-06-29 15:22:47 INFO {
    "class": "ADC",
    "schemaVersion": "3.29.0",
    "id": "urn:uuid:95ed3625-a500-44a8-9e5f-5a721f4a2b04",
    "label": "Converted Declaration",
    "remark": "Auto-generated by AS3 Config Converter",
    "Common": {
        "class": "Tenant",
        "Shared": {
            "class": "Application",
            "template": "shared",
            "vs_hcf_443": {
                "layer4": "tcp",
                "pool": "hcf_80",
                "translateServerAddress": true,
                "translateServerPort": true,
                "class": "Service_TCP",
                "profileTCP": {
                    "bigip": "/Common/tcp"
                },
                "virtualAddresses": [
                    "192.168.0.1"
                ],
                "virtualPort": 443,
                "persistenceMethods": [],
                "snat": "none"
            },
            "hcf_80": {
                "remark": "hcf_80",
                "members": [
                    {
                        "addressDiscovery": "static",
                        "servicePort": 80,
                        "serverAddresses": [
                            "10.0.0.1"
                        ],
                        "shareNodes": true
                    }
                ],
                "monitors": [
                    {
                        "bigip": "/Common/http"
                    }
                ],
                "class": "Pool"
            }
        }
    }
}

Need details on a node and npm versions, works fine on my Windows environment.

DumpySquare commented 3 years ago

I think this is related to #28. I will dig into that one and report back.

DumpySquare commented 3 years ago

This should be fixed with the release of vscode-f5-chariot v1.13.0 released 7.6.2021. There was a problem with line returns in windows. The fix was to standardize all line returns on execution.

Please confirm this is working with latest version.

mdditt2000 commented 3 years ago
Change By: @v-zhuravlev-f5

Done In Code Review Done

Closing issue