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

GSLB Server and proberPool not created #637

Closed
paolobeta71 opened this issue Aug 5, 2022 · 8 comments
Closed

GSLB Server and proberPool not created #637

paolobeta71 opened this issue Aug 5, 2022 · 8 comments
Labels
bug Something isn't working

Comments

@paolobeta71
Copy link

paolobeta71 commented Aug 5, 2022

Environment

  • Application Services Version: 3.38.0
  • BIG-IP Version: 15.1.5

Summary

Trying to create using PATCH method a GSLB configuration that will create a GSLB Server with Prober Pool. The declaration also tries to create the prober pool itself but provides the following error:

{
    "code": 422,
    "errors": [
        "/Common/Shared/ACME-PAOLO-02: should NOT have additional properties"
    ],
    "declarationFullId": "",
    "message": "declaration is invalid"
}

Steps To Reproduce

Steps to reproduce the behavior:

  1. Submit the following declaration using PATCH method to AS3:
[      
  { 
    "op": "add",
    "path": "/Common/Shared/ACME-PAOLO-02",
    "value": { 
                "class": "GSLB_Server",
                "serverType": "bigip",
                "monitors": [
                        
                    ],
                "dataCenter": { 
                    "bigip": "/Common/testDataCenter"
                },
                "proberPreferred": "pool",
                "proberPool": {
                    "use": "prober_pool_02"
                },
                
                "devices":[
                    {
                        "label": "ACME-PAOLO-02",
                        "address": "1.2.9.20"
                    } 
                ],
                "virtualServers": [
                    {
                        "name": "ACME-PAOLO_VS2",
                        "address": "1.2.9.20",
                        "port": 0
                    }
                ],
                "prober_pool_02": {
                "class": "GSLB_Prober_Pool",
                    "members": [
                        {
                        "server": {
                        "bigip": "/Common/ACME-PAOLO"
                        },
                        "memberOrder": 0                        
                        }
                    ],
                    "lbMode": "global-availability"        
                }                
            }                              
    }
]
  1. Observe the following error response:
{
    "code": 422,
    "errors": [
        "/Common/Shared/ACME-PAOLO-02: should NOT have additional properties"
    ],
    "declarationFullId": "",
    "message": "declaration is invalid"
}

Expected Behavior

GSLB Server ACME-PAOLO-02 created with prober pool prober_pool_02 also created by the same declaration and referenced within the created GSLB Server

Actual Behavior

The declaration doesn't create the objects and replies with the error provided.

@paolobeta71 paolobeta71 added bug Something isn't working untriaged Issue needs to be reviewed for validity labels Aug 5, 2022
@dstokesf5
Copy link
Contributor

@paolobeta71 Can you provide the initial declaration before the PATCH request, or do a GET to the declare endpoint to get the state before the PATCH request?

@dstokesf5 dstokesf5 added question Further information is requested and removed untriaged Issue needs to be reviewed for validity labels Aug 17, 2022
@mdditt2000
Copy link

@paolobeta71 i believe this is resolved in AS3-40. Please reach out to automation_toolchain_pm@f5.com to get an early released image.

@paolobeta71
Copy link
Author

paolobeta71 commented Sep 7, 2022

In response to Daniel request.
The first POST request is the following:
POST https://10.1.1.245/mgmt/shared/appsvcs/declare

{
    "class": "ADC",
    "schemaVersion": "3.25.0",
    "id": "GSLB_Sample",
        "Automation": { 
        "class": "Tenant",
        "Shared": { 
            "class": "Application",
            "template": "shared",
            "GSLB_testPool": { 
                "class": "GSLB_Pool",
                "resourceRecordType": "A",  
                "enabled": true,
                "fallbackIP": "127.0.0.1",
                "lbModeFallback": "drop-packet",
                "lbModeAlternate": "none",
                "lbModePreferred": "fallback-ip"
                }
            }
        }
    }

This is also the answer for the GET request to the declare endpoint:

