Skip to content

Howto: Installing and configuring the OpenStack commandline tools on Windows

Hugo van Duijn edited this page Nov 30, 2017 · 16 revisions

Apart from the OpenStack web interface you can also use command line tools to interact with OpenStack. This HOWTO explains how to install the command line clients, and explains how to use these in a Powershell command prompt on Windows.

Install Python

  1. Download the latest Python 2 release from the Python website: http://python.org/downloads/windows/ (If you would like to install Python 3.5.* and the machine you install too doesn't have VS 2015, you will need to install it with the C++ Common Tools checked otherwise the nova client and other installations through pip may fail)

  2. After clicking the most recent Python 2 release, choose to download the Windows X86-64 MSI Installer

  3. Install Python by double-clicking the MSI package that you just downloaded and completing the installation wizard.

  4. Add Python to your PATH environment variable by:

    1. Opening the Computer settings

      https://raw.githubusercontent.com/naturalis/openstack-docs/master/img/installpythoncomputersettings.png
    2. Choosing ‘Advanced system settings’

      https://raw.githubusercontent.com/naturalis/openstack-docs/master/img/installpythonadvancedsettings.png
    3. Clicking on ‘Environment variables’

      https://raw.githubusercontent.com/naturalis/openstack-docs/master/img/installpythonenvironmentvariables.png
    4. Looking up the Path variable in the System variables list and clicking Edit:

      https://raw.githubusercontent.com/naturalis/openstack-docs/master/img/installpythonsystemvariables.png
    5. Add ‘;C:\Python27;C:\Python27\Scripts’ at the end of the line (don’t forget the semicolon) and click OK:

      https://raw.githubusercontent.com/naturalis/openstack-docs/master/img/installpythoneditsystemvariables.png
  5. Close the remaining Windows.

Install PIP

  1. Install the OpenStack clients, pip is installed by default in recent python windows versions and can be found by default in the c:/python27/scripts directory:

    pip install python-openstackclient

Download RC file

After succesfull installation you will have to download the OpenStack RC file for the project you want to manage

  1. Log in to the OpenStack dashboard
  2. Open the project you want to manage
  3. Open the menu Access & Security and the API Access tab:
  4. Click on Download OpenStack RC File and save the file in a convenient place

Download Powershell script

Linux and OSX users can use the downloaded RC file, a small BASH script, natively. Windows / Powershell have to use a simple Powershell script.

  1. Download the Source-OpenRC.ps1 script and save it locally.

  2. Start Powershell

  3. Run the script, and give the path to the downloaded RC file as an argument:

    H:\Downloads\Source-OpenRC.ps1 H:\Downloads\project-openrc.sh
  4. When asked, enter your password.

Use the OpenStack command line tools

Now you've installed and configured the everything you can start using the command line tools.

  1. Start Powershell

  2. Test if everything is working with a simple list command:

    nova list
  3. If you've started with an empty project you'll get output like this:

    +----+------+--------+------------+-------------+----------+
    | ID | Name | Status | Task State | Power State | Networks |
    +----+------+--------+------------+-------------+----------+
    +----+------+--------+------------+-------------+----------+
  4. Check the OpenStack documentation or use the help command, for example:

    nova help
    nova help list
Clone this wiki locally