Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to create an Image

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report