Skip to main content

Create an LXD cloud account with the CLI

Connect an LXD server to Vantage using the CLI token-based workflow

Create an LXD cloud account with the CLI

Connect an LXD server to Vantage as a cloud account using the CLI token workflow.

TimeAbout 5 minutes
You will needv8x installed and authenticated, a running LXD server with HTTPS enabled, lxc command-line tool
OutcomeAn LXD cloud account linked to Vantage via CLI

The CLI provides a token-based workflow for connecting LXD servers as cloud accounts, avoiding the need to paste certificates and keys manually.

Inspect the cloud account commands

If this is your first time creating cloud accounts with the CLI, start with:

uvx v8x cloud account --help
uvx v8x cloud account create --help

The most important option is --provider lxd. For LXD, you also pass the server URL and token as JSON in --attributes.

Generate an LXD token

On your LXD host, generate a trust token for Vantage:

export LXD_TOKEN="$(lxc config trust add --quiet --name vantage-my-lxd-cloud)"
export LXD_SERVER_URL="https://your-lxd-server:8443"

The token grants Vantage temporary trust to register with the LXD server. Vantage exchanges it for a client certificate and key during account creation.

Success looks like this: the environment variables LXD_TOKEN and LXD_SERVER_URL are set and ready for the next step.

Create the cloud account

Create a cloud account for a single LXD instance:

uvx v8x cloud account create my-lxd-cloud \
--provider lxd \
--attributes "{\"lxd_server_url\":\"$LXD_SERVER_URL\",\"lxd_token\":\"$LXD_TOKEN\"}"

For an LXD cluster, add the cluster flag:

uvx v8x cloud account create my-lxd-cluster-cloud \
--provider lxd \
--attributes "{\"lxd_server_url\":\"$LXD_SERVER_URL\",\"lxd_token\":\"$LXD_TOKEN\",\"cluster\":true}"

Key attributes:

  • lxd_server_url (required) - the HTTPS URL of your LXD server
  • lxd_token (required) - the trust token from lxc config trust add
  • cluster - set to true for LXD clusters (omit for single instances)

Success looks like this: the command returns the new cloud account. Vantage has exchanged the token for a client certificate and stored it securely.

Verify the account

Inspect the account to confirm it is set up correctly:

uvx v8x cloud account get <ID>

The output shows the account fields. The lxd_client_cert and lxd_client_key attributes display as ********, confirming they are stored securely.

Success looks like this: the account shows provider lxd, and the In Use field is (it will show once it backs a cluster).

Ask AI
Ask a question about Vantage Compute...