Some weeks ago it was announced that OMS now support (in preview at the time of writing) selecting a group of servers/nodes to target a specific solution. In this blog post I will show how to get started with Solution Targeting and in the example I will use the server DPM2016 and let it be the only one that reports to the Solution System Update Assessment.
Before getting started there are some things to notice:
- Currently Solution Targeting only supports the use of direct installed OMS agents and not SCOM agents.
- If using OMS licenses, this makes it possible to mix OMS E1/E2 licenses.
- Want more info? Please see OMS documentation: https://docs.microsoft.com/en-us/azure/operations-management-suite/operations-management-suite-solution-targeting
In OMS Log Analytics, create and save a Log Search query. In this example, I will add the server DPM2016.corp.contoso.com by using the query “Computer=”DPM2016.corp.contoso.com” | distinct Computer”. I will save the computer group to DPM2016.
This can be done both inside the Azure Portal or in the OMS portal. The screenshot is from the OMS portal.
Go to the Azure portal and OMS Log Analytics Workspace. Click Scope Configuration and then +Add.
Give the Scope Configuration a name and add the saved search earlier created. Click Select and then Ok.
Move to Solutions in the Log Analytics Workspace. Search for the solution that you want to add the Solution Targeting Scope to and click it.
Click Solution Targeting by clicking Add scope configuration and add the Scope Configuration created earlier.
Now you are done and this Solution will only target the computers that are in the Computer Group. It can take some time until this kicks in so be patient if you don’t get the result you were hoping for directly.
After some time (as mentioned before, it might take some time before you can see the result) you can run the following queries to see if the Solution Targeting have started to work.
Type=Heartbeat TimeGenerated>NOW-2MINUTES | select Computer, Solutions
Seen in the screenshot the Updates Solution is now only being used on the server in the Computer Group.
Feel free to download and use my Log Analytics view for Azure Automation DSC. To get started with DSC please use the right menu on my blog and look through the examples. Also, before using this view the logs from Azure Automation DSC need to exist in Log Analytics. Please see my earlier post to push the logs into Log Analytics Link.
Picture of Log Analytics View
Link for download view: DSC Node Compliance Status (Last Hour)
Recently it became possible to monitor Azure DSC in Azure Automation with Log Analytics. Here is how to do this setup in the Azure Portal.
First go to the Log Analytics workspace and click on Azure Resources. Select the Automation Account where DSC exists.
Select DscNodeStatus and click Save. In my example, I also want information about jobs in Azure Automation.
Verify that you have nodes added for Azure DSC and then go to Search in Log Analytics.
Do a search for Category=DscNodeStatus and you will see information from Azure DSC.
For more information and to do this in PowerShell, see the following documentation page: https://docs.microsoft.com/en-us/azure/automation/automation-dsc-diagnostics
If you are in the need for keeping a service running or if you have a service that doesn’t start when you reboot your server, DSC in Azure Automation could be the thing for you!
In this post I will show how easy it is to create a DSC configuration that you can import, compile and then use on your servers. This off course works well both in on-premises datacenters as well as in Azure or any other public cloud provider.
Edit the following code and change the service you want to have started and save it to a PowerShell ps1-file (Example: MyDSC.ps1).
Import-DscResource –ModuleName ’PSDesiredStateConfiguration’
Name = "Spooler"
State = "Running"
Create an Azure Automation Account and click on it.
Click DSC Configuration and then Add a configuration up to the left of the portal. Import the file created.
Click on the DSC Configuration in the portal and then Compile. When the compile is Completed you can start to use the configuration.
Click DSC Nodes and add the server you want to use DSC on.
Select if you want to deploy the configuration on an Azure VM och on-prem VM.
This is a great resource to get nice OMS Views and templates for free. Look and search throw this resource on GitHub to see if you find anything that you like!
Off course this nice resource is not just for OMS but for many other services and solutions in Azure too ?