Thursday, July 24, 2014

Part 12 - Deleting Unwanted or Stale Resources from vCenter Operations Manager!

In a number of projects I do, I have always noticed that customers have tried to add their test & development vCenter servers, remote site vCenter servers etc. to their production vCOps instance to see if vCOps is able to monitor all the instances across the sites. This could also happen if you by mistake register all the vCenter Servers in a Linked Mode Configuration on the admin page. Later on they realized that they want to use vCOps only for one of the sites and then got rid of the other vCenter Servers.


Now as good as it sounds, it does not really help the vCenter Operations Manager Database as this can result into a number of junk values in the databases which will not be cleared off unless you tweak certain advanced settings in the vCOps collector properties.


Let's have a look at two methods which can adopt to do this. One is manual and the other one in automated. I will show you both and leave it up-to you to chose what you think is right for your infrastructure.


Option 1 - Manually remove resources from Environment Tab

1- Login to vCOps Custom User Interface (Only available with Advanced and Enterprise Edition)

2- Click on Environment - > Environment Overview

3- Here you can see all the Resources which are registered with your instance of vCOps. For resources which you do not require or are stale, select them and click on the Delete Resource icon as shown below:-



Needless to say that this is painful if you have added multiple sources and you are not even sure what should stay and what should go away. If that's the case follow Option 2.

Option 2 - Editing Collector Properties for Deletion of Stale Objects

1- Login to vCOps AnalyticsVM via a ssh client such as putty.

2- Browse to the following directory 


3- Edit the controller.properties file and look for the following values which define the retention period of stale or absent objects



deleteNotExisting = true - Simply means that you want to do a cleanup of resources which are non existing in the vCOps instance. This setting is set to FALSE and should be changed to true for you to cleanup all the junk you don't want.

deletionPeriod = 15 - If the policy is set to delete non existing resources, then they will be deleted post 15 days of there non-existence as per this setting. Change this to 1 Day if you want to cleanup junk resources within 24 hours.

deletionSchedulePeriod = 24 - This setting defines how often vCOps checks for Not Existing Resources.


Once you are done with editing the file, just sudo to the admin account and restart the vCOps Services as shown below



Guess what you are DONE :-)

I would highly recommend that if you are not proficient with Linux commands and editing files, then use Winscp to browse to these files, download them, edit them on a text editor and then upload them back in the system. Stay tuned for more vCOps fun coming your way soon... Till then!

*******************************UPDATE 29-July-2014*******************************

As per the comment from Jon Hemming, I am updating the article with the the information shared by Jon. As per the VMware KB 2020638 originally written by him, he has mentioned:

With vCOPs 5.7, deletionPeriod = 15 is renamed to deletionPeriodInHours = 360 and is, by default, commented. Ensure to uncomment this line.

Thanks Jon :-)

Share and Spread the Knowledge!


No comments:

Post a Comment