top of page

Using Claude for VCF Operations Super Metrics

  • Writer: Brock Peterson
    Brock Peterson
  • 14 hours ago
  • 2 min read

I've been using OpenAI ChatGPT for years now, but in recent months I've been hearing more and more about Anthropic Claude, so figured I'd check it out.


VCF Operations Super Metrics is a perfect use case for Claude. While we've made the creation of Super Metrics much more intuitive than they used to be, they can still be tricky. Let's see how Claude does with them.


We'll first start with an easy one, which is quite common, a Super Metric to calculate the average CPU Usage % for all VMs in a Cluster (this could be max/min as well).


If I were to create one in VCF Operations it would look like this.



If you'd like this Super Metric you can get it here. Like I said, pretty straight forward. What does Claude come up with for us?



One thing you'll notice is that Claude indicates depth=1, this is going to be a problem as the distance from a vSphere Cluster to a VM is actually 2. I provided that feedback and Claude made the adjustment along with details why.



I can now simply copy the code, paste it into the VCF Operations Super Metric editor and validate it.



Let's try something a bit more complicated, maybe a Super Metric requiring a function and a where clause. I'd like a Super Metric at the vCenter level totaling up the number of vCPU allocated on all PhotonOS VMs. Building it myself from the VCF Operations Super Metrics editor I have this.



Let's see what Claude has to say.



A couple things to note here:

  • I didn't tell it what Object Type to create the Super Metric against, so it asked me and I answered vCenter

  • I was previously building some other Super Metrics and it used things learned there to build this new Super Metric

  • Provides some background around the where clause and the dependencies


Copying this code directly from Claude into the VCF Operations Super Metric editor gives this.



The expression is valid and when previewed shows the same number of vCPU as our manually created one.



What I've discovered so far with Claude is that it's quite receptive to feedback and provides great detail on response. The sky's the limit here, hope this was helpful!

    bottom of page