作者名:Kevin Jackson Cody Bunch Egle Sigler James Denton
本章字數:572字
更新時間:2021-07-02 16:25:05
Installing the OpenStack clients
There are a number of OpenStack clients available that are used to interact with OpenStack from the command line. Historically, each service in OpenStack has its own client. For example, the OpenStack Compute project, Nova, has its own nova client. Similarly, the OpenStack networking project, Neutron, also has its own client called neutron client. And so on.
Officially, there is a convergence to using one client: the OpenStack client. However, not all commands and features are available under this one tool. Moreover, the OpenStack client still requires each individual project command-line tool installed to function; however, it provides a more consistent interface without the need to remember each individual project name.
Getting ready
As we are preparing your desktop for interacting with OpenStack from the command line, you will appreciate that there are a variety of choices you can make for your desktop OS of choice. This section will describe the installation of OpenStack clients.
As we will be installing the OpenStack clients using pip, ensure that this is installed by following these steps:
First, load up a Terminal and become the root user with the following command:
sudo -i
We'll be using pip to install the clients. If pip is not installed, carry out the following steps:
Each of the projects have their own client, so the syntax is:
pip install python-PROJECTclient
Alternative – use a preconfigured OpenStack client virtual machine
Sometimes the clients are in development at a different pace to the projects installed in your, environment which can make for version incompatibilities. To overcome this, either use virtualenv (https://pypi.python.org/pypi/virtualenv) or use a virtual machine, under VirtualBox, that has been preconfigured for accessing your OpenStack environments. To use a prebuilt virtual environment, carry out the following:
Installing the OpenStack clients is made very simple using the pip command-line tool, which is used to install Python packages. The main tool for using OpenStack on the command line is called the OpenStack client. This tool is used to control all aspects of OpenStack. However, there are some commands and options that have yet to make it into the main OpenStack clients. To overcome this, the older legacy project tools can still be used. Ensure that these are also installed using the following syntax:
pip install python-PROJECTclient
Replace PROJECT with the specific name of the OpenStack project, such as glance or neutron.
Alternatively, create these tools in small virtual machine so that the tools are always available. A Vagrant OpenStack client environment is available from https://github.com/OpenStackCookbook/ope.