top of page
Brock Peterson

Exclude VMs from Rightsizing via API in VMware Aria Operations

The ability to rightsize VMs is a powerful feature of Aria Operations, one that we've discussed before. VMware Staff Technical Marketing Architect Brandon Gordon recently provided an update to his exhaustive blog on VM Rightsizing as well, you can find it here.


Within the UI, you can exclude VMs from Rightsizing by selecting the VM and choosing EXCLUDE VM(S).

What if you want to do this programmatically? API! In this we'll use both the Public API and Internal API. First, let's get the identifiers of the VMs we'd like to exclude via GET /api/resources, the cURL looks like this:

curl -X GET "https://vr83-bpeterson.tvs.vmware.com/suite-api/api/resources?page=0&pageSize=1000&resourceKind=VirtualMachine&_no_links=true" -H  "accept: application/json" -H  "Authorization: vRealizeOpsToken 287ed085-c6ca-4255-b69c-956f1665ed51::4d2d5517-4965-41bc-819c-f71b058755a8"

Searching the output of the GET /api/resources, I've found the identifiers of the VMs I want to exclude, naming these two:

You can also find the VM identifiers via Environment - Inventory.

Now that we have the identifiers, let's exclude them from Rightsizing. In order to do that, we'll have to explore the Internal APIs. Top right of your Swagger page, select Internal APIs from your dropdown.

Scroll down to the POST /internal/optimization/rightsizing/exclude/entities endpoint and adjust the Parameters to include your VM identifiers.

The cURL looks like this:

curl -X POST "https://vr83-bpeterson.tvs.vmware.com/suite-api/internal/optimization/rightsizing/exclude/entities?_no_links=true" -H  "accept: application/json" -H  "X-vRealizeOps-API-use-unsupported: true" -H  "Authorization: vRealizeOpsToken 287ed085-c6ca-4255-b69c-956f1665ed51::6f2ef199-50d1-4e91-b23b-76798cc8e8f6" -H  "Content-Type: application/json" -d "{  \"entities\" : [ \"2d2fe6c6-2a4c-498c-86e8-cce1b763d3e1\" , \"287beeb2-05cd-4463-abfc-3ad2e3031d6a\" ]}"

Click Execute to exclude those two VMs from Rightsizing. Back at the Aria Operations UI we can confirm those two VMs are now being excluded from Rightsizing.

For more information on Aria Operations please visit the VMware Aria Apps & Cloud Management Tech Zone!

4 Comments


Brock Peterson
Brock Peterson
Jun 11, 2023

You can't, it's not available, I'll open a feature request for it.

Like
gobigred74
Jun 12, 2023
Replying to

Thanks for the reply and thanks for opening a feature request for this!

Like

gobigred74
Jun 08, 2023

We're trying to figure out how we can get a list -- via an API -- of all VMs that are excluded from rightsizing. If I use the /internal/optimization/{id}/rightsizing API, it returns the total cpus and memory that are excluded for both Oversized and Undersized groups but doesn't list the VMs like it does with the ui...

Like
felixheitmann
Apr 12
Replying to

You can use your mentioned API, you have to specify a resource Object though. This e.g. be a datacenter or Cluster Object. Pretty much like this: GET https://vrops/suite-api/internal/optimization/$resourceID/rightsizing?groupAdapterKind=VMWARE&groupResourceKind=ClusterComputeResource&name=cluster01

You can then filter the JSON, there are 4 different Groups "oversizedGroups", "undersizedGroups", "excludedOversizedGroups" and "exludedUndersizedGroups".

Like
bottom of page