# How to Manage Your GPU Cluster

Eli Mernit

December 6, 2024 1 min read

> **_This is the final feature in our first [launch week](https://x.com/beam_cloud/status/1862543368217141381), where we ship a brand new feature every day, five days in a row._**

If you're self-hosting Beam, you'll need a CLI to manage the machines in your cluster. Today, we're shipping an upgraded suite of management commands for self-hosted users to easily manage machines and workers.

## What Can You Do With It?

For context, Beta9 is the open-source project that powers Beam. You can self-host Beam and run your workloads on arbitrary hardware.

## Connect Machines to Beam

You can [connect arbitrary hardware](https://www.beam.cloud/blog/adding-compute) to Beam using the `machine create` command. This command will print a cURL command, which you'll run on the node in order to connect the machine to the control plane running Beam.

```bash
$ beta9 machine create --pool lambda-a100-40

=> Created machine with ID: '9541cbd2'. Use the following command to set up the node:

#!/bin/bash
sudo curl -L -o agent https://release.beam.cloud/agent/agent && \
sudo chmod +x agent && \
sudo ./agent --token "AUTH_TOKEN" \
  --machine-id "9541cbd2" \
  --tailscale-url "" \
  --tailscale-auth "AUTH_TOKEN" \
  --pool-name "lambda-a100-40" \
  --provider-name "lambda"
```

## Cordon and Drain Workers

If you've used Kubernetes before, you're already familiar with the concept of cordon and drain. If you aren't, we'll give a quick refresher:

**_Cordon_**: This marks a node as unschedulable so that no new workloads are assigned to it. Typically, you'll cordon a node when it's experiencing issues or requires maintenance.

**_Drain_**: This gracefully evicts all existing workloads from the node, usually to prepare it for maintenance or upgrades.

We've added cordon and drain commands in the `beta9 CLI`, giving you more control over your workers:

```bash
$ beta9 worker cordon 3e1fa6f3
$ beta9 worker drain 3e1fa6f3
$ beta9 worker uncordon 3e1fa6f3
```

### List Workers

Here's the command to list all the workers connected to your Beam or Beta9 cluster:

```bash
ID         Pool          Status      Priority   CPU       Memory       GPUs
 ────────────────────────────────────────────────────────────────────────
  a1f4b9c7   build         available   0          7,000m    27.00 GiB    0
  e3c8d572   build         available   0          7,000m    27.00 GiB    0
  92b1f0e8   default       available   1          16,000m   32.00 GiB    0
  f8d37c5b   default       available   1          2,000m    16.00 GiB    0
  8c72e6da   default       available   1          2,000m    16.00 GiB    0
  b2d8a1fc   default       available   1          2,000m    16.00 GiB    0
  d4e3c9ba   default       available   1          2,000m    16.00 GiB    0
```

## What's Next

As a next step, [check out the Beta9 repo](https://github.com/beam-cloud/beta9/). You can self-host Beta9 and connect it to your own hardware.

If you have any feedback on the workflow or feature requests, we’d love to hear from you in our [Slack Community](https://join.slack.com/t/beam-cloud/shared_invite/zt-2uiks0hc6-UbBD97oZjz8_YnjQ2P7BEQ).

> **This is Launch 5/5 for this week! You can follow along with our upcoming launches on [Twitter](https://x.com/beam_cloud/status/1862543368217141381).**

Eli Mernit

Published December 6, 2024
