Targeting workflows to Resource pools


<!--[if lt IE 9]>

<![endif]-->

Comments (13)
  1. Back in November I blogged a variant of this that will make a SCOM-2007-safe MP. http://blogs.technet.com/b/omx/archive/2013/11/15/use-the-all-management-servers-resource-pool-to-run-scheduled-tasks.aspx Although I’m curious if/how you could target a different
    resource pool. For example, I have a group of gateways in a remote data center that are in a resource pool. How could I target their resource pool? I never figured that one out.

  2. Mario says:

    Very usefull, thanks for sharing!

  3. Jonathan says:

    Had not thought about targeting resource pools in monitoring workflows before now. This can be useful in certain types of operational tasks that you might want to run in the management group. Previously, I would have targeted the RMSE, but will now target
    a resource pool. Thanks for the idea 🙂

  4. Bill C says:

    I created a couple of two-state script monitors targeting the AMSRP which works great, however, if I place one monitor into MMode, the entire pool goes into MMode. What targeting consideration am I missing?

  5. SK says:

    I am seeing resource pool workflow distribution issue on my setup.
    I have custom resource pool created. There were 2 management servers added to it. After a day or 2, I removed one of the servers from the resource pool.
    And SCOM is still distributing workflows to that management server. These workflows are targeted on the entities managed by resource pool.
    Can you provide any suggestions?

  6. Ehrnst says:

    Hi,

    I have written a PS script discovery wich i planned to run against the AMSRP but the discovery doesent seem to run. If i change target to “management server” it Works just fine. Is ther any thing i am missing?

    1. Kevin Holman says:

      if you change target to MS it runs on all MS in the pool. If you change it to target a pool, it will run only on the MS that hosts the instance of the pool class, which will be one of the MS in the pool.

      1. Hi Kevin

        Do you know if it’s possible to run a on-demand discovery task for a discovery that targets the AMSRP? And if so which target class instance should we provide? If I try using the target instance returned from say

        Get-SCOMClass -Name Microsoft.SystemCenter.AllManagementServersPool|Get-SCOMClassInstance

        the discovery task returns ‘DISCOVERY_NOT_FOUND’

        Thanks

        Michael

        1. Kevin Holman says:

          I don’t. What’s the scenario?

          1. Thanks for asking 🙂 Well, here’s the scenario:

            Just as you’ve demonstrated monitors having the resource pool “All Management Servers Resource Pool” (AMSRP) as target, discoveries can also have AMSRP as target. An example of this, is the standard discovery “Discover Operational Database Watchers” of the management pack “System Center Internal Library”.

            During my development of management packs I usually run the on-demand discovery tasks (to speed up the discovery). However I’ve not been able to run the on-demand discovery task successfully for discoveries that targets the AMSRP. Every time the task result is ‘DISCOVERY_NOT_FOUND’.

            Here an example:

            $task= get-scomtask -name Microsoft.SystemCenter.TriggerOnDemandDiscovery

            $discovery = Get-SCOMDiscovery -DisplayName ‘Discover Operational Database Watchers’

            $target = Get-SCOMResourcePool -DisplayName ‘All Management Servers Resource Pool’

            $overrides=@{DiscoveryId=$discovery.Id.ToString();TargetInstanceId=$target.Id.ToString()}

            $managementServer = (Get-SCOMManagementServer)[0]

            $instance=get-scomclass -name Microsoft.SystemCenter.HealthService| get-scomclassinstance | ?{$_.displayname -eq ($managementServer.DisplayName)}

            start-scomtask -task $task -instance $instance -override $overrides

  7. David Knight says:

    If I target a powershell script workflow at the AMSRP that uses the operationsmanager module to get information about the management group (such as get-scommanagementserver, get-scomresourcepool, etc.), it succeeds just fine running every 15 minutes until after roughly 24 hours, it begins to fail. If I restart the healthservice on the management server hosting the AMSRP, it will succeed once again for roughly 24 hours and then begin failing once more.

    Any idea what the cause and solution to that might be?

    1. Kevin Holman says:

      Yes David I have seen this very issue with my customers. It seems to happen when the SDK is very busy on a management server. Scripts running on the management server stop being able to reliably connect to the SDK, or load the SCOM module. What I have found is that Import-Module OperationsManager becomes unreliable. What I have done is change my custom SDK connecting scripts to use this, which seems to resolve the issue:

      #Connect to SCOM Management Group Section
      #=================================================================================
      $MServer = “localhost”
      # Clear any previous errors
      if($Error)
      {
      $Error.Clear()
      }

      # Import the OperationsManager module and connect to the management group
      Try
      {
      $SCOMPowerShellKey = “HKLM:\SOFTWARE\Microsoft\System Center Operations Manager\12\Setup\Powershell\V2”
      $SCOMModulePath = Join-Path (Get-ItemProperty $SCOMPowerShellKey).InstallDirectory “OperationsManager”
      Import-module $SCOMModulePath
      }
      Catch
      {
      $momapi.LogScriptEvent($ScriptName,9876,2, “Unable to load the OperationsManager module, Error is: $error”)
      }
      Try
      {
      New-DefaultManagementGroupConnection $MServer
      }
      Catch
      {
      $momapi.LogScriptEvent($ScriptName,9876,2, “Unable to connect to the management server: $MServer. Error when calling New-DefaultManagementGroupConnection. Error is: $error”)
      }
      #=================================================================================

  8. Marc says:

    Hi Kevin,
    If I make a custom ressource pool with gateways, and I target workflows on it, will they really be executed on the gateways ?

    Since all the classes used for the ressource pools aren’t hosted, i doubt that my workflows will run on any management servers instead of the selected gateways.

    Thank you,
    Marc

Comments are closed.

Skip to main content