Export Image

You can export an image on both Windows OS and Linux OS by following the steps below.

Prerequisite

  • ต้องมี image อยู่ใน project

If you want to export using Windows OS, follow these steps:

  1. Download & Install Python

    • Download Python from this link: https://www.python.org/ftp/python/3.13.3/python-3.13.3-amd64.exe

    • Check the box for "Add python.exe to PATH" and click "Install Now".

  2. Test if Python is working correctly by opening cmd and running the following command:

C:\Users\OhmzPC>python --version
Python 3.13.3
  1. Create a venv to use for the OpenStack client.

C:\Users\OhmzPC>cd Documents

C:\Users\OhmzPC\Documents>mkdir Export_Image

C:\Users\OhmzPC\Documents>cd Export_Image

C:\Users\OhmzPC\Documents\Export_Image>python -m venv osclient

C:\Users\OhmzPC\Documents\Export_Image>osclient\Scripts\activate

(osclient) C:\Users\OhmzPC\Documents\Export_Image>pip install --upgrade pip
Requirement already satisfied: pip in c:\users\ohmzpc\documents\export_image\osclient\lib\site-packages (25.0.1)

(osclient) C:\Users\OhmzPC\Documents\Export_Image>pip install python-openstackclient

(osclient) C:\Users\OhmzPC\Documents\Export_Image>openstack --version
openstack 8.0.0
  1. Download your Public API RC File.

  1. Modify the RC file from .sh to .bat

  • Change #!/usr/bin/env bash to @echo off

  • Change # to rem

  • Change export to set

  • Change if [ -z "$<Variable>" ]; then unset <Variable>; fi to if "%<Variable>%"=="" set <Variable>=

    • Example: if [ -z "$OS_USER_DOMAIN_NAME" ]; then unset OS_USER_DOMAIN_NAME; fi becomes if "%OS_USER_DOMAIN_NAME%"=="" set OS_USER_DOMAIN_NAME=

  • Change read -sr OS_PASSWORD_INPUT to set /p OS_PASSWORD_INPUT=

  • Open the file in a text editor to make these changes. For example: notepad your_project_RC_file.bat

From (osclient) C:\Users\OhmzPC\Documents\Export_Image>notepad test_project_RC_file.sh

To (osclient) C:\Users\OhmzPC\Documents\Export_Image>notepad test_project_RC_file.bat

  1. Run the .bat file and check if you can use the OpenStack client in your project.

  1. List the images in your project with the command:

  1. Download the desired image from your project with the command:

  1. Once the download is complete, you will have the image file.

If you want to export using Linux, follow these steps:

First, prepare the environment for your specific OS.

For macOS:

  1. Download & Install Python.

1.1 Install Homebrew (if not already installed).

1.2 Install Python via Homebrew.

1.3 Test if Python is working correctly with the command:

  1. Create a venv to use for the OpenStack client.

For Ubuntu/Debian:

  1. Download & Install Python.

  1. Test if Python is working correctly with the command:

  1. Create a venv to use for the OpenStack client.

For Rocky/AlmaLinux:

  1. Download & Install Python.

  1. Test if Python is working correctly with the command:

  1. Create a venv to use for the OpenStack client.

After preparing the environment for your OS, follow these steps:

  1. After preparing the environment for your OS, follow these steps:

  1. Review the RC_file.sh.

  1. Source the .sh file and check if you can use the OpenStack client in your project.

  1. List the images in your project with the command:

  1. Download the desired image from your project with the command:

  1. Once the download is complete, you will have the image file.

Last updated