VMware Integrated OpenStack includes a vAPI that you can use to manage tenant virtual data centers.

If you have logged in to the OpenStack Management Server, you can also manage tenant virtual data centers using the Data Center Command-Line Interface (DCLI) or the viocli utility.

Before using the vAPI, you must authenticate with the vAPI endpoint using the administrator credentials for your vCenter Server instance.

You can use any HTTPS client to send requests to the vAPI endpoint. This document uses cURL as an example.

Create a Tenant Virtual Data Center

curl -k POST -u vcserver-admin -H "Content-Type: application/json" 
   https://public-or-private-vip:9449/rest/vio/tenant/vdc 
   -d '{
      "spec":{
         "compute":"compute-node",
         "display_name":"vdc-name",
         "project_id":"project-uuid",
         "cpu_limit":max-cpu-mhz,
         "cpu_reserve":min-cpu-mhz,
         "mem_limit":max-memory-mb,
         "mem_reserve":min-memory-mb
      }
   }'

The cpu_limit, cpu_reserve, mem_limit, and mem_reserve parameters are optional.

The ID of the new tenant virtual data center is returned in JSON format.

The equivalent DCLI command is as follows:

com vmware vio tenant vdc create --compute compute-node --display-name vdc-name --project-id project-uuid [--cpu-limit max-cpu-mhz] [--cpu-reserve min-cpu-mhz] [--mem-limit max-memory-mb] [--mem-reserve min-memory-mb]

Update a Tenant Virtual Data Center

curl -k PATCH -u vcserver-admin -H "Content-Type: application/json" 
   https://public-or-private-vip:9449/rest/vio/tenant/vdc/tenant-vdc-id
   -d '{
      "spec":{
         "compute":"compute01"
         "cpu_limit":max-cpu-mhz,
         "cpu_reserve":min-cpu-mhz,
         "mem_limit":max-memory-mb,
         "mem_reserve":min-memory-mb
      }
   }'

The cpu_limit, cpu_reserve, mem_limit, and mem_reserve parameters are optional.

The equivalent DCLI command is as follows:

com vmware vio tenant vdc update --compute compute-node --tvdc-id tenant-vdc-id [--cpu-limit max-cpu-mhz] [--cpu-reserve min-cpu-mhz] [--mem-limit max-memory-mb] [--mem-reserve min-memory-mb]

List All Tenant Virtual Data Centers

curl -ku vcserver-admin https://public-or-private-vip:9449/rest/vio/tenant/vdc

The information is returned in JSON format.

The equivalent DCLI command is as follows:

com vmware vio tenant vdc list

Display Information About a Tenant Virtual Data Center

curl -ku vcserver-admin https://public-or-private-vip:9449/rest/vio/tenant/vdc/tenant-vdc-id

The status, provider ID, display name, and quotas of the tenant virtual data center are returned in JSON format.

The equivalent DCLI command is as follows:

com vmware vio tenant vdc get --tvdc-id tenant-vdc-id

Delete a Tenant Virtual Data Center

curl -k POST -u vcserver-admin -H "Content-Type: application/json" 
   https://public-or-private-vip:9449/rest/vio/tenant/vdc/tenant-vdc-id?action=delete-tvdc
   -d '{
      "spec":{
         "compute":"compute-node"
      }
   }'

The compute parameter is optional. If you specify compute, the tenant virtual data center is deleted from the specified compute node only. If you do not specify compute, the tenant virtual data center is deleted from all compute nodes.

The equivalent DCLI command is as follows:

com vmware vio tenant vdc deletetvdc --tvdc-id tenant-vdc-id [--compute compute-node]