Installing OpenStack CLI on Windows

Before you can install OpenStack CLI on Windows, you must install Python 2.7 and Microsoft Visual C++ compiler for Python, on the Windows host.

Download the Python 2.7 installer and the Microsoft Visual C++ Compiler for Python 2.7.

Install Python and Microsoft Visual C++ Compiler

Follow the steps given below to install Python.

Note: You are not required to install pip separately as pip is automatically installed with Python 2.7.

  1. Download and install Microsoft Visual C++ Compiler for Python 2.7
  2. Run the Python installer that you have downloaded from the Python website.
  3. During the installation, include the Python directory path in the PATH environment variable.
    Select the Will be installed on local hard drive option for the Add python.exe to Path feature, and then click Next.

    The Python installation path is automatically added to the PATH environment variable on successful installation of Python, when this option is selected.

Install OpenStack CLI

To install OpenStack CLI, follow the steps given below.

  1. Run the following command in the Windows Shell.
    pip install --upgrade --requirement https://raw.githubusercontent.com/platform9/support-locker/master/openstack-clients/requirements.txt --constraint http://raw.githubusercontent.com/openstack/requirements/stable/newton/upper-constraints.txt

    Note: When the instance storage is not shared between the source host and the destination host, block migration must be used. This type of migration can be slower, since it copies data and requires that both hosts have compatible CPU architectures. If you want to perform a block migration, use a python-openstackclient release version higher than python-openstackclient release version 3.2.1. Use the following command to upgrade the release version of your python-openstackclient to the newton-eol version.

    pip install --upgrade git+https://github.com/openstack/python-openstackclient.git@newton-eol

  2. Download the OpenStack RC file from the Platform9 Clarity UI.
  3. Download the Windows PowerShell script from https://github.com/platform9/support-locker/blob/master/openstack-clients/windows/Source_OpenRC.ps1
  4. Start Windows PowerShell, and change into the directory where you saved the above script.
    cd .\
    <path to the script>
  5. Run the downloaded Windows PowerShell script with the OpenStack RC file as argument.
    .\Source_OpenRC.ps1 .\openstack.rc

You are now ready to run Openstack CLI commands on the Windows host.

Note: If you receive the error "Source_OpenRC.ps1 cannot be loaded. The file Source_OpenRC.ps1 is not digitally signed," you could consider modifying the ExecutionPolicy for the current user, or process to permit execution of the script.

Set-ExecutionPolicy -Scope <CurrentUser|Process> -ExecutionPolicy Bypass

See Microsoft's PowerShell Set-ExecutionPolicy documentation for more information.


December 20, 2017