Create a VMware Cloud Director Instance by Using On-premises Resources

Use the resources that you retrieved from your on-premises VMware Cloud Director installation to create a VMware Cloud Director instance in your cloud environment.

Prerequisites

  • Retrieve the database schema version of your on-premises VMware Cloud Director instance.
    1. Log in or SSH as root to the OS of the VMware Cloud Director cell.
    2. Run the command to retrieve the database schema version.
      /opt/vmware/vcloud-director/bin/cell-management-tool manage-config -n database.schema.version -l 
  • Put your on-premises VMware Cloud Director instance in maintenance mode.
  • Exchange the API token that you generated for an access bearer token. Use the bearer token in the Authorization header for the API call. See How Do I Generate an API Token.
  • Obtain the environment ID (URN). See How Do I Retrieve the List of Environments in My Organization.
  • Obtain the value of the "cdsBuildCategory" parameter from the compatibility check API response. See Check the Compatibility Between an On-premises VMware Cloud Director Installation and VMware Cloud Director service .
  • Obtain the host name, administrator user name and password for the on-premises VMware Cloud Director instance.
  • Verify that you uploaded resources.zip to your cloud environment and that you noted the task ID (URN) from the API response body that you received. See Upload On-premises VMware Cloud Director Resources to Your Cloud Environment.

Procedure

  1. Prepare a JSON template with the necessary information to create the VMware Cloud Director instance.

    The template must include a name for the new instance, the upgrade build category for VMware Cloud Director service, as well as the VMware Cloud Director host name, administrator user name and password.

    If you don't have an active VMware Cloud Director service subscription, you can create the instance as a part of a free trial by including the trial details in the template. See How Do I Retrieve Details About a Specific Free Trial

    {
      "name": "Cloud_Director_Service_Instance_Name",
      "upgradeCategory": "cds-Build-Category",
      "migrationType" : "ONPREM-TO-CDS",
      "uploadResourcesId": "taskURN"
      sourceParams": {
          "vcdHostname": "onprem-vcd-hostname.eng.vmware.com",
          "vcdPrincipal": "vcd-administrator-user-name",
          "vcdAuthentication": "vcd-password",
          "vcdAuthenticationType": "BASIC_AUTH",
          "databaseSchemaVersion": ["1.0","2.0","3.0",["3.1","3.2"]] 
      },
    "trial": {
         "id": "trialURN",
         "expiry": "free-trial-expiry-date-and-time"
    }
  2. Run a POST request with the contents of the JSON template in the body of the request and with the necessary headers.
    POST https://operatorUrl/environment/environmentUrn/migration/migrate 

    Here operatorUrl is the operator URL, for example vcdc-operator-prod-us-west-2.vdp.vmware.com.

    Table 1. Headers
    Name Value
    Authorization Bearer your-bearer-token
    Content-Type application/octet-stream
    Accept application/json
    The response creates a VMware Cloud Director instance in the environment that you specified.

Example: Create a VMware Cloud Director Instance by Using On-premises Resources

This example creates a VMware Cloud Director instance by using the on-premises resources that you provide.

POST https://vcdc-operator-prod-us-west-2.vdp.vmware.com/environment/urn:vcdc:environment:12345678-1234-1234-1234-123456789abc/migration/migrate -H 'accept: application/json' \
    -H 'Content-Type: application/json'
    -H 'Accept: application/json'
    -H 'Authorization: Bearer token' \\
   --data-raw '''{
  "name": "onprem-to-cds",
  "upgradeCategory": "release-10.3:production",
  "migrationType" : "ONPREM-TO-CDS",
  "uploadResourcesId": "dba3d683-400a-41fb-81d8-fb58fc0990a7" 
  sourceParams": {
      "vcdHostname": "aal1-bbb-ccc.eng.vmware.com",
      "vcdPrincipal": "administrator",
      "vcdAuthentication": "*********",
      "vcdAuthenticationType": "BASIC_AUTH",
       "databaseSchemaVersion": ["1.0","2.0","3.0",["3.1","3.2"]]
  }
}''' 
The 200 OK response returns the following information about the newly created VMware Cloud Director instance.
{
  "id": "urn:vcdc:task:22222222-2222-2222-2222-22222222222",
  "name": "Creating instance",
  "entityId": "urn:vcdc:vcdInstance:a0af00aa-1111-2222-3333-bb4b44b44bb4",
  "entityName": "onprem-to-cds-test-2",
  "ownerId": "urn:vcdc:organization:12345678-1234-1234-1234-123456789abc",
  "userId": "vmware.com:aaaa1111-1111-2222-aaaa-1111aaaa",
  "cspUserId": "vmware.com:22b222b-2222-3333-bbbb-bbbb22223333",
  "steps": null,
  "status": "IN_PROGRESS",
  "startTime": null,
  "endTime": null,
  "queuedTime": "2022-07-26T07:57:59.409056Z",
  "message": "Instance creation starting",
  "isolation": "ENTITY_EXCLUSIVE",
  "output": null,
  "activity": "activity://DeployVcdInstanceOnK8sActivity/f0fa10fa-3834-4910-9b57-bb2b34a03be9"
}

What to do next

  1. Check if the instance creation was successful. See How Do I Retrieve Details About a Single Task.
  2. Associate the newly created VMware Cloud Director Instance with an SDDC via VMware Reverse Proxy.