“How to create HP ProLiant objects manually in the CMDB”

Many of my customers start their Service Manager implementation by implementing Configuration Management first. This indeed makes sense, because as soon as objects and relationships are available in the CMDB and under change control, they know what’s going on behind the scenes and get the needed transparency for the infrastructure and their services. And of course they have an excellent base for supporting their processes, e.g. Change Management, Incident Management or Request Fulfillment. The big question here is how all these objects and relations are brought to the CMDB. Well, we all know that one cool thing about Service Manager is the fact that we have different connectors available to easily bring objects from ADDS, SCCM or SCOM to the CMDB.

The HP ProLiant Management Pack for SCOM discovers physical ProLiant Servers and monitors them. By using the SCOM connector in SCSM you have all those Servers in the CMDB within minutes. But I often face customers that either do not have all ProLiant Server monitored by SCOM or are running older ProLiant Server for ESX (why ever …) that are not discovered. One thing you might think of is “Hey easy, I just create these ProLiant CIs manually in the Service Manager console”. Good thought, but impossible.

When ProLiant objects are synched from SCOM to SCSM, you can create views as needed to display those – easy as 1-2-3.

image

Once there, you will also get a “Create HP ProLiant Server” task. Hit it to create a new object … bummer! You will get an error message telling that this is not possible because the objects of the ProLiant class are somehow hosted and there’s no hosting object present.

Let’s investigate this a little bit. When looking out for relationships you will soon find a relationship called “Windows Computer Hosts HP ProLiant Server”. It seems that you first need a Windows Computer object that will later host the ProLiant object. Unfortunately this cannot be configured in the GUI. So we need some PowerShell magic, a script that will create a Windows Computer object and a hosted HP ProLiant Server object at the same time. Sounds easy? Not that easy, but here are the steps you need.

Keep in mind that you can use this procedure not only for HP ProLiant Server objects but for any kind of other objects where you run into the same thing.

Step 1 – Create a Type Projection for the creation process

Because we will have to create both objects at the same time, we need to create a Type Projection with the Windows Computer class as the seed class and the relation to the HP ProLiant Server object. This could look something like this.

<TypeProjection ID=”itnetx.HPProLiant.TypeProjection” Accessibility=”Public” Type=”WindowsLibrary!Microsoft.Windows.Computer”>

<Component Path=”$Target/Path[Relationship=’HPProLiant!HewlettPackard.Servers.ProLiant.WindowsComputerHostsHPProLiantServer’]$” Alias=”HasHPProLiantServer” />

</TypeProjection>

Make sure you have the needed references in the MP, then seal and import the MP.

Step 2 – Create the script

This is how the script could look like.

#Parameters

$name = “WinCompProLiantTest007.xxxxxxxxxx..local”

$manufacturer = “HP” #Manufacturer Name

$model = “ProLiant DL360 G8”

$notes = “Placeholder CI to Host manually created HP ProLiant CI”

import-module smlets

 

#Create Windows Computer CI and hosted ProLiant CI at the same time

$proj = @{__CLASS = “Microsoft.Windows.Computer”;

__OBJECT = @{“PrincipalName” = $name;

“Notes” = $notes;

}

HasHPProLiantServer = @{__CLASS = “HewlettPackard.Servers.ProLiant.HPProLiantServer”;

__OBJECT = @{“DisplayName” = $name;

“NetworkName” = $name;

“PrincipalName” = $name;

“Name” = $name;

“Path” = $name;

“Manufacturer” = $manufacturer;

“Model” = $model;

}

}

}

 

#Create by using the Type Projection from the MP in step 1

New-SCSMObjectProjection -Type itnetx.HPProLiant.TypeProjection -Projection $Proj

Step 3 – Check out the Result

First lets check the Windows Computer object.

image

image

OK, looks god so far. Now let’s go for the HP ProLiant server object. It’s there.

image

Open and check the details. Don’t let the screenshot below confuse you. This is from an environment with tons of extensions that is using custom forms. So your form may look different. But your form should hold the defined data from the script. Feel free to add values for all other attributes as needed.

image

Cool, with this procedure you can bring all HP ProLiant objects to the CMDB within minutes, even those that are not managed by SCOM. The same procedure also works for other object types/classes. Just change Type Projection Names, Attributes etc. and you are ready to go!

For some more details about the described procedure also check out this blog post from Travis.

Have fun!
Marcel

This entry was posted in SCSM and tagged , , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s