System administrators can create and publish VDC compute policies to organization VDCs. With the VMware Cloud Director API, you can view and modify organization VDC compute policies and change the default compute policies.

To create and manage provider and global VDC compute policies, you must use the VMware Cloud Director OpenAPI. See Getting Started with VMware Cloud Director OpenAPI at https://code.vmware.com.

Prerequisites

  • To view VDC compute policies, you must be a system administrator, organization administrator, vApp Author, or vApp User.
  • To update the VDC compute policies, you must be a system administrator.
  • To change the default VDC compute policy, you must be a system administrator or organization administrator.

Procedure

  1. View and update the compute policies that are published to an organization VDC.
    1. To retrieve the compute policies of an organization VDC, use a GET request to the computePolicies link of the target VDC.
      GET https://vcloud.example.com/api/vdc/83/computePolicies
      The response contains a VdcComputePolicyReference element for each VDC compute policy.
    2. To update the compute policies of an organization VDC, modify the VdcComputePolicyReference element and use a PUT request to the computePolicies link of the target VDC.
      PUT https://vcloud.example.com/api/admin/vdc/83/computePolicies
      ...
      <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
      <VdcComputePolicyReferences
         xmlns="http://www.vmware.com/vcloud/v1.5"
         ...>
         <VdcComputePolicyReference
            href=""
            id="57"
            name="fast_mssql_updated"
            type="application/json"/>
      </VdcComputePolicyReferences>
  2. View and update the default compute policy of an organization VDC.
    1. To retrieve the default compute policy of an organization VDC, retrieve an XML representation of the target VDC.
      GET https://vcloud.example.com/api/vdc/83
      The response contains a DefaultComputePolicy element with the UUID and name of the default compute policy.
    2. To change the default compute policy of an organization VDC, modify the DefaultComputePolicy element and use a PUT request to the target VDC.
      PUT https://vcloud.example.com/api/vdc/83
      ...
      ...
         <IsEnabled>true</IsEnabled>
         <VdcStorageProfiles>
            <VdcStorageProfile
               .../>
          </VdcStorageProfiles>
          <DefaultComputePolicy id="57" name="fast_mssql_updated" type="com.vmware.vcloud.entity.vdcComputePolicy"/>
          <VCpuInMhz2>1000</VCpuInMhz2>
          <ResourceGuaranteedMemory>0.2</ResourceGuaranteedMemory>
          <ResourceGuaranteedCpu>0.2</ResourceGuaranteedCpu>   
      ...
      ...