{
    "Fast": {
        "class": "Tenant",
        "nginx-http-70_vs": {
            "class": "Application",
            "service": {
                "class": "Service_HTTP",
                "virtualAddresses": [
                    "10.1.10.170"
                ],
                "pool": "http_pool"
            },
            "http_pool": {
                "class": "Pool",
                "monitors": [
                    "http"
                ],
                "members": [
                    {
                        "servicePort": 80,
                        "addressDiscovery": "consul",
                        "updateInterval": 10,
                        "uri": "http://10.0.0.100:8500/v1/health/service/nginx?passing",
                        "jmesPathQuery": "[].{id:Node.Address,ip:{private:Node.Address,public:Node.Address},port:Service.Port}"
                    }
                ]
            }
        },
        "nginx-http-71_vs": {
            "class": "Application",
            "service": {
                "class": "Service_HTTP",
                "virtualAddresses": [
                    "10.1.10.171"
                ],
                "pool": "http_pool"
            },
            "http_pool": {
                "class": "Pool",
                "monitors": [
                    "http"
                ],
                "members": [
                    {
                        "servicePort": 80,
                        "addressDiscovery": "consul",
                        "updateInterval": 10,
                        "uri": "http://10.0.0.100:8500/v1/health/service/nginx?passing",
                        "jmesPathQuery": "[].{id:Node.Address,ip:{private:Node.Address,public:Node.Address},port:Service.Port}"
                    }
                ]
            }
        }
    },
    "UDP_partition": {
        "class": "Tenant",
        "DNS_Service": {
            "class": "Application",
            "service": {
                "class": "Service_UDP",
                "virtualPort": 53,
                "virtualAddresses": [
                    "10.1.10.121"
                ],
                "pool": "dns_pool"
            },
            "dns_pool": {
                "class": "Pool",
                "monitors": [
                    {
                        "use": "udp_custom_53"
                    },
                    "icmp"
                ],
                "minimumMonitors": "all",
                "members": [
                    {
                        "servicePort": 53,
                        "serverAddresses": [
                            "172.16.10.239"
                        ]
                    }
                ]
            },
            "udp_custom_53": {
                "class": "Monitor",
                "monitorType": "udp",
                "adaptive": false
            }
        }
    },
    "Automation": {
        "class": "Tenant",
        "Shared": {
            "class": "Application",
            "template": "shared",
            "GSLB_testPool": {
                "class": "GSLB_Pool",
                "resourceRecordType": "A",
                "enabled": true,
                "fallbackIP": "127.0.0.1",
                "lbModeFallback": "drop-packet",
                "lbModeAlternate": "none",
                "lbModePreferred": "fallback-ip"
            },
            "record.info.it": {
                "class": "GSLB_Domain",
                "domainName": "record.info.it",
                "resourceRecordType": "A",
                "poolLbMode": "global-availability",
                "pools": [
                    {
                        "use": "/Automation/Shared/GSLB_testPool"
                    }
                ]
            },
            "testPoolCNAME": {
                "class": "GSLB_Pool",
                "resourceRecordType": "CNAME",
                "members": [
                    {
                        "domainName": "record.info.it",
                        "enabled": false
                    }
                ]
            },
            "testCNAME.it": {
                "class": "GSLB_Domain",
                "domainName": "testCNAME.it",
                "resourceRecordType": "CNAME",
                "poolLbMode": "round-robin",
                "pools": [
                    {
                        "use": "/Automation/Shared/testPoolCNAME"
                    }
                ]
            }
        }
    },
    "Common": {
        "class": "Tenant",
        "Shared": {
            "class": "Application",
            "template": "shared",
            "Paolo-DC": {
                "class": "GSLB_Data_Center"
            },
            "pool_nomatch": {
                "class": "GSLB_Pool",
                "resourceRecordType": "A",
                "enabled": true,
                "fallbackIP": "127.0.0.1",
                "lbModeFallback": "drop-packet",
                "lbModeAlternate": "none",
                "lbModePreferred": "fallback-ip"
            },
            "ACME-PAOLO": {
                "class": "GSLB_Server",
                "serverType": "bigip",
                "monitors": [],
                "dataCenter": {
                    "use": "Paolo-DC"
                },
                "proberPreferred": "pool",
                "proberPool": {
                    "bigip": "/Common/prober_pool_01"
                },
                "devices": [
                    {
                        "label": "ACME-PAOLO",
                        "address": "1.2.9.19"
                    }
                ],
                "virtualServers": [
                    {
                        "name": "ACME-PAOLO_VS",
                        "address": "1.2.9.19",
                        "port": 0
                    }
                ]
            },
            "prober_pool_02": {
                "class": "GSLB_Prober_Pool",
                "members": [
                    {
                        "server": {
                            "use": "/Common/ACME-PAOLO"
                        },
                        "memberOrder": 0
                    }
                ],
                "lbMode": "global-availability"
            }
        }
    },
    "class": "ADC",
    "updateMode": "selective",
    "schemaVersion": "3.0.0",
    "id": "DNS",
    "DNS_Zones": {
        "class": "Tenant",
        "TEST_DNS_Zone": {
            "class": "Application",
            "dnsZone": {
                "class": "DNS_Zone",
                "label": "dnsZone",
                "remark": "DNS Zone test",
                "dnsExpress": {
                    "enabled": true,
                    "nameserver": {
                        "use": "dnsNameserverZone"
                    },
                    "notifyAction": "consume",
                    "allowNotifyFrom": [
                        "10.1.1.1"
                    ],
                    "verifyNotifyTsig": false
                },
                "responsePolicyEnabled": true,
                "serverTsigKey": {
                    "use": "tsigKeyZone"
                },
                "transferClients": [
                    {
                        "use": "dnsNameserverZone"
                    }
                ]
            },
            "dnsNameserverZone": {
                "class": "DNS_Nameserver",
                "label": "dnsNameserverZone",
                "address": "10.1.1.2",
                "port": 53,
                "routeDomain": {
                    "bigip": "/Common/0"
                },
                "tsigKey": {
                    "use": "tsigKeyZone"
                }
            },
            "tsigKeyZone": {
                "class": "DNS_TSIG_Key",
                "label": "tsigKeyZone",
                "remark": "TSIG Key test",
                "algorithm": "hmacmd5",
                "secret": {
                    "ciphertext": "JE0kUVckWFJmSmhoYVc2SHFrTTlyVXpiRHI3Zz09",
                    "miniJWE": true,
                    "protected": "eyJhbGciOiJkaXIiLCJlbmMiOiJmNXN2In0=",
                    "ignoreChanges": true,
                    "allowReuse": false
                }
            }
        }
    },
    "controls": {
        "archiveTimestamp": "2022-08-05T23:16:32.433Z"
    }
}

