F5Networks / f5-appsvcs-extension

F5 BIG-IP Application Services 3 Extension
Apache License 2.0
163 stars 52 forks source link

Posting Per-App declaration delete existing node in tenant #849

Open TOM065SZ opened 5 days ago

TOM065SZ commented 5 days ago

Environment

Summary

When deploying per-application declaration to specific tenant all node created in this tenant are deleted in addition you can not refer in pool members to existing node created in this tenant.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Create an imperative way empty tenant TCL/TMOS auth partition tenant_1 { }

  2. Create an imperative node TCL/TMOS node definition

    ltm node /Common/SharedNode1 { address 192.168.0.4 } ltm node /Common/SharedNode2 { address 192.168.0.5
    } ltm node /tenant_1/AppNode1 { address 192.168.0.6 } ltm node /tenant_1/AppNode2 { address 192.168.0.7 }

  3. Submit the following declaration using POST to https://192.168.250.2/mgmt/shared/appsvcs/declare/tenant_1/applications

    {
    "id": "tneant_1-app1_001",
    "schemaVersion": "3.51.0",
    "controls": {
    "class": "Controls",
    "logLevel": "debug",
    "trace": true
    },
    
    "app1": {
        "class": "Application",
        "enable": true,
    
        "vs-https-app1": {
            "layer4": "tcp",
            "persistenceMethods": [
                "source-address"
            ],
            "pool": "pool-http-app1",
            "translateServerAddress": true,
            "translateServerPort": true,
            "class": "Service_HTTP",
            "profileTCP": {
                "bigip":"/Common/tcp"
            },
            "virtualAddresses": [
                "192.168.10.4"
            ],
            "virtualPort": 80
    
        },
        "pool-http-app1": {
            "loadBalancingMode": "least-connections-node",
            "class": "Pool",
            "members": [
                {
                    "addressDiscovery": "static",
                    "servicePort": 80,
                    "enable":true,
                    "bigip" :"/Common/SharedNode1",
                    "shareNodes": true
                },
                {
                    "addressDiscovery": "static",
                    "servicePort": 80,
                    "enable":true,
                    "bigip" :"/Common/SharedNode2",
                    "shareNodes": true
                }
            ],
            "monitors": [
                {
                    "bigip":"/Common/gateway_icmp"
                }
            ]
        }
    
    }
    }
  4. Check node list in Common and tenant_1 partition nodes from tenant will be deleted

Expected Behavior

I would expect that posting declarations per-ap will not touch any other object which are stored in tenant_1 directly and change only in scope of app folder e.g /tenant_1/app1

Actual Behavior

  1. Nodes that are stored directly in tenant folder are deleted by per-ap declaration in that case AppNode1, AppNode2
  2. You can no refer in pool to node object stored in the tenant e.g.
  ....
   "members": [
                {
                    "addressDiscovery": "static",
                    "servicePort": 80,
                    "bigip" :"/tenant_1/AppNode1",
                    "shareNodes": true
                },
  ...

return error
"code": 422, "message": "declaration failed", "response": "01020036:3: The requested node (/tenant_1/AppNode1) was not found.", "host": "localhost", "tenant": "tenant_1",