Installing OpenStack CLI Tools on Mac OSX

Prerequisites

  • The OpenStack Command-Line Interface (CLI) tools are supported on Python 2.7, so you must have a Python 2.7 environment installed. While El Capitan comes with Python 2.7, you want to set up your Mac environment so that you can use virtual environments and update easily.
  • On Mac OSX, use brew to install Python, which in turn requires Xcode Command Line Tools. Brew is available from http://brew.sh/#install. Instructions for proper setup can be found in the Hitchhiker’s Guide to Python.
  • Install virtualenv with pip install virtualenv. Read more in the Hitchhiker’s Guide to Python.

Using a virtual environment for the installation

  1. Start Terminal or iTerm in Mac OSX.
  2. After installing virtualenv with pip install virtualenv, create a virtual environment with this command where <name> is the name of the virtual environment:

    $ virtualenv

    For example:

    $ virtualenv openstack-cli

  3. To activate the virtual environment, run the activate script:

    $ .\openstack-cli\bin\activate

Now that the virtual environment is active, your prompt changes to indicate the virtual environment you are currently using:

(openstack-cli) $

Installing the OpenStack client

  1. With the virtual environment active, install the OpenStack client, which in turn installs python-novaclient and the other dependent clients:

    (openstack-cli) $ pip install python-openstackclient

  2. Now that the client is installed, you must provide credentials in the environment in order to run commands. Refer to Providing Metacloud Credentials to CLI Tools to continue.