Introduction to the CLI clients
The openstack CLI tools are available to all hosts which reside inside the cloud. The recommended entrypoint to start using these clients is to open an ssh client, and ssh to "skyhigh.hig.no" using your NTNU username and password. From that shell all openstack clients are available; and access to all floating IP's within the cloud.
Authentication
A user needs to be authenticated before he/she can use the openstack clients. this is done by setting multiple environment-variables in the shell defining username/password/projectname+id and so forth. It is recommended to use the script which is downloadable from the webinterface to set these variables.
To download this script you should log into the webinterface and navigate to "COMPUTE -> Access & Security" and select the "API Access" tab. There a link to "Download Openstack RC File v3" can be found. Download this script:
When the script is downloaded, it should be uploaded over ssh to your home-folder at "skyhigh.hig.no". This can be done using your favorite scp client. In windows "FileZilla" would work fine, while in linux you can just use the commandline like so:
eigil@mylaptop:~/Downloads$ scp PRIV_eigilo-openrc.sh eigilo@skyhigh.hig.no:. eigilo@skyhigh.hig.no's password: PRIV_eigilo-openrc.sh 100% 1839 996.7KB/s 00:00
Next up is to log in to "skyhigh.hig.no" over SSH using your favorite ssh client. For windows you could use "putty", while linux and mac just can use the terminal. If your user is assigned to at least one openstack project you will be allowed into a machine called "access":
eigil@mylaptop:~$ ssh eigilo@skyhigh.hig.no eigilo@skyhigh.hig.no's password: ACCESS GRANTED - You have access to one or more OpenStack projects eigilo@access:~$
At this machine you should see the file you just uploaded, and to use the credentials from that file you should source it like so:
eigilo@access:~$ ls -l total 4 -rw-r--r-- 1 eigilo users 1839 feb. 2 13:19 PRIV_eigilo-openrc.sh eigilo@access:~$ source PRIV_eigilo-openrc.sh Please enter your OpenStack Password for project PRIV_eigilo as user eigilo:
At this point, if you typed your password correctly, you should be able to use the openstack client. Test this with the command "openstack project show <your_projectname>". In case this command returns an HTTP401 error, it is likely that you typed your password wrong. Try to type it again by sourcing the script one more time:
eigilo@access:~$ openstack project show PRIV_eigilo The request you have made requires authentication. (HTTP 401) (Request-ID: req-ec807bd4-bd8e-416b-8e1b-bcaa541b1708) eigilo@access:~$ source PRIV_eigilo-openrc.sh Please enter your OpenStack Password for project PRIV_eigilo as user eigilo: eigilo@access:~$ openstack project show PRIV_eigilo +-------------+----------------------------------+ | Field | Value | +-------------+----------------------------------+ | description | Eigil's private sandbox | | domain_id | cb782810849b4ce8bce7f078cc193b19 | | enabled | True | | id | 2a4b680765554d728aa2f4d8aadab653 | | is_domain | False | | name | PRIV_eigilo | | parent_id | cb782810849b4ce8bce7f078cc193b19 | +-------------+----------------------------------+
Command autocomplete
To have the openstack client giving you suggestions on whats valid command you could create an autocomplete file, save it as .bas_completion in your home-directory. Log out, and back in, and your openstack command will suggest what you would like to type when you click tab:
eigilo@access:~$ openstack complete > .bash_completion eigilo@access:~$ exit Connection to skyhigh.hig.no closed. eigil@mylaptop:~/Downloads$ ssh eigilo@skyhigh.hig.no eigilo@skyhigh.hig.no's password: Last login: Thu Feb 2 13:23:57 2017 from 128.39.142.103 ACCESS GRANTED - You have access to one or more OpenStack projects eigilo@access:~$ openstack <tab> <tab> access consumer help object server address container host orchestration service aggregate credential hypervisor policy snapshot availability domain identity port software backup ec2 image project stack catalog endpoint ip quota subnet command extension keypair region token complete federation limits request trust compute flavor mapping role usage configuration floating module router user console group network security volume eigilo@access:~$ openstack
Creating an initial network topology
Create a network
Create a router, and give the network external access
Configuring access parametres
Open up the firewall
Upload a SSH public key
Have openstack generate a new keypair
Upload an existing public key
Creating a virtual machine