官术网_书友最值得收藏!

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:

  1. First, load up a Terminal and become the root user with the following command:
    sudo -i
    
  2. We'll be using pip to install the clients. If pip is not installed, carry out the following steps:

    On macOS or variants use this:

    wget https://bootstrap.pypa.io/get-pip.py
    python get-pip.py
    
  3. On popular Linux systems, use your package manager to install the packages:

    Ubuntu: Ensure that python-dev and python-pip are installed

    Red Hat: Ensure that python-devel and python-pip are installed

Note

Windows: Be sure that you have Python installed and available in PATH and Microsoft Visual C++ Build Tools installed.

How to do it…

With pip installed on our system, we are able to install the clients using the following simple steps:

  1. To install the OpenStack client, carry out the following command:
    pip install python-openstackclient
    
  2. To install the individual clients, carry out the following commands:
    pip install python-novaclient
    pip install python-neutronclient
    pip install python-glanceclient
    pip install python-heatclient
    pip install python-keystoneclient
    pip install python-cinderclient
    pip install python-swiftclient
    

Tip

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:

  1. Clone the client VirtualBox Vagrant environment:
    git clone https://github.com/OpenStackCookbook/openstack-client.git
    
  2. Launch the client:
    cd openstack-client
    vagrant up
    
  3. Access the virtual machine:
    vagrant ssh
    

How it works…

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.

主站蜘蛛池模板: 乐都县| 屏南县| 农安县| 林西县| 绵阳市| 中卫市| 锡林郭勒盟| 加查县| 马尔康县| 色达县| 碌曲县| 红原县| 六安市| 威宁| 乌拉特前旗| 化德县| 青河县| 水富县| 阳春市| 望奎县| 东乌珠穆沁旗| 襄垣县| 喀什市| 广安市| 集安市| 卫辉市| 皋兰县| 彰化市| 斗六市| 辽阳市| 嘉善县| 枣阳市| 门源| 宜黄县| 田林县| 鄯善县| 准格尔旗| 新昌县| 民权县| 洞口县| 绿春县|