> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/v/vmware-cloud-directory.md).

# VMware Cloud Directory

VMware Cloud Directory (Cloud Director) is a multi-tenant cloud management platform. OctoXLabs reads virtual machines and users. This adds VM sizing, guest operating system and owner organization data to the inventory.

## Use cases

* List the virtual machines and users from Cloud Directory.

```
Adapters = vmware-cloud-directory
```

## Before you begin

### Network

| Source              | Destination                 | Port                   | Protocol |
| ------------------- | --------------------------- | ---------------------- | -------- |
| OctoXLabs connector | VMware Cloud Directory host | 443                    | HTTPS    |
| OctoXLabs connector | HTTP proxy (optional)       | Set in **HTTPS Proxy** | HTTP     |

### Required permissions

| Scope or role              | Permission | Needed for                                                                                   |
| -------------------------- | ---------- | -------------------------------------------------------------------------------------------- |
| System Administrator       | Read       | VMs through `/cloudapi/1.0.0/multiVcVms` (turn on **Is System Administrator**)               |
| Organization Administrator | Read       | VMs through `/api/query?type=vm`                                                             |
| Either role                | Read       | Users through `/cloudapi/1.0.0/users` (Not verified for the Organization Administrator role) |

## Create credentials in VMware Cloud Directory

{% stepper %}
{% step %}

### Choose the method

Use an API key, or a user name and password. A user name has the form `username@orgname`, for example `admin@system`.
{% endstep %}

{% step %}

### Check the role

Know whether the account is a System Administrator or an Organization Administrator. Set **Is System Administrator** to match.
{% endstep %}
{% endstepper %}

The instructions do not describe how to create an API key. See the vendor documentation.

## Connection parameters

| Parameter               | Required                   | Type    | Default | Description                                                                          |
| ----------------------- | -------------------------- | ------- | ------- | ------------------------------------------------------------------------------------ |
| Domain                  | Yes                        | Text    |         | Host of the instance, for example `vcloud.example.com`.                              |
| Use Basic Auth          | No                         | Boolean | False   | Get a session token from `/cloudapi/1.0.0/sessions` with user name and password.     |
| Username                | When Use Basic Auth is on  | Text    |         | Format `username@orgname`.                                                           |
| Password                | When Use Basic Auth is on  | Text    |         | Account password.                                                                    |
| API Key                 | When Use Basic Auth is off | Text    |         | Sent as the `Authorization` header.                                                  |
| Is System Administrator | No                         | Boolean | False   | Use the System Administrator VM endpoint. Leave off for Organization Administrators. |
| API Version             | No                         | Text    | 39.0    | Sent in the `Accept` header.                                                         |
| HTTPS Proxy             | No                         | Text    |         | Proxy in `host:port` format.                                                         |
| Timeout                 | No                         | Integer | 30      | Seconds to wait for API responses.                                                   |

## Troubleshooting

| Error message                                                               | Cause                                     | Fix                                             |
| --------------------------------------------------------------------------- | ----------------------------------------- | ----------------------------------------------- |
| username and password are required when use\_basic\_auth is enabled         | Basic auth without credentials.           | Fill both fields.                               |
| api\_key is required when use\_basic\_auth is disabled                      | No API key.                               | Enter the API key or turn on Use Basic Auth.    |
| Authentication succeeded but X-VMWARE-VCLOUD-ACCESS-TOKEN header is missing | The session response had no token header. | Check the API version and the user name format. |
| Max retries exceeded for                                                    | The API kept returning 401 or 429.        | Check the credentials, then retry later.        |

## Change history

{% hint style="info" %}
Available starting from version 5.6.10.
{% endhint %}
