> 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-cloud.md).

# IBM Cloud

IBM Cloud classic infrastructure (SoftLayer) provides virtual and bare metal servers. OctoXLabs reads classic virtual servers, bare metal servers and the users of the classic account. VPC resources are read by the IBM Virtual Private Cloud (VPC) adapter.

## Use cases

* List classic servers by operating system.

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

* Find account administrators (master users) of the classic account.

```
Adapters = ibm-cloud AND AdminStatus = true
```

## Before you begin

### Network

| Source              | Destination                                                                  | Port | Protocol |
| ------------------- | ---------------------------------------------------------------------------- | ---- | -------- |
| OctoXLabs connector | `api.softlayer.com` (or `api.service.softlayer.com` for the private network) | 443  | HTTPS    |

### Required permissions

| Scope or role                                                                           | Permission         | Needed for                |
| --------------------------------------------------------------------------------------- | ------------------ | ------------------------- |
| Classic infrastructure permission **View Virtual Server Details** (all virtual servers) | Read               | Devices (virtual servers) |
| Classic infrastructure permission **View Hardware Details** (all bare metal servers)    | Read               | Devices (bare metal)      |
| User linked to an IBMid                                                                 | Read account users | Users                     |

## Create credentials in IBM Cloud

{% stepper %}
{% step %}

### Create an API key

Go to **Manage** > **Access (IAM)** > **API keys**. For a classic infrastructure key, filter **Classic infrastructure API keys**. You can also use an IBM Cloud API key of a user.
{% endstep %}

{% step %}

### Link the user to an IBMid

The user must be linked to an IBMid.
{% endstep %}

{% step %}

### Give permissions

Give the user the classic permissions **View Virtual Server Details** and **View Hardware Details**, with access to all virtual servers and all bare metal servers. Servers the user cannot access are not listed.
{% endstep %}

{% step %}

### Find the user name

With a classic key, use the classic user name shown next to the key (for example `1234567_user@company.com` or `SL1234567`). With an IBM Cloud API key, enter `apikey`.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter | Required | Type    | Default             | Description                                                                                                                               |
| --------- | -------- | ------- | ------------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
| Domain    | Yes      | Text    | `api.softlayer.com` | Classic infrastructure API host, without `https://`. Use `api.service.softlayer.com` to reach the API over the IBM Cloud private network. |
| Username  | Yes      | Text    | None                | Classic user name, or `apikey` with an IBM Cloud API key.                                                                                 |
| Api Key   | Yes      | Text    | None                | Classic infrastructure API key or IBM Cloud API key.                                                                                      |
| Proxy     | No       | Text    | None                | Proxy in `host:port` form. The connector prefixes it with `http://`.                                                                      |
| Timeout   | No       | Integer | `60`                | Seconds to wait for API responses.                                                                                                        |

## Troubleshooting

| Error message                                              | Cause                                                                                          | Fix                                                  |
| ---------------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------------------------------------- |
| `Status Code: 500\nURL: <url>\n<response text>`            | The API answered HTTP 500 that is not a rate limit error.                                      | Check the response text and the API key permissions. |
| `Max retries exceeded. Status Code: <code>\nURL: <url>`    | The API kept returning rate limit errors.                                                      | Run discovery again later.                           |
| `IBM Cloud <virtualGuests or hardware> could not be read.` | One of the two server lists failed. Logged as a warning and the other list is still collected. | Check the permissions for that server type.          |

## Change history

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