Error: "Json processing error. - Unrecognized field "entity"" when editing a vGPU Policy
search cancel

Error: "Json processing error. - Unrecognized field "entity"" when editing a vGPU Policy

book

Article ID: 431620

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

  • Unable to update a vGPU Policy in the Cloud Director (VCD) Provider portal under Resources > Cloud Resources > vGPU Policies > Edit.
  • Attempting to make changes to a vGPU Policy such as editing the Description or adding a new Provider VDC and ESX cluster in the Provider VDC Scope fails after clicking Finish in the Edit vGPU Policy wizard with an error of the form:

    Json processing error. - Unrecognized field "entity" (class com.vmware.vcloud.rest.openapi.model.VdcVmPolicy), not marked as ignorable (29 known properties: "pvdcId", "memory", "pvdcComputePolicy", "hasSizingInfo", "cpuCount", "pvdcVgpuClustersMap", "name", "policyType", "pvdcLogicalVmGroupsMap", "isVgpuPolicy", "isSizingOnly", "memoryShares", "isAutoGenerated", "id", "coresPerSocket", "pvdcNamedVmGroupsMap", "org", "logicalVmGroupReferences", "cpuLimit", "compatibleVdcTypes", "memoryLimit", "description", "memoryReservationGuarantee", "cpuSpeed", "vgpuProfiles", "namedVmGroups", "cpuReservationGuarantee", "cpuShares", "extraConfigs"])

  • Creating or deleting vGPU Policies in the VCD Provider portal succeeds without issue.
  • Editing vGPU Policies using the VCD OpenAPI succeeds without issue.

Environment

VMware Cloud Director 10.6.1.2

Cause

This issue occurs as the VCD UI incorrectly forms the JSON request body which the browser sends to the VCD OpenAPI to edit the vGPU Policy.

Resolution

This issue is under review by VMware Cloud Director Engineering.

Subscribe to this knowledge article to get updates on this issue.

Workaround

To workaround the issue the vGPU Policy can be deleted and recreated with the desired changes as per the documentation on, Creating and Managing vGPU Policies in VMware Cloud Director.

If the vGPU Policy cannot be deleted, then it can be updated using the VCD OpenAPI instead of the VCD UI.
As vGPU Policies are a type of VdcComputePolicy2, the VCD OpenAPI, Vdc Compute Policies2 APIs can be used to update them.

Example steps to add a Provider VDC and ESX cluster using the VCD API Explorer would be as follows:

  1. Log into the Cloud Director Provider portal as a System Administrator and select the vGPU Policy to be edited under Resources > Cloud Resources > vGPU Policies > select vGPU policy.
  2. Take note of the UUID of the vGPU Policy from the URL in the browser after clicking on the vGPU Policy to be edited, for example:

    Example URL:
    https://vcd.example.com/provider/cloud/vgpu-policies/urn:vcloud:vdcComputePolicy:########-####-####-####-########12ab/general

    Example vGPU Policy UUID:
    urn:vcloud:vdcComputePolicy:########-####-####-####-########12ab

  3. Open the Provider VDC list and select the Provider VDC to be added to the vGPU Policy under Resources > Cloud Resources > Provider VDCs > select Provider VDC.
  4. Take note of the UUID of the Provider VDC from the URL in the browser after clicking on the Provider VDC to be added, for example:

    Example URL:
    https://vcd.example.com/provider/cloud/provider-vdcs/########-####-####-####-########34cd/configure/general

    Example Provider VDC UUID:
    ########-####-####-####-########34cd

  5. Log into the vSphere UI as an administrator and Inventory > Host and Clusters.
  6. Select the GPU capable ESX cluster which backs the Provider VDC and is to be added to the vGPU Policy.
  7. Take note of the MOID/moref of the ESX cluster from the URL in the browser after clicking on the ESX cluster to be added, for example:

    Example URL:
    https://vcenter.example.com/ui/app/cluster;nav=h/urn:vmomi:ClusterComputeResource:domain-c#:########-####-####-####-############/summary

    Example MOID/moref:
    domain-c#

  8. Return to the Cloud Director Provider portal as a System Administrator and open the Cloud Director API Explorer by clicking the ? icon in the top right of the UI.
  9. In the API Explorer find the section, vdcComputePolicies2.
  10. Expand GET /2.0.0/vdcComputePolicies/{vdcComputePolicyId} and click Try It Out.
  11. Populate the vdcComputePolicyId parameter with the vGPU Policy UUID noted in step 2, for example:

    Example vGPU Policy UUID:
    urn:vcloud:vdcComputePolicy:########-####-####-####-########12ab

  12. Click Execute, which should result in a 200 response code, and copy the entire JSON Response body.
  13. Paste the JSON response body in a text editor and in the pvdcVgpuClustersMap section, add the new Provider VDC and ESX cluster to be added to the vGPU Policy.
    The new Provider VDC and ESX cluster details should be populated using the Provider VDC name, example Provider VDC UUID noted in step 4, and the ESX cluster MOID/moref noted in step 7:

    Example original pvdcVgpuClustersMap section with only one Provider VDC and ESX cluster:
    "pvdcVgpuClustersMap": [
     {
      "pvdc": {
       "name": "<original_pvdc_name>",
       "id": "urn:vcloud:providervdc:<original_vdc_uuid>"
      },
      "clusters": [
       "<original_esx_cluster_moref>"
      ]
     }
    ],

    Example updated pvdcVgpuClustersMap section with two Provider VDC and ESX cluster pairs:
    "pvdcVgpuClustersMap": [
     {
      "pvdc": {
       "name": "<original_pvdc_name>",
       "id": "urn:vcloud:providervdc:<original_vdc_uuid>"
      },
      "clusters": [
       "<original_esx_cluster_moref>"
      ]
     }
     {
      "pvdc": {
       "name": "<additional_pvdc_name>",
       "id": "urn:vcloud:providervdc:########-####-####-####-########34cd"
      },
      "clusters": [
       "domain-c#"
      ]
     }
    ],

  14. In the API Explorer, find the section vdcComputePolicies2, expand PUT /2.0.0/vdcComputePolicies/{vdcComputePolicyId} and click Try It Out.
  15. Populate the updateVdcComputePolicyParams parameter with the entire updated JSON from step 13 and the vdcComputePolicyId parameter with the vGPU Policy UUID noted in step 2.
  16. Click Execute, confirm a 200 response code is received, and copy the entire JSON Response body.
  17. Review the JSON and confirm the additional Provider VDC and ESX cluster have been added before returning to the Cloud Director Provider portal to confirm the vGPU Policy has been updated there also with the desired changes.

Additional Information

Creating and Managing vGPU Policies in VMware Cloud Director

VCD OpenAPI, Vdc Compute Policies2 APIs