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

Configuring your Windows environment

Configuring your Windows environment for use with OpenStack requires a little more effort – but the basic premise remains: we're configuring our desktop so that it has access to environment variables, as well as ensuring that our tools, written in Python, are able to execute properly.

Getting ready

The following applies to Windows 10. Ensure that you have followed the steps to install Python.

How to do it…

Carry out the following to load the required environment variables into your Windows session:

  1. To be able to source in the required OpenStack environment functions as we do on a Unix/Linux platform, we can achieve a similar outcome using some PowerShell. In the PowerShell Terminal, go and grab the following PowerShell script and download it into your working client directory (for example C:\Users\Username\OpenStack):
    mkdir OpenStack
    cd OpenStack
    wget https://raw.githubusercontent.com/OpenStackCookbook/vagrant-openstack/master/Source-OpenRC.ps1 -UseBasicParsing -OutFile Source-OpenRC.ps1
    
  2. Using the same OpenStack credentials as described in the Configuring your Linux or macOS environment recipe, ensure that it is named openrc to match the following example and execute the following in PowerShell:
    .\Source-OpenRC.ps1 .\openrc
    

    Note

    Warning: You may get an error executing the PowerShell script. Most Windows 10 desktops appear to have a default policy of restricted, which excludes the running of PowerShell scripts that aren't signed – even the ones you have created yourself. To remove this for this session, execute the following and acknowledge the warning:

    Set-ExecutionPolicy –ExecutionPolicy RemoteSigned Unrestricted -Scope CurrentUser
    
  3. You should now be able to use your OpenStack clients under your Windows desktop PowerShell Terminal.

How it works…

Configuring your Windows environment is a little more involved than it is for Unix/Linux environments. We have to have a mechanism for loading environment variables into our shell that isn't a native feature of Windows. We do this using a PowerShell script. However, we have to remove a restriction to allow this to work. Once we have this all set up correctly, we are able to use the OpenStack environment from our Windows desktop.

主站蜘蛛池模板: 舒城县| 双城市| 乌兰浩特市| 集贤县| 萨嘎县| 伊通| 长武县| 玉林市| 大连市| 永胜县| 舒兰市| 澳门| 仁布县| 长寿区| 奉贤区| 儋州市| 宕昌县| 宝鸡市| 塔城市| 巴林右旗| 多伦县| 呼伦贝尔市| 南乐县| 湛江市| 当阳市| 上栗县| 茌平县| 蚌埠市| 阜阳市| 辽阳市| 安庆市| 时尚| 根河市| 保定市| 天祝| 定安县| 尚志市| 融水| 友谊县| 康定县| 如东县|