Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to create an Image

Shulou Source: shulou.com Published: 2022-06-01 00:41:46 09月22日 Update

This article introduces you how to create Image, the content is very detailed, interested friends can refer to, hope to be helpful to you.

How to create an Image through Web GUI and CLI.

OpenStack provides two exchange interfaces of Web UI (Horizon) and command line CLI for end users.

We need to be able to use both ways.

Some students may think that since there is a more friendly Web UI, why use CLI? Here are the reasons given by CloudMan:

Web UI is not as functional as CLI, and some operations only provide CLI. Even with all the functions, CLI can use more parameters.

Generally speaking, CLI returns results faster and operates more efficiently.

CLI can be batch processed in a script

Some time-consuming operations CLI are more appropriate, such as creating a mirror (which will be covered later)

Web UI creates image

After logging in to admin, Project-> Compute-> Images

Click in the upper right corner

Button to name the new image.

Here we upload an image. Click to select the image file cirros-0.3.4-x86_64-disk.img. Cirros is a small linux image, which is very suitable for testing. You can download it at http://download.cirros-cloud.net/.

Select the format QCOW2.

If checked, the image can be used by other Project. If checked, the image is not allowed to be deleted.

Click, upload the file to OpenStack and create a new image

Click the image link to display details

CLI creates image

Cirros this linux image is very small, upload through Web UI is very fast, the operation will be very smooth. However, if the image we want to upload is relatively large (for example, several gigabytes), then the operation will stay in the uploaded Web interface for a long time, and we don't know what the current status is. CLI is a better choice for such operations.

Upload image to the file system of the control node, for example, / tmp/cirros-0.3.4-x86_64-disk.img

Set environment variabl

There is an openrc file in the installation directory of Devstack. Source this file allows you to configure the environment variables of CLI. Here we pass in two parameters, the first parameter is the OpenStack user name admin;, the second parameter is the Project name admin

Execute the image creation command

Glance image-create-name cirros--file / tmp/cirros-0.3.4-x86_64-disk.img-disk-format qcow2-container-format bare-progress

In creating the CLI parameter of image, we use-- progress to show the percentage of file uploads. Is this more intuitive than Web UI?

View the new Image under / opt/stack/data/glance/images/

On how to create Image to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Tags: Files parameters mirrors more selections contents functions variables commands environment user interface help good appropriate smooth intuitive generally speaking two Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei NVidia Shulou Technology Redmi Microsoft