Creating Additional VM Apps Organization in VCF Automation 9 via REST API
search cancel

Creating Additional VM Apps Organization in VCF Automation 9 via REST API

book

Article ID: 419781

calendar_today

Updated On:

Products

VCF Automation

Issue/Introduction

In VMware Cloud Foundation (VCF) Automation 9.0 and 9.1, the “classic” VM Apps provisioning model (formerly Aria Automation VM Provisioning with resource schemas like Cloud.vSphere.Machine) is still supported. However, by default, only one VM Apps organization can be created via the UI. 

Currently, in VCF Automation 9.0 and 9.1, the UI does not support creating more than one classic VM Apps organization, but this can be accomplished using the REST API.

This article explains how to use the API to create additional VM Apps orgs.

Environment

VCF Automation 9.0
VCF Automation 9.1

Cause

The VCF Automation 9.0 and 9.1 UI supports creating only one classic VM Apps organization.

The feature flag “Classic Tenant Creation” enables/disables UI creation but does not allow multiple orgs through the UI.

Resolution

Here are the steps to create an additional classic VM Apps org via the VCF Automation REST API:

  1. Generate API Token

    • Log in to the VCF Automation portal.

    • Go to My Account → API Tokens.

    • Create a new API token. (Be sure to copy and store it, as it may not be retrievable later.) 

  2. Obtain Bearer Token

    • Use the generated API token to get a bearer token:

      curl --location --request POST 'https://<automation-fqdn>/oauth/provider/token' \ --header 'Accept: application/json' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-raw 'grant_type=refresh_token&refresh_token=<API-Token>'
    • The response returns the bearer token, which will be used for subsequent REST requests. 

  3. Call the Create Org API

    • Use the following example API call to create a new org:

      curl --location --request POST 'https://<automation-fqdn>/cloudapi/1.0.0/orgs' \ 
      --header 'Accept: application/json;version=40.0' \ 
      --header 'Authorization: Bearer <generated-bearer-token>' \ 
      --header 'Content-Type: application/json' \ 
      --data-raw '{ 
         "name": "<vm-app-name>", 
         "displayName": "<vm-app-name>", 
         "description": "<description>", 
         "isEnabled": true, 
         "canManageOrgs": false, 
         "maskedEventTaskUsername": "system", 
         "directlyManagedOrgCount": null, 
         "isClassicTenant": true, 
         "isProviderConsumptionOrg": false, 
         "creationStatus": "READY" 
      }'
    • Key parameter: isClassicTenant = true ensures that the organization is a VM Apps org (classic model). 

    • Avoid using spaces in name or displayName

  4. Verify the Organization Creation

    • Once the API call succeeds, the newly created VM Apps organization will appear in the list of orgs in the VCF Automation UI. 

Additional Information

Refer to the official 9.0 Managing Organizations for VM Apps in VMware Cloud Foundation Automation documentation or 9.1 Managing Organizations for VM Apps in VMware Cloud Foundation Automation documentation for more information.