exo is the official command-line tool to access Exoscale’s services. It allows you to manage your infrastructure from an user friendly command-line with the benefits of a scriptable interface.

It is based on the official Go wrapper for the Exoscale public cloud API: egoscale, and hosted in the same public repository.

Installation

To get started download the archive corresponding to your operating system from the latest release on GitHub.

GNU/Linux

Debian / Ubuntu

  • Download egoscale_$VERSION_linux_amd64.deb
  • Run $ sudo dpkg -i egoscale_$VERSION_linux_amd64.deb

RedHat / CentOS

  • Download egoscale_$VERSION_linux_amd64.rpm
  • Run sudo rpm -i egoscale_$VERSION_linux_amd64.rpm

Other distributions

  • Download egoscale_$VERSION_linux_amd64.tar.gz
  • Expand it
  • Put the exo binary into your $PATH, e.g. /usr/local/bin/

Apple macOS

  • Download and open egoscale_$VERSION_darwin_amd64.tar.gz
  • Copy the exo executable in a directory inside your $PATH

Microsoft Windows

The binary file works for both the traditional Command Prompt as well as the more modern PowerShell.

  • Download egoscale_%VERSION%_windows_amd64.zip
  • Open the command-line shell (cmd.exe) and type the following commands

    mkdir C:\egoscale
    setx path "%path;%C:\egoscale;"
    
  • Put exo.exe from zip archive into C:\egoscale\

Configuration

A configuration file holding your credentials is required. You can generate one via a guided prompt. The following parameters are requested:

  • API Key
  • Secret Key

You can find those in our Exoscale Console Log in and navigate to:

/Exoscale Console > ACCOUNT > PROFILE > API keys

API keys and secrets

Configuration

The CLI will guide you in the initial configuration.

$ exo config

The configuration file will be saved in the .exoscale folder in your home directory.

Commands overview

You are now ready to use the CLI. Start by calling the raw exo command. This will give you a list of the possible commands and options:

Available Commands:
  affinitygroup Affinity groups management
  config        Generate config file for this cli
  eip           Elastic IPs management
  firewall      Security groups management
  help          Help about any command
  privnet       Private networks management
  ssh           SSH into a virtual machine instance
  sshkey        SSH keys pair management
  template      List all available templates
  vm            Virtual machines management
  zone          List all available zones

Flags:
      --config string   Specify an alternate config file [env CLOUDSTACK_CONFIG]
  -h, --help            help for exo
  -r, --region string   config ini file section name [env CLOUDSTACK_REGION] (default "cloudstack")

Use "exo [command] --help" for more information about a command.

Create a virtual machine

The vm command allows you to do basic CRUD operations on instances. Use vm create to deploy a virtual machine. To try it out:

$ exo vm create example

Creating sshkey
Deploying "example" .... success!

What to do now?

1. Connect to the machine

> exo ssh example
ssh -i "/home/user/.exoscale/instances/1/id_rsa" ubuntu@185.150.8.7

2. Put the SSH configuration into ".ssh/config"

> exo ssh example --info
Host example
        HostName 185.150.8.7
        User ubuntu
        IdentityFile /home/user/.exoscale/instances/1/id_rsa

The command automatially create an ssh key specifically for this instance. If you wished to use an SSH key of yours, you can refer to it by name via the --keypair <keyname> option.

Create a firewall rule to allow SSH connection

By default, security groups without any rule specified block all incoming connections. To reach your machine via SSH, you have to explicitly allow ingress on port 22. The firewall command let you do so:

$ exo firewall add default ssh --my-ip

┼─────────┼───────────────────────┼──────────┼───────────┼
│  TYPE   │         SOURCE        │ PROTOCOL │    PORT   │
┼─────────┼───────────────────────┼──────────┼───────────┼
│ INGRESS │ CIDR 178.156.35.96/32 │ tcp      │ 22 (ssh)  │
┼─────────┼───────────────────────┼──────────┼───────────┼

By default exo firewall add default ssh open connections for all IPv4 sources: 0.0.0.0/0. Using the --my-ip flag, the rule will be scoped to your current IP, e.g. 178.156.35.96/32.

Connect to your virtual machine via SSH using the command-line

The CLI exo ssh command allows you to directly open an SSH connection to an instance.

$ exo ssh example
Host key fingerprint is SHA256:nmAfu17qHLkJkEpOy2qXWaV5nSMq0yzKD6j0giZIghk
Welcome to Ubuntu 18.04 LTS (GNU/Linux 4.15.0-20-generic x86_64)

ubuntu@example:~$

Cleaning up

Removing an instance is as simple as creating one. Be cautious as there are no ways to undo a deletion.

$ exo vm delete example
[+] sure you want to delete "example" virtual machine [yN]: y
Destroying "example"...

The complete documentation

There is an in-line help to explore all the possibilities.

$ exo --help

We encourage you to explore the on-line documentation of the exo command-line client published on GitHub.