OpenStack Cloud Computing Cookbook
http://www.openstackcookbook.com/
Tag Archives: client
OpenStack clients installation on Ubuntu for the OpenStack Cloud Computing Cookbook
March 28, 2015
Posted by on Throughout the OpenStack Cloud Computing Cookbook we expect the reader to have access to the client tools required to operate an OpenStack environment. If these are notĀ installed, they can be installed by following this simple guide.
This guide will cover installation of
- Nova Client
- Keystone Client
- Neutron Client
- Glance Client
- Cinder Client
- Swift Client
- Heat Client
Getting ready
To use the tools and this guide, you are expected to have access to a Ubuntu (preferably 14.04 LTS) server or PC that has access to the network where you are installing OpenStack.
How to do it…
To install the clients, simply execute the following commands
sudo apt-get update sudo apt-get install python-novaclient python-neutronclient python-glanceclient \ python-cinderclient python-swiftclient python-heatclient
Once these are installed, we can configure our CLI shell environment with the appropriate environment variables to allow us to communicate with the OpenStack endpoints.
A typical set of environment variables are as follows and is used extensively throughout the book when operating OpenStack as a user of the services:
export OS_TENANT_NAME=cookbook export OS_USERNAME=admin export OS_PASSWORD=openstack export OS_AUTH_URL=https://192.168.100.200:5000/v2.0/ export OS_NO_CACHE=1 export OS_KEY=/vagrant/cakey.pem export OS_CACERT=/vagrant/ca.pem
Typically these export lines are written to a file, for example called ‘$home/openrc’ that allows a user to simply execute the following command to source in these to use with OpenStack
source openrc
(or in Bash: . openrc)
Configuring Keystone for the first time
To initially configure Keystone, we utilize the SERVICE_TOKEN and SERVICE_ENDPOINT environment variables. The SERVICE_TOKEN is found in /etc/keystone/keystone.conf and should only be used for bootstrapping Keystone. Set the environment up as follows
export ENDPOINT=192.168.100.200 export SERVICE_TOKEN=ADMIN export SERVICE_ENDPOINT=https://${ENDPOINT}:35357/v2.0 export OS_KEY=/vagrant/cakey.pem export OS_CACERT=/vagrant/ca.pem
This bypasses the usual authentication process to allow services and users to beĀ configured in Keystone before the users and passwords exist.
How it works…
The OpenStack command line tools utilize environment variables to know how to interact with OpenStack. The environment variables are easy to understand in terms of their function. A user is able to control multiple environments by simply changing the relevant environment variables.
To initially install the users and services, a SERVICE_TOKEN must be used as at this first stage there are no users in the Keystone database to assign administrative privileges to. Once the initial users and services has been set up, the SERVICE_TOKEN should not be used unless maintenance and troubleshooting calls for it.