LinuxCommandLibrary

exo-compute-instance

Manage Exoscale compute instances

TLDR

Create a Debian based Compute instance with a disk size of 10GB

$ exo compute instance create --disk-size 10 [instance_name] [[-z|--zone]] [zone] --template '[Linux Debian 12 (Bookworm) 64-bit]'
copy

Log into a Compute instance via SSH
$ exo compute instance ssh [instance_name|id]
copy

List all of the Compute instances
$ exo compute instance list
copy

Add an instance to a Security Group
$ exo compute instance security-group add [instance_name|id] [security_group_name|id]
copy

Scale the size of a Compute instance
$ exo compute instance scale [instance_name|id] [instance_type]
copy

Create a snapshot of a Compute instance
$ exo compute instance snapshot create [instance_name|id]
copy

Revert a Compute instance to a snapshot (the data written after the snapshot has been created will be lost)
$ exo compute instance snapshot revert [snapshot_id] [instance_name|id]
copy

Resize the disk size of a Compute instance to 20GB
$ exo compute instance resize-disk [instance_name|id] 20
copy

SYNOPSIS

The exo compute instance command group is invoked as a subcommand of the main exo CLI tool. It requires an action followed by optional arguments and options.

General Syntax:
exo compute instance <action> [arguments] [options]

Common Actions Synopses:
exo compute instance list [-o|--output <format>] [--no-headers]
exo compute instance show <ID|name> [-o|--output <format>]
exo compute instance create <name> [-z|--zone <zone>] [-t|--template <template>] [-s|--disk-size <size>] [-y|--type <type>] [...]
exo compute instance start <ID|name> [--force]
exo compute instance stop <ID|name> [--force]
exo compute instance delete <ID|name> [--force]

PARAMETERS

-o <format>, --output <format>
    Specifies the output format (e.g., text, json, table). Useful for scripting and automation.

--no-headers
    Suppresses the header row in table output format for commands like list.

--force
    Bypass confirmation prompts for destructive or impactful actions (e.g., delete, stop).

-z <zone>, --zone <zone>
    (For create) Specifies the Exoscale zone where the instance will be provisioned (e.g., ch-dk-2).

-t <template>, --template <template>
    (For create) Specifies the operating system template or image to use for the instance (e.g., Linux Ubuntu 22.04 LTS).

-s <size>, --disk-size <size>
    (For create) Sets the root disk size of the instance in GiB.

-y <type>, --type <type>
    (For create) Defines the instance type, which determines CPU and RAM resources (e.g., standard.small).

-g <group>, --security-group <group>
    (For create) Assigns the instance to one or more security groups for network access control.

-k <keypair>, --keypair <keypair>
    (For create) Specifies the SSH keypair name to inject into the instance for secure remote access.

--user-data <path|content>
    (For create) Provides cloud-init user data from a file path or inline content, for instance initialization tasks.

DESCRIPTION

The exo compute instance command group is a core component of the Exoscale Command Line Interface (CLI), designed for comprehensive management of virtual compute instances within the Exoscale cloud platform.

It enables users to perform a wide array of operations, including listing and viewing detailed information about instances, creating new instances with custom configurations (such as specific zones, templates, disk sizes, and instance types), and controlling their lifecycle (starting, stopping, rebooting). The command group also supports advanced actions like scaling instance resources, resetting passwords, and managing network interfaces or security group attachments. This functionality streamlines infrastructure management, allowing for powerful automation and script-based control of compute resources directly from the terminal, making it an indispensable tool for cloud engineers and developers.

CAVEATS

The command exo-compute-instance as a standalone executable does not typically exist; it is part of the Exoscale CLI structure, invoked as exo compute instance <action>.

Using this command requires the Exoscale CLI to be installed and properly configured with valid API credentials.

Actions such as creating or deleting instances directly impact your Exoscale account's billing and can result in data loss. Exercise caution, especially when using the --force flag.

Familiarity with Exoscale cloud concepts like zones, instance types, templates, security groups, and private networks is essential for effective use.

COMMON ACTIONS

Beyond listing and showing, the exo compute instance command group provides several crucial actions:
start <ID|name>: Powers on a stopped instance.
stop <ID|name>: Powers off a running instance (graceful shutdown if possible).
reboot <ID|name>: Reboots a running instance.
scale <ID|name>: Modifies the CPU and RAM resources of an instance (requires instance to be stopped).
reset-password <ID|name>: Resets the password for the root/administrator user of an instance.
migrate <ID|name>: Migrates an instance's network interface or security group association.

HISTORY

The Exoscale CLI, including the compute instance command group, has been actively developed as the primary command-line interface for managing Exoscale cloud resources. Its design follows modern cloud CLI patterns, offering a consistent and programmatic way to interact with the Exoscale API. It's continuously updated to support new Exoscale services and features, providing a robust alternative to the web console for automation and large-scale deployments.

SEE ALSO

exo(1): The main Exoscale CLI executable., exo security-group(1): Manage Exoscale security groups., exo network(1): Manage Exoscale private networks., exo template(1): List and manage Exoscale instance templates., ssh(1): Secure Shell client for connecting to instances., cloud-init(5): Standard for cross-platform cloud instance initialization.

Copied to clipboard