F5Networks / f5-aws-cloudformation

CloudFormation Templates for quickly deploying BIG-IP services in Amazon Web Services EC2
112 stars 118 forks source link

autoscale via dns fails to add server object to GTM #165

Closed JeffGiroux closed 1 year ago

JeffGiroux commented 2 years ago

Testing DNS scaling with customer and trying the autoscale-via-dns template.

https://github.com/F5Networks/f5-aws-cloudformation/tree/main/supported/autoscale/ltm/via-dns/1nic/existing-stack/payg

When the BIG-IP device tries to list existing GTM server objects as well as create itself as a GTM server object, fail. If you manually create the GTM server object first, then the template is successful and the BIG-IP device successfully adds itself to the GTM.

bigip box error...

2022-03-11T19:16:38.793Z error: [pid: 12430] [scripts/runScript.js] 2022-03-11T19:16:38.792Z debug: [pid: 20358] [lib/bigIp.js] create 10.0.1.130 /tm/gtm/server {"name":"example","datacenter":"us-west-2","product":"generic-host","addresses":["192.0.2.161"]} 

The README states a few pre-reqs. However, it does not mention that the server object MUST be created first too. If this is not the case, then the cloudlibs script need to be updated as that is where the error seems to happen. I noticed that doing a list and create on the server objects is throwing error.

gtm box error...

restjavad-audit.0.log:[I][510][11 Mar 2022 19:07:37 UTC][ForwarderPassThroughWorker] {"user":"local/admin","method":"POST","uri":"http://localhost:8100/mgmt/tm/gtm/server","status":403,"from":"10.0.11.238"}
JeffGiroux commented 2 years ago

To workaround this...simply create a GTM server object with the name that you specify in parameter 'deploymentName'. If the GTM server object is created first, then template will work.

Workaround

  1. define template parameters
    "deploymentName": {
    "Default": "example",
    "Description": "Name the template uses to create object names",
    "MaxLength": 25,
    "Type": "String"
    },
  2. Take note of name...in this case "example"
  3. Create GTM server object named "example", generic host, dummy IP of 192.160.0.100, and select data center
  4. Run autoscale-via-DNS template
shyawnkarim commented 2 years ago

Thanks for pointing this out and for also providing a detailed workaround. We will take a look at this and are now tracking it with internal ID ESECLDTPLT-3068.

shyawnkarim commented 1 year ago

Closing due to age. These legacy templates are now in maintenance mode and are being replaced by our next-generation templates available in the Cloud Templates 2.0 GitHub repo.