i'll also follow Mark suggestion and ask for testing with AS3-40.

Thanks
Paolo

@github-actions github-actions bot removed the question Further information is requested label Sep 7, 2022
@dstokesf5 dstokesf5 added the untriaged Issue needs to be reviewed for validity label Sep 7, 2022
@sunitharonan
Copy link

Please reach out to automation_toolchain_pm@f5.com to get an early released image to test it.

@sunitharonan sunitharonan added question Further information is requested and removed untriaged Issue needs to be reviewed for validity labels Sep 12, 2022
@paolobeta71
Copy link
Author

Hi, tested with the preview of AS3-40...
I'm receiving the same error....
Declaration:
PATCH -> https://10.1.1.245/mgmt/shared/appsvcs/declare
[
{
"op": "add",
"path": "/Common/Shared/ACME-PAOLO-02",
"value": {
"class": "GSLB_Server",
"serverType": "bigip",
"monitors": [

                ],
            "dataCenter": { 
                "bigip": "/Common/testDataCenter"
            },
            "proberPreferred": "pool",
            "proberPool": {
                "use": "prober_pool_02"
            },
            
            "devices":[
                {
                    "label": "ACME-PAOLO-02",
                    "address": "1.2.9.20"
                } 
            ],
            "virtualServers": [
                {
                    "name": "ACME-PAOLO_VS2",
                    "address": "1.2.9.20",
                    "port": 0
                }
            ],
            "prober_pool_02": {
            "class": "GSLB_Prober_Pool",
                "members": [
                    {
                    "server": {
                    "bigip": "/Common/ACME-PAOLO"
                    },
                    "memberOrder": 0                        
                    }
                ],
                "lbMode": "global-availability"        
            }                
        }                              
}

]

Result with error:
{
"code": 422,
"errors": [
"/Common/Shared/ACME-PAOLO-02: should NOT have additional properties"
],
"declarationFullId": "",
"message": "declaration is invalid"
}

@github-actions github-actions bot removed the question Further information is requested label Sep 14, 2022
@RobCupples
Copy link

RobCupples commented Sep 17, 2022

The additional property is "prober_pool_02". It should not be nested inside the GSLB_Server. This is trying to add a GSLB_Server located at /Common/Shared/ACME-PAOLO-02. I would split this into 2 separate PATCH's. I don't think this can be done as a single PATCH but I want to do some more research and consult with my colleagues.

Let me run through on my machine how I would do this.

First I'm going to create a GSLB_Prober_Pool at /Common/prober_pool_01 to be referenced by 'bigip' later.

POST mgmt/tm/gtm/prober-pool

{
    "name": "prober_pool_01"
}

Now I'm going to create the /Common/Shared that you showed from your machine

POST mgmt/shared/appsvcs/declare

