Skip to content

Provider Jetstream CLI

Burke Mamlin edited this page Apr 24, 2023 · 2 revisions

The following assume you have the CLI client properly configured (it is embedded within the terraform repo) and you have installed your public key under your username.

Adding your Public Key

The easiest way to add your public key is to start up the CLI manually (instead of the cli.sh script) to add a volume to your public key so you can reference it directly. This only needs to be done once. Assuming you've already run the CLI tool and it created a docker image (seen via docker images command) named jetstreamapicli_cli and your public key is in ~/.ssh/id_rsa.pub on your local machine, then you could do this:

$ docker run --rm -it -v ~/.ssh:/root/.ssh:ro jetstreamapicli_cli bash
$ nova keypair-add --pub-key /root/.ssh/id_rsa.pub your-username

Listing Servers

$ os server list

Creating a New Server

$ os boot ${OS_PROJECT_NAME}-servername \
    --flavor m1.small \
    --image 87e08a17-eae2-4ce4-9051-c561d9a54bde \
    --key-name your-username \
    --security-groups global-ssh \
    --nic net-name=${OS_PROJECT_NAME}-openmrs-net

Assigning an IP address

$ neutron floatingip-create public
$ os floating-ip-associate ${OS_PROJECT_NAME}-servername your.ip.number.here

Opening HTTP access

All ports are blocked by default in Jetstream. The global-ssh secgroup opens port 22 and is included in the server creation command above. In order for the server to be accessible on the web (ports 80 and 443), you must add secgroup global-web to the new server.

$ os add-secgroup ${OS_PROJECT_NAME}-severname global-web

Server management

$ os server reboot ${OS_PROJECT_NAME}-servername
$ os server suspend ${OS_PROJECT_NAME}-servername
$ os server stop ${OS_PROJECT_NAME}-servername

Delete a server

Use this delete command with extreme caution. There is no confirmation and it is not reversible! Once you hit the enter key, the server will be gone for good.

$ os server delete ${OS_PROJECT_NAME}-servername
Clone this wiki locally