Strangest thing was that other views they had also created could be deleted without any problem. So I had to dive deeper and to find the difference between the views which could be deleted and the ones which couldn’t.
First thing I noticed that the problematic views weren’t displayed in the correct order. Normally the available views in the monitoring pane are being displayed in alphabetical order, but these views seemed to appear in random order.
The SCOM Administrators didn’t have any clue. But when I told them that it seemed like these problematic views did have another name than being showed in the Console they told me these views did have other names when they were created.
Soon enough it appeared that all the Views which couldn’t be deleted did have other names when they were created. When I asked them how they had changed the name of the view they told me by selecting it, hitting <F2> and then changing it.
So there was the cause. And the remedy was simple.
Explanation
When one creates a View, an AlertView for instance, this View is stored in the Default MP. And the name of this View is written into this MP. So far so good. See the screendump of the xml-code describing this AlertView. As an example, the name of the AlertView is Tezt Alertview:
Now I change in the Console the name of this View by using the F2 method. (Selecting the View, hitting F2 and then retype the name) I change the name of the View to F2Alertview. Notice that the View is not being showed in alphabetical order, even after a refresh or dumping the cache of the Console:
Lets export the Default MP, open it in good old notepad and when I search for the name F2 Alertview it is nowhere to be found. As a matter of fact, the old name Tezt Alertview is still in the xml-code of the Default MP:
So there is the reason these changed Views cannot be deleted: the Default MP still has the old name and when one wants to delete it, it’s changed name cannot be found in the Default MP. Hence the errormessage.
Best Practice
So how to go about when changing a name of a View? Better is to right-click it, and select its properties. In the properties screen one can change its name:
And save the changes. When one looks at the xml-code of the Default MP, now the name change will be there as well:
Eventhough the original name is still to be found in the Default MP, the new name has an entry as well. So now when one wants to delete this view, it won’t be any problem what so ever.
This best practice is not only to be used for Views in SCOM but for all objects. Whenever a name needs to be changed, do not use the F2 option, but lookup its properties and change it from there.
No comments:
Post a Comment