> 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/i/ibm-virtual-private-cloud-vpc.md).

# IBM Virtual Private Cloud (VPC)

IBM Virtual Private Cloud (VPC) provides virtual server instances and bare metal servers in IBM Cloud regions. OctoXLabs reads them as devices and, optionally, load balancers, VPN gateways, VPN servers, public gateways and dedicated hosts as services. Classic infrastructure is read by the IBM Cloud adapter.

## Use cases

* List VPC virtual server instances by operating system.

```
Adapters = ibm-vpc AND OS.Type = Linux
```

* List the VPC load balancers and gateways that were collected as services.

## Before you begin

### Network

| Source              | Destination                                                                              | Port | Protocol |
| ------------------- | ---------------------------------------------------------------------------------------- | ---- | -------- |
| OctoXLabs connector | Regional VPC API host (`us-south.iaas.cloud.ibm.com` by default, then every region host) | 443  | HTTPS    |
| OctoXLabs connector | IBM Cloud IAM (`iam.cloud.ibm.com` by default)                                           | 443  | HTTPS    |

### Required permissions

| Scope or role                                               | Permission | Needed for           |
| ----------------------------------------------------------- | ---------- | -------------------- |
| **Viewer** platform role on **VPC Infrastructure Services** | Read       | Devices and Services |

## Create credentials in IBM Virtual Private Cloud (VPC)

{% stepper %}
{% step %}

### Create an API key

In IBM Cloud go to **Manage** > **Access (IAM)** > **API keys**, or use the **API keys** tab of a service ID. A service ID is preferred over a user key.
{% endstep %}

{% step %}

### Copy the key

The key is shown only once. Record it then.
{% endstep %}

{% step %}

### Grant the role

Give the user or service ID the **Viewer** platform role on **VPC Infrastructure Services**. The adapter only reads.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter      | Required | Type    | Default                       | Description                                                                                                                                                                                            |
| -------------- | -------- | ------- | ----------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Domain         | No       | Text    | `us-south.iaas.cloud.ibm.com` | A regional VPC API host, without `https://`. The adapter lists the regions from it and reads every region from the same kind of host. For private endpoints use `us-south.private.iaas.cloud.ibm.com`. |
| Token Domain   | No       | Text    | `iam.cloud.ibm.com`           | IAM host that exchanges the API key for a token. Use `private.iam.cloud.ibm.com` for a private endpoint (needs a Virtual Private Endpoint gateway for IAM).                                            |
| Api Key        | Yes      | Text    | None                          | IBM Cloud API key.                                                                                                                                                                                     |
| Regions        | No       | List    | Empty (all regions)           | Region names to read, for example `us-south` or `eu-de`.                                                                                                                                               |
| Fetch Services | No       | Boolean | `true`                        | Also collect load balancers, VPN gateways, VPN servers, public gateways and dedicated hosts. Instances and bare metal servers are always collected.                                                    |
| Api Version    | No       | Text    | `2026-09-29`                  | VPC API version date (YYYY-MM-DD) sent with every request. Change it only after checking the VPC API change log.                                                                                       |
| Proxy          | No       | Text    | None                          | Proxy in `host:port` form.                                                                                                                                                                             |
| Timeout        | No       | Integer | `30`                          | Seconds to wait for API responses.                                                                                                                                                                     |

## Troubleshooting

| Error message                                       | Cause                                                   | Fix                                                         |
| --------------------------------------------------- | ------------------------------------------------------- | ----------------------------------------------------------- |
| `IBM Cloud IAM token response has no access_token.` | The IAM call returned no token.                         | Check the API key and the token domain.                     |
| `IBM VPC region <name> is <status>, skipped.`       | The region is not available. Logged as a warning.       | No action needed.                                           |
| `IBM VPC regions <names> do not exist, skipped.`    | A configured region name is wrong. Logged as a warning. | Fix the Regions list.                                       |
| `Max retries exceeded for <url>`                    | HTTP 401 or 429 persisted.                              | Check the API key and role, then run discovery again later. |

## Change history

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