Today we’re proud to announce our command line interface (CLI) client! 🎉
Written in Go, the compiled application is self-contained and can be run without installing external dependencies.
With the release of the CLI we are setting the base blocks for a more unified
and convenient way to manage your Exoscale infrastructure.
The CLI relies on a TOML config file stored in the ~/.exoscale/
folder
(corresponding to the .exoscale
folder in your home directory on Windows).
The same folder is used to store all the assets and configuration files related to the CLI usage, like the automatically created SSH keys (more on that in a minute!).
To get started, download the latest version for your OS from GitHub,
and ensure the exo
executable is present in your PATH
.
Configure and set-up the EXO CLI
The CLI has a convenient configuration wizard, which lets you import existing
.cloudstack.ini
config files, or walks you through the setup process:
$ exo config
Hi happy Exoscalian, some configuration is required to use exo.
We now need some very important information, find them there.
<https://portal.exoscale.com/account/profile/api>
[+] API Key [none]: EXO1234567890abcdefghijklmn
[+] Secret Key [none]: **redacted**
Checking the credentials of "EXO1234567890abcdefghijklmn"... success!
[+] Account name [ste@exo.io]: ste
Choose "ste" default zone:
1: ch-gva-2
2: ch-dk-2
3: at-vie-1
4: de-fra-1
[+] Select [1]: 3
[+] Do you wish to add another account? [yN]: N
Done! Let’s test it by exploring the list of the available templates:
$ exo template list
┼───────────────────────────────┼──────┼───────────────────┼──────────────────────────────────────┼
│ OPERATING SYSTEM │ DISK │ RELEASE DATE │ ID │
┼───────────────────────────────┼──────┼───────────────────┼──────────────────────────────────────┼
│ Linux CentOS 7.5 64-bit │ │ │ 909ce5b7-2132-4ff0-9bf8-aadbb423f7d9 │
│ Linux CentOS 7.4 64-bit │ │ 2018-01-08-d617dd │ 1b0b9253-929e-4865-874b-7d2c3491987b │
│ Linux CentOS 6.9 64-bit │ │ 2018-01-08-8856b8 │ cfb832b9-edce-46fa-abb4-a45454ca97ac │
│ Linux Centos 7 Atomic │ │ │ c5a139df-74ac-4279-b467-6a9a11fd6fc8 │
│ Linux CoreOS 1688 64-bit │ │ 2018-04-03-988151 │ 365ff428-ae86-4ab5-9975-4bbc8d88e599 │
│ Linux CoreOS 1576 64-bit │ │ 2018-01-05-8856b8 │ d476049d-899c-4d7f-b5c1-3b9dd67a0200 │
│ Linux Debian 9 64-bit │ │ 2018-01-18-25e9ec │ 78c2cbe6-8e11-4722-b01f-bf06f4e28108 │
│ Linux Debian 8 64-bit │ │ 2018-01-11-8856b8 │ efc6982c-7930-4650-84ea-28f63ac6633d │
│ Linux Fedora 27 │ │ │ b9f4fc8b-4620-4704-89d0-ee5042fc9745 │
│ Linux RedHat 7.5 64-bit │ │ 2018-04-13-726205 │ c901da6d-73bf-41d2-b14b-993f6e299dfb │
│ Linux RedHat 7.4 64-bit │ │ 2017-11-20-48b932 │ 3c8d2abe-86f2-456b-a579-202d3520dad9 │
│ Linux Ubuntu 18.04 LTS 64-bit │ │ 2018-04-26-0e6133 │ 4c9f5519-730f-46cb-b292-4e73ca578947 │
│ Linux Ubuntu 16.04 LTS 64-bit │ │ 2018-03-02-5858e9 │ 4fedad2b-e96c-4a70-95f7-a9142995dba4 │
│ Linux Ubuntu 14.04 LTS 64-bit │ │ 2018-03-02-5858e9 │ d9b1093f-6988-4b92-8c3a-5a01c8ad167d │
│ OpenBSD 6.3 64-bit │ 50 │ │ e2705f09-09b9-480f-bea2-94bde5ecddf2 │
│ OpenBSD 6.2 64-bit │ 50 │ │ 33d6ad96-989e-4eb6-b7fb-161e529adda1 │
│ OpenBSD 6.1 64-bit │ 50 │ │ 54c83a5e-c548-4d91-8b14-5cf2d4c081ee │
│ Pfsense 2.3.4 64-bit │ 10 │ 2017-09-12-ef6682 │ 02017edc-38f2-45c1-b36a-abdb7e367ab1 │
│ Windows Server 2016 │ 50 │ 2018-04-28-f0232 │ 7dfd88df-3e6b-4a55-9783-2cae4bd49881 │
│ Windows Server 2012 R2 │ 50 │ 2018-04-28-ef11f │ 74b7b501-bc9f-4d39-9845-7a282338321a │
┼───────────────────────────────┼──────┼───────────────────┼──────────────────────────────────────┼
Quick virtual machine deployment with the command-line
The Exoscale CLI has several productivity-enhancing capabilities that simplify complex tasks, giving a great boost to the entire workflow. This is how it looks like:
$ exo firewall create demo-securitygroup
┼────────────────────┼──────────────────────────────────────┼
│ NAME │ ID │
┼────────────────────┼──────────────────────────────────────┼
│ demo-securitygroup │ e07b16e9-5d58-41a4-af4f-47ade67c2e03 │
┼────────────────────┼──────────────────────────────────────┼
$ exo firewall add demo-securitygroup ssh --my-ip
┼─────────┼───────────────────────┼──────────┼──────────┼──────────────────────────────────────┼
│ TYPE │ SOURCE │ PROTOCOL │ PORT │ ID │
┼─────────┼───────────────────────┼──────────┼──────────┼──────────────────────────────────────┼
│ INGRESS │ CIDR ***.**.***.**/32 │ tcp │ 22 (ssh) │ 9e740713-8e4f-4759-b286-890475509dbb │
┼─────────┼───────────────────────┼──────────┼──────────┼──────────────────────────────────────┼
In no time, it created a security-group and opened the SSH port (22) for our current IP only using the name of the service.
$ exo vm create hello-cli \
--service-offering medium \
--template "Ubuntu 18.04" \
--security-group demo-securitygroup
Creating sshkey
Deploying "hello-cli" ...... success.
What to do now?
1. Connect to the machine
> exo ssh hello-cli
ssh -i "/home/ste/.exoscale/instances/0e0d1681/id_rsa" ubuntu@185.150.9.25
2. Put the SSH configuration into ".ssh/config"
> exo ssh hello-cli --info
Host hello-cli
HostName 185.150.9.25
User ubuntu
IdentityFile /home/ste/.exoscale/instances/0e0d1681/id_rsa
We’ve just deployed an instance creating a dedicated SSH key automatically, referencing size and settings of the VM by name. And in the same way you can connect to your new instance using the SSH command, without having to type anything else than its name:
$ exo ssh hello-cli
Welcome to Ubuntu 18.04 LTS (GNU/Linux 4.15.0-20-generic x86_64)
To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.
ubuntu@hello-cli:~ $ exit
The SSH key that has been created for the machine was stored, along all the necessary metadata to make all this magic work, in the ~/.exoscale
folder.
Of course, along shortcuts like on-the-fly ssh key creation, named shortcuts for ports, and other conveniences, fine-grained and precise tuning is always available.
This shows how fast and straightforward a deployment can be using the CLI.
Moreover, you gain a simple scriptable interface perfectly pairing our API.
Feel free to explore the available options by typing the exo
command in your terminal, and don’t forget to have a read of our complete CLI quick start.
Our support is at your disposal for any issue or question.