Monday, 7 January 2019

How to multihome a large number of agents in SCOM!!!



Quick download: https://gallery.technet.microsoft.com/SCOM-MultiHome-management-557aba93



I have written solutions that include tasks to add and remove management group assignments to SCOM agents before:

https://kevinholman.com/2017/05/09/scom-management-mp-making-a-scom-admins-life-a-little-easier/



But, what if you are doing a side by side SCOM migration to a new management group, and you have thousands of agents to move? There are a lot of challenges with that:



1. Moving them manually with a task would be very time consuming.

2. Agents that are down or in maintenance mode are not available to multi-home

3. If you move all the agents at once, you will overwhelm the destination management group.



I have written a Management Pack called “SCOM.MultiHome” that will manage these issues more gracefully.



It contains one (disabled) rule, which will multihome your agents to your intended ManagementGroup and ManagementServer. This is also override-able so you can specify different management servers initially if you wish:



image



This rule is special – in how it runs. It is configured to check once per day (86400 seconds) to see if it needs to multi-home the agent. If it is already multi-homed, it will do nothing. If it is not multi-homed to the desired manaement group, it will add the new management group and management server.

But what is most special, is the timing. Once enabled, it has a special scheduler datasource parameter using SpreadInitializationOverInterval. This is very powerful:




86400
14400






What this will do, is run once per day, but the workflow will not initialize immediately. It will initialize randomly within the time window provided. In the example above – this is 14400 seconds, or 4 hours. This means if I enable the above rule for all agents, they will not run it immediately, but randomly pick a time between NOW and 4 hours from now to run the multi-home script. This keeps us from overwhelming the new environment with hundreds or thousands of agents all at once. You can even make this window bigger or smaller if you desire by editing the XML here.



Next up – the Groups. This MP contains 8 Groups.



image

Let’s say you have a management group with 4000 agents. If you multi-homed all of these to a new management group at once, it would overwhelm the new management group and take a very long time to catch up. You will see terrible SQL blocking on your OpsMgr database and 2115 events about binding on discovery data while this happens.

The idea is to break up your agents into groups, then override the multi-home rule using these groups in a phased approach. You can start with 500 agents over a 4 hour period, and see how that works and how long it takes to catch up. Then add more and more groups until all agents are multi-homed.

These groups will self-populate, dividing up the number of agents you have per group. They query the SCOM database and use an integer to do this. By default each group contains 500 agents, but you will need to adjust this for your total agent count.



86400
20:00
Group1
1
500
300



Also note there is a sync time set on each group, about 5 minutes apart. This keeps all the groups from populating at once. You will need to set this to your desired time, or wait until 10pm local time for them to start populating.

No comments:

Post a Comment

How to Access: Operations Manager Console SCOM 2016

1 How to Access: 1.1 Web Console The Operations Manager Web Console is located here: http://servername/OperationsManager From a browser....