Deleting custom adapter kinds from vRealize Operations Manager 6.6.x


If you need to delete custom adapter kinds and custom resource kinds from vROPs 6.6.x, VMware support can create a .pak file tailored to your resource kind names.  By installing the .pak file as a solution to vROPs, and then uninstalling it, it will remove the custom adapter kinds entirely.

There is no way to do this thru the GUI or API.  I’d like to see VMware add a REST DELETE method to support this in a future release of the product.

Context – Adding Custom Metrics in vRealize Operations

Let’s say you want to use vRealize Operations Manager to track metrics for some kind of resource that isn’t already available in the solution adapter ecosystem.  For example, performance and capacity information for Cloudian Hyperstore such as S3 operations per second and bytes used by group.

This is totally possible using the vROPS REST API, and you might even use Python to do it, possibly with the vROPS Python client “nagini”.  This has been documented several times already.

What happens when you add custom metrics via the REST API?

When you push custom metrics, you define a new adapter kind and resource kind(s).  vRealize Operations Manager creates a new adapter of type “OPENAPI” to track your objects.  They look like this in the Environment tree:

Unfortunately, it is not possible through the REST API nor the web user interface to DELETE these adapter kinds and resource kinds after they have been created.  You can delete the instances of the adapters and resources, but not remove the kind from the schema.

Why do we need to remove custom adapter kinds anyway?

This can be a problem for several reasons.  For example, when developing against vROPs, certain characteristics of resources are defined the first time the resource is created and cannot be modified later.

In particular, using custom resourceIdentifiers, used to identify objects by a set of IDs beyond simple object name matching, the custom resource identifier fields must be defined the first time the resource is created, in my experience anyway.

From the Administration -> Inventory view, here’s an example of custom resource identifiers, all 4 items listed under “Basic Settings” in the screenshot:

The only way to modify the schema here, as far as I am aware, is to entirely remove the resource kind and recreate it ensuring all desired custom resource identifier fields are defined on the first push to vROPs.

Hope this helps.

VMware vROPs custom resourceIdentifiers API Error 1501 with

When pushing custom resource kinds using the vROPs Python nagini client’s find_create_resource_push_data() method, and you include custom resourceIdentifiers, you might get an error:

You can fix this by creating your own version of the find_create_resource_push_data() and find_create_resource_with_adapter_key() methods.  You need to handle the API exception, and treat the error condition as if your call to find the resource succeeded but returned no results.

This code is just an incomplete example.

vROPs Python Client and Unexpected “Resource not found”

Using the vRealize Operations Manager 6.6 Python nagini client (version 1.0), I encountered an interesting unexpected result when using the client to push custom metrics to vROPs.  For context, see this blog post on creating a custom metric adapter for vROPs.

This error occurred when pushing resource metrics to vROPS:

In particular, last line indicates the vROPS API returned an error “resource… already exists”, which means the nagini client is attempting to create the resource:

The method find_create_resource_push_data() is supposed to find existing resources and not attempt to recreate them. So what is going wrong?

To figure this out, I followed my normal debugging procedure of breaking this down into smaller parts. Reading through the nagini client Python code, the nagini client makes a call to get_resources_with_adapter_and_resource_kind() and parses the results to determine if the resource already exists.

So, I ran just that method with my specific parameters, and to my unfortunate surprise received two results back – two resources were found. However the method find_create_resource_with_adapter_key() expects only a single result, otherwise it goes into its “create resource” mode. A more helpful error message here would be great and easy to add, something like “if len(results) > 1 throw an error that you have too many resource hits.” Oh well.

From the API documentation page for the underlying method, getResourcesWithAdapterandResourceKind, I identified the root cause:

Query for Resources within a particular Adapter Kind and Resource Kind.
Optionally filter these resources based on resource name. The resource name (specified as a query parameter) will be used for doing a partial match.

In my case, the specific resource name is also a subset of another resource name.  Hence the bug.

Without any way to control partial vs. exact match in the API currently, my two options are to re-implement this portion of the nagini client logic and do the exact name match filtering in Python, or to use the richer resource identifier method which allows specifying multiple keys for a resource to help identify it with more than simple name matching.

Hope this helps.


Packet Capture on ESXi, pktcap-uw Helper Script

By now, pktcap-uw, the VMware tool to run flexible packet captures on ESXi hosts, including capturing VM vnic traffic, is old news.  It’s great, but when I need to use it, I always have to take a minute to remember syntax and method.  I’d rather spend my mental energy troubleshooting the networking issue that necessitated the packet capture in the first place.

So, I wrote a small helper script that enables this simple syntax:

It generates three pcap files, for input, output, and drops.  Get the script and instructions here:


Understanding vRealize Log Insight Event Forwarding Filters Behavior

vRealize Log Insight enables generic event forwarding via the syslog protocol.  The Event Forwarding filters, at least to me, were initially not the most intuitive.  So, here’s what I’ve learned using vRLI 4.5.

Understanding Implicit Conditional Operators

First, notice the gap between *Key1* and *Key2*.  That indicates they are two separate criteria (values) that will satisfy the filter rule.  Filter rules evaluate true when ANY value for a specific filter rule meets the criteria.  So, there is an implicit OR between all the values for a particular rule.

Second, filter rules are additive.  There is an implicit AND between all the filter rules assigned to an Event Forwarding Destination.

“Not Match” Adds Complexity

Consider these two equivalent scenarios:

  • Scenario 1
    • text does not match *Key1*
    • text does not match *Key4*

There is an implicit AND between the two filters.  So messages will not be forwarded if they contain either Key1 or Key4.  Think of it as !(match *Key1*) AND !(match *Key4*).

  • Scenario 2
    • text does not match *Key1* *Key4*

Think of this as not (match *Key1* OR match *Key4*).  If the message contains Key1 or Key4, it will match the parenthesized condition, then the negation is applied.  Net result, a message containing any of the “not match” values.


I recorded actual test results, by crafting sample syslog messages using a generator pointed to Log Insight, and configuring an Event Forwarder using the following filters.  I observed the results with a generic syslog-ng instance configured to receive the forwarded events from Log Insight.

Because of its importance, I denoted where multiple values to a filter are separated by pressing [Enter] after typing each value.  If you just separate the values by a space, you will end up with a single value like “Key1 Key2” instead of “Key1”, “Key2”.  This is easy (for me) to mistype, so here’s one last screenshot to remind you:

Showing multiple separate values that have an implicit OR (*Key1* OR *Key2*).

Finally, here are my test results for reference:

Filters Results Analysis
hostname matches host1
hostname matches host2
no msgs forwarded filter1 AND filter2
hostname matches host1[Enter] host2[Enter] all msgs forwarded value1 OR value2
text matches Key1 no msgs forwarded entire text must match "Key1"!
text matches *Key1* msgs with Key1 forwarded
text matches *Key1*[Enter] *Key4*[Enter] all messages forwarded value1 OR value2
text matches *Key1*
text does not match *Key4*
msgs with Key1 and not Key4 (match value1) AND !(match value2)

Hope this helps.

Recent Posts



GiottoPress by Enrique Chavez