{
    "class": "AS3",
    "declaration": {
        "class": "ADC",
        "schemaVersion": "3.0.0",
        "id": "DNS",
        "Common": {
            "class": "Tenant",
            "Shared": {
                "class": "Application",
                "template": "shared",
                "Paolo-DC": {
                    "class": "GSLB_Data_Center"
                },
                "pool_nomatch": {
                    "class": "GSLB_Pool",
                    "resourceRecordType": "A",
                    "enabled": true,
                    "fallbackIP": "127.0.0.1",
                    "lbModeFallback": "drop-packet",
                    "lbModeAlternate": "none",
                    "lbModePreferred": "fallback-ip"
                },
                "ACME-PAOLO": {
                    "class": "GSLB_Server",
                    "serverType": "bigip",
                    "monitors": [],
                    "dataCenter": {
                        "use": "Paolo-DC"
                    },
                    "proberPreferred": "pool",
                    "proberPool": {
                        "bigip": "/Common/prober_pool_01"
                    },
                    "devices": [
                        {
                            "label": "ACME-PAOLO",
                            "address": "1.2.9.19"
                        }
                    ],
                    "virtualServers": [
                        {
                            "name": "ACME-PAOLO_VS",
                            "address": "1.2.9.19",
                            "port": 0
                        }
                    ]
                },
                "prober_pool_02": {
                    "class": "GSLB_Prober_Pool",
                    "members": [
                        {
                            "server": {
                                "use": "/Common/ACME-PAOLO"
                            },
                            "memberOrder": 0
                        }
                    ],
                    "lbMode": "global-availability"
                }
            }
        }
    }
}

Now I first PATCH in the GSLB_Prober_Pool /Common/Shared/prober_pool_02. I refer to /Common/ACME-PAOLO with "use" instead of "bigip" because it was previously created by AS3.

PATCH mgmt/shared/appsvcs/declare

[
    {
        "op": "add",
        "path": "/Common/Shared/prober_pool_02",
        "value": {
            "class": "GSLB_Prober_Pool",
            "members": [
                {
                    "server": {
                        "use": "/Common/ACME-PAOLO"
                    },
                    "memberOrder": 0
                }
            ],
            "lbMode": "global-availability"
        }
    }
]

For the next step I need to create the GSLB_Data_Center /Common/testDataCenter on my machine so I can refer to it with "bigip" in the next PATCH.

POST mgmt/tm/gtm/datacenter

{
    "name": "testDataCenter"
}

Finally I'm going to PATCH in the GSLB_Server /Common/Shared/ACME-PAOLO-02. Note how I reference "prober_pool_02" with "use". It isn't being created here but it was previously created with AS3 so I can use "use".

This step will actually fail on your machine right now. This is because I found an actual bug here that I'm going to fix for this issue. You cannot refer to a proberPool with a "use" reference.

PATCH mgmt/shared/appsvcs/declare

[
    {
        "op": "add",
        "path": "/Common/Shared/ACME-PAOLO-02",
        "value": {
            "class": "GSLB_Server",
            "serverType": "bigip",
            "monitors": [],
            "dataCenter": {
                "bigip": "/Common/testDataCenter"
            },
            "proberPreferred": "pool",
            "proberPool": {
                "use": "prober_pool_02"
            },
            "devices": [
                {
                    "label": "ACME-PAOLO-02",
                    "address": "1.2.9.20"
                }
            ],
            "virtualServers": [
                {
                    "name": "ACME-PAOLO_VS2",
                    "address": "1.2.9.20",
                    "port": 0
                }
            ]
        }
    }
]

@RobCupples
Copy link

It is also possible to combine the 2 PATCH operations into an array and post a single time. This example assumes that the /Common/testDataCenter in my POST above is already on the bigip so it can be referenced with "bigip". Once again, this will not work for you right now because I'm fixing the broken "proberPool" "use"-reference.

PATCH mgmt/shared/appsvcs/declare

[
    {
        "op": "add",
        "path": "/Common/Shared/prober_pool_02",
        "value": {
            "class": "GSLB_Prober_Pool",
            "members": [
                {
                    "server": {
                        "use": "/Common/ACME-PAOLO"
                    },
                    "memberOrder": 0
                }
            ],
            "lbMode": "global-availability"
        }
    },
    {
        "op": "add",
        "path": "/Common/Shared/ACME-PAOLO-02",
        "value": {
            "class": "GSLB_Server",
            "serverType": "bigip",
            "monitors": [],
            "dataCenter": {
                "bigip": "/Common/testDataCenter"
            },
            "proberPreferred": "pool",
            "proberPool": {
                "use": "prober_pool_02"
            },
            "devices": [
                {
                    "label": "ACME-PAOLO-02",
                    "address": "1.2.9.20"
                }
            ],
            "virtualServers": [
                {
                    "name": "ACME-PAOLO_VS2",
                    "address": "1.2.9.20",
                    "port": 0
                }
            ]
        }
    }
]

@sunitharonan
Copy link

This has been resolved in the 3.40.0 release of AS3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants