Building a Management pack using VSAE Part 1.

Standard

In this blog post I’m going to take you thru the steps I took to build a management pack using Microsoft Visual Studio Community 2015 in combination whit the Visual Studio Authoring Extensions.

You can download the Visual Studio Community 2015 from here. The Visual Studio Authoring Extensions can be downloaded from here

The application I am going to monitor is Commvault Simpana Version 10 r2. Commvault Simpana is backup application which I use for backing up my environment. More information on Commvault Simpana can be found here.

The application is consist of the following components:

  • CommServe: This component creates the SQL Database that communicates whit all clients and coordinates all operations whit in the CommCell   environments, such as backups, restores, copies and media management operations. Along whit the CommServe software, the following components are automatically installed.
    • CommCell Console: The console is a graphical user interface that allows you to control and manage CommCell operations.
    • Files System: The File system component enables the back-up and restore of files and folders residing on the CommServe computer.
    • Web Server and Web Console:  if the Internet Information Services (IIS) is enabled on the computer, the Web Server component is installed along whit the Web Console Component. The Web Console is a web based application that allows end-users manage their data.
    • Workflow:  Tool that allows you to automate business processes by putting together a set of tasks in a specific order.
  • MediaAgent: This component manages the transmission of data between clients and backup media. Install the MediaAgent component on a Windows or UNIX computer that is configured with the backup media. The backup media is a storage device where you want to store your backed up data.
  • Agent: The Simpana software provides a range of installable components that support the type of data that you want to protect. These components are referred to as agents.

Now that the we know how the application works its time to create a service model for the application. My service model look something like this:

CommVaultSimpanaManagementPackBasicComponent

Creating the Management Pack

  1. Start the “Visual Studio 2015
  2. In the “Microsoft Visual Studio” console in the “Menu” click “File”,”New” and click “Project
    Microsoft Visual Studio - File - New - Project
  3. In the “New Project” console, expand “templates”, “Management Pack”, “Operations Manager”. From the middle click “Operations Manager 2007 r2 Management Pack”. Enter the following data:
    • "Name:" Simpana.CommVault
    • "Location:" D:\Management Pack\Simpana CommVault\
    • "Solution Name" Simpana.CommVault

    Visual Studio - New ProjectClick “Ok” to create the management pack.

  4. In the “Microsoft Visual Studio” console in the “Solution Explorer” right click “Simpana.CommVault” and click “Properties
    Visual Studio - Solution Explorer - Properties
  5. In the “Microsoft Visual Studio” console, on the “Simpana.CommVault” tab click “Build” and select “Generate sealed and Signed Management Pack” Insert the following:
    • "Company Name:" Ms-opsmgr.eu
    • "Copyright:" Copyright (c) Ms-opsmgr.eu. All rights reserved.
    • "Key File:" Simpana.CommVault.snk. If you don’t know how to create a Key File for signing and sealing a management pack take a look at the following blogpost

    Visual Studio - Simpana.Commvault Properties - Build

  6. In the “Microsoft Visual Studio” Console, on the “Simpana.CommVault” tab click “Management Group”, click “Add
  7. In the “Add Management Server….” wizard, enter the “Server Name” and click “Add Server
  8. In the “Microsoft Visual Studio” Console, on the “Simpana.CommVault” tab the result should look something like this:
    Visual Studio - Simpana.CommVault - Management Group
  9. In the “Microsoft Visual Studio” console, on the “Simpana.CommVault” tab click “Deployment”. In the “Start action” select “Deploy projects to default management group only
    Visual Studio - Simpana.CommVault - Deployment
  10. In the “Microsoft Visual Studio” console, in the “Menu” click “File”, “Save

Create a Management Pack Fragment

In this part we are going to create a management pack fragment to give the management pack a friendly name and description when we look in the administration of System Center Operations Manager

  1. In the “Microsoft Visual Studio” console, in the “Solution Explorer” right click “Simpana.CommVault” and click “Add”, “New Item
    VisualStudioNewFragment1
  2. In the “Add New Item – Simpana.Commvault” wizard select “Empty Management Pack Fragment” Enter the following data and click “Add
    • "Name:" Simpana.CommVault.Project

    VisualStudioNewFragment2

  3. In the “Microsoft Visual Studio” console, on the “Simpana.CommVault.Project.mpx” tab enter the following code:
  4. In the “Microsoft Visual Studio” console, in the “Menu” click “File”, “Save
  5. In the “Microsoft Visual Studio” console, in the “Menu” click “Build”, “Build Solution

    Visual Studio - Build - Build Solution

  6. In the “Microsoft Visual Studio” console, on the “Standard” menu bar click “Start” to deploy the management pack.

    Visual Studio - Deploy

  7. Start the “System Center Operations Manager” console click “Administration” and click “Management Pack” and the result should look something like this:

    VisualStudioNewFragment5

Create the Classes whit the base class Windows Computer Roles.

In this part we are going to create the classes that are based on the Windows Computer Role Class. The following classes are going to be created:

  • Abstract Class: CommServe
    • CommCell Console
    • File System
    • Workflow
  • Abstract Class: Media Agents
    • Agent Exchange
    • Agent SharePoint
    • Agent SQL
    • Agent File System

Schematic it will look something like this:

Classes Based On Windows Computer Role

  1. In the “Microsoft Visual Studio” console, in the “Solution Explorer” right click “Simpana.CommVault” and click “Add”, “New Folder

    Visual Studio - Create New Folder

  2. In the “Microsoft Visual Studio” console. in the “Solution Explorer” name the new Folder “Service Model
  3. In the “Microsoft Visual Studio” console, in the “Solution Explorer” on the folder “Service Model” Right click the folder and click “Add”, “New Folder

    VisualStudioNewFolder2

  4. In the “Microsoft Visual Studio” console, in the “Solution Explorer” name the new folder “Classes
  5. In the “Microsoft Visual Studio” console, in the “Solution Explorer” on the folder “Classes”, right click the folder and click “Add”, “New Item
  6. In the “Microsoft Visual Studio” console, in the “Add New Item – Simpana.Commvault” screen select “Class”. Enter the following data and click “Add”:
    • "Name:" ComputerRoles.mpx

    Visual Studio - Create Class - ComputerRoles.mpx

  7. In the “Microsoft Visual Studio” console, on the “ComputerRoles.mpx” tab enter the following code:

  8. In the “Microsoft Visual Studio” console, in the “Solution Explorer” on the folder “Classes”, right click the folder and click “Add”, “New Item
  9. In the “Microsoft Visual Studio” console, in the “Add New Item – Simpana.Commvault” screen select “Class”. Enter the following data and click “Add”:
    • "Name:" Commserve.mpx

    Visual Studio - Create Class - CommServe.mpx

  10. In the “Microsoft Visual Studio” console, on the “CommServe.mpx” tab enter the following code:

  11. In the “Microsoft Visual Studio” console, in the “Solution Explorer” on the folder “Classes”, right click the folder and click “Add”, “New Item
  12. In the “Microsoft Visual Studio” console, in the “Add New Item – Simpana.Commvault” screen select “Class”. Enter the following data and click “Add”:
    • "Name:" MediaAgent.mpx
  13. In the “Microsoft Visual Studio” console, on the “MediaAgent.mpx” tab enter the following code:

  14. In the “Microsoft Visual Studio” console, in the “Menu” click “File”, “Save
  15. In the “Microsoft Visual Studio” console, in the “Menu” click “Build”, “Build Solution
  16. Start the “System Center Operations Manager” console click “Monitoring” and select “Discovered Inventory” and from the “Tasks” pane click “Change Target Type

    Operations Manager Console - Change Target Type

  17. In the “Select Items to target” screen, select “View all targerts” and in the “Look for” bar enter “Simpana”. The result should look something like this: 
    Select Items to Target - Simpana Commvault

Create the Rollups to create a Health service Rollup

In this part we are going to create the classes that are used to create the health service rollup and create the containment relations between the rollups. The following rollups are created: 
CommVault Simpana - Containments

  1. In the “Microsoft Visual Studio” console, in the “Solution Explorer” on the folder “Classes”, right click the folder and click “Add”, “New Item
  2. In the “Microsoft Visual Studio” console, in the “Add New Item – Simpana.Commvault” screen select “Class”. Enter the following data and click “Add”:
    • "Name:" Rollups.mpx

    VisualStudio - Rollups.mpx

  3. In the “Microsoft Visual Studio” console, on the “Rollups.mpx” tab enter the following code:

  4. In the “Microsoft Visual Studio” console, in the “Solution Explorer” on the folder “Classes”, right click the folder and click “Add”, “New Item
  5. In the “Microsoft Visual Studio” console, in the “Add New Item – Simpana.Commvault” screen select “Relationship”. Enter the following data and click “Add”:
    • "Name:" Containments.mpx

    VisualStudioContainments1

  6. In the “Microsoft Visual Studio” console, on the “Containments.mpx” tab enter the following code:

Create the Dependencies relationships

In this part we are going to create the depend relationships for webserver and Web console and SQL Server. The following rollups are created:

CommVault Simpana - Dependecies

  1. In the “Microsoft Visual Studio” console, in the “Solution Explorer” Right click “References” and click “Add Reference

    Visual Studio - Add Reference

  2. In the “Add Reference” screen, click on the “Browse” tab and go to the “C:\Program Files (x86)\System Center Visual Studio Authoring Extensions\References\OM2007R2” select “Microsoft.SystemCenter.InstanceGroup.Library.mp” and click “Ok

    VisualStudio - Add Reference

  3. In the “Microsoft Visual Studio” console, in the “Solution Explorer” select “Microsoft.SystemCenter.InstanceGroup.Library.mp” and in the properties screen change  the “Alias” to “InstanceGroup

    VisualStudio -Change Alias

  4. Repeat step 2 and 3 for the “Microsoft.SQLServer.Library.mp” and change the “Alias” to “SQL
  5. Repeat step 2 and 3 for the “Microsoft.Windows.InternetInformationServices.2012.mp” and change the “Alias” to “IIS2012r2
  6. In the “Microsoft Visual Studio” console, in the “Solution Explorer” on the folder “Classes”, right click the folder and click “Add”, “New Item
  7. In the “Microsoft Visual Studio” console, in the “Add New Item – Simpana.Commvault” screen select “Relationship”. Enter the following data and click “Add”:
    • "Name:" Dependecies.mpx

    Visual Studio - Dependecies

  8. In the “Microsoft Visual Studio” console, on the “Dependecies.mpx” tab enter the following code:

          

  9. In the “Microsoft Visual Studio” console, in the “Menu” click “File”, “Save
  10. In the “Microsoft Visual Studio” console, in the “Menu” click “Build”, “Build Solution

This concludes the first part of building a management pack using Visual studio authoring extensions. If you want to learn more I advise you to follow the training from Brain Wren on the Microsoft Virtual Academy