MID Server and AWS Auto Scaling Group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎02-25-2022 12:16 AM
Can a MID server be feasibly set up to use an AWS Auto Scaling Group?
I recall reading in a customer case study somewhere that they didn't worry about sizing the MID server too much because they just relied on the auto scaling groups, but wasn't able to find any more information than a brief mention.
In theory, one could set up a launch template with an image that has a MID server pre-installed and configured to connect to the correct instance, but as far as I can tell, it terminates the EC2 instances and spins up new ones during scale in and scale out events. I see two issues with that:
- There would still be a need to validate each new MID server every time it scales out
- It would create a proliferation of offline MID server agents which would need to be maintained regularly to keep the list manageable.
Unless there's a way to preserve an EC2 instance within an ASG so that it's stopped and started during scale in/out events rather than new instances being launched and then terminated, I don't see how it would work.
Can anyone confirm or correct me on that?
- Labels:
-
Discovery
-
Multiple Versions
- 1,219 Views
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎03-18-2022 12:59 PM
I'm looking for information on how to accomplish this as well. I opened a case and was told it's currently not supported and to submit an idea for dev team so I did. Please upvote it so it gets visibility.
https://community.servicenow.com/community?id=view_idea&sysparm_idea_id=37db6fb5db1e0150f77799ead39619a4&sysparm_idea_table=x_snc_com_ideation_idea&sysparm_module_id=enhancement_requests
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2022 02:38 PM
I see that they recently moved my idea to in review status so hopefully we'll get something official soon!
We were able to make this work by configuring our Terraform pipeline to run the mid server installation script and passing through the required parameters (instance name, user/pass). Once the MID connects to the instance I have a scheduled script running every minute that checks for a new ecc_agent that contains ".ec2.internal" in the hostname and checks the status to make sure it's waiting for validation and not upgrading. Once the MID is ready the scheduled job runs the MID server validation, adds the capabilities, supported applications, and adds it to a cluster for AWS MID servers. Since these are part of an auto scaling group and servers can come and go, another scheduled script runs every 5 min or so looking for a MID with ".ec2.internal" in the hostname, and in the down state for more than 10 min and then removes the MID.
The AWS discovery pattern needs to be set to use MID by capability and when all of the MIDs are part of the same cluster they will all participate in pattern and event based discovery. We've seen MID servers successfully scale in and out of the ASG when the aggerate CPU capacity crosses 25%.