> 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/a/apache-cloudstack.md).

# Apache Cloudstack

Apache CloudStack is an open source cloud management platform. OctoXLabs lists its virtual machines and adds them as devices.

## Use cases

* Find devices that Apache Cloudstack reports but your EDR does not cover.

```
Adapters = apache-cloudstack AND NOT Adapters = falcon-crowdstrike
```

* Review devices that Apache Cloudstack has not seen recently.

```
Adapters = apache-cloudstack AND NOT LastSeen last now-30d/d
```

* Check what one Apache Cloudstack connection collected.

```
Connections = YOUR_CONNECTION_NAME
```

## Before you begin

### Network

| Source              | Destination                       | Port               | Protocol                                 |
| ------------------- | --------------------------------- | ------------------ | ---------------------------------------- |
| OctoXLabs connector | CloudStack management server (IP) | 443 (configurable) | HTTPS, or HTTP when Is Secure is cleared |

### Required permissions

The key belongs to a CloudStack user. The user must be allowed to run `listVirtualMachines`. Not verified.

## Create credentials in Apache Cloudstack

{% stepper %}
{% step %}

### Sign in

Log in to Apache CloudStack as the `admin` user.
{% endstep %}

{% step %}

### Open the account

Go to **Accounts** and select a user within the account.
{% endstep %}

{% step %}

### View the user

Click **View User**.
{% endstep %}

{% step %}

### Generate keys

Click **Generate Key** and copy the **API Key** and the **Secret Key**.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter  | Required | Type    | Default | Description                                                           |
| ---------- | -------- | ------- | ------- | --------------------------------------------------------------------- |
| IP         | Yes      | String  | None    | IP address of the CloudStack instance.                                |
| Port       | No       | Integer | 443     | Port of the API.                                                      |
| API Key    | Yes      | String  | None    | API key of the user.                                                  |
| Secret Key | Yes      | String  | None    | Secret key of the user. Used to sign each request.                    |
| Proxy      | No       | String  | None    | Proxy address. The connector sends requests through `http://<value>`. |
| Is Secure  | No       | Boolean | True    | Use HTTPS. Clear it to use HTTP.                                      |
| Timeout    | No       | Integer | 30      | Time in seconds to wait for API responses.                            |

## Troubleshooting

| Error message                                                          | Cause                                                                  | Fix                                                                                                                                           |
| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------- |
| Status Code: `, followed by the URL, the method and the response body` | The API answered with a status other than the one the adapter expects. | Read the code and body. 401 or 403 usually points to wrong credentials or missing permissions. Check the address, port and Is Secure setting. |

## Change history
