In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
OpenStack image service is the core service of IaaS. Mirroring services are mainly implemented by glance components. It accepts disk image or server image API requests, as well as metadata definitions from end users or OpenStack computing components. It also supports disk mirroring or server image storage on various types of repositories, including OpenStack object storage.
A large number of periodic processes run on the OpenStack mirroring service to support caching. Synchronous replication (Replication) services guarantee consistency and availability in the cluster. Other periodic processes include auditors, updaters, and reapers.
The OpenStack mirroring service includes the following components:
Glance-api
Receive calls to mirror API, such as mirror discovery, recovery, and storage.
Glance-registry
Stores, processes, and recovers mirrored metadata, including items such as size and type.
Database
To store mirror metadata, users can choose a database according to their personal preferences, and most deployments use MySQL or SQLite.
The specific functions of the glance component are as follows:
1) provide REST API to enable users to query and obtain image metadata and image itself
2) support a variety of ways to store image, including ordinary file system, SWIFT, Amazon S3, etc.
3) execute Snashot to Instacne to create a new pair of image.
I. the structure of glance
The general structure is as follows:
1.1 glance-api
Glance-api is a service process running in the background of the system, which provides REST API to the outside world, responds to image queries, acquires and stores calls, and glance-api does not really handle requests.
If it is an operation related to image metadata, glance-api will forward the request to glance-registry;. If it is an operation related to image's own access, glance-api will forward the request to image's store bakend.
The glance-api process can be viewed on the control node.
Ps-ef | grep glance-api
1.2 glance-registry
Glance-registry is a service process running in the background of the system, which is responsible for processing and accessing the metadata of image, such as the size and type of image
View the process
Ps-ef | grep glance-registry
Glance supports images in multiple formats
1.3Database
The metadata of image will be maintained in database. The default is mysql.
View the database information for glance on the control node, as follows:
1.4 Store backend (back-end storage)
Glance itself does not store the image, and the real image is stored in the backend. Glance supports a variety of backend, including:
A directory on local file system (default configuration)
GridFS
Ceph RBD
Amazon S3
Sheepdog
Openstack block storage (cinder)
Openstack object Storage (Switf)
VMware ESX
Which backend is used, which is actually configured in / etc/glance/glance-api.conf
In packstack allinone, the image is stored in the local directory / var/lib/glance/images/ of the control node
Use the command to view an existing image
Glance image-list
View the saved catalog
Each image corresponds to a file in the directory, named after the ID of image
II. Operation of glance
2.1 use web UI
After logging in to admin, click Project-> Compute-> Image
Click to create an image, name the image, select qcow2 format for format, (qemu copy on write, copy while writing, snapshot format)
You can download the j image file cirros-0.3.4-x86_64-disk.img from https://download.cirros-cloud.net/0.3.4/. This cirros is a small linux image suitable for testing.
If you select Common, the image can be used by other projects, and if you select protected, the image cannot be deleted.
After uploading, click create. After the creation is completed, you can click the image to view the properties.
2.2 use the command
For smaller images, you can use web ui to upload it quickly, but it is not suitable for uploading larger images.
For example, if we upload a 4G iso file, we first use file transfer (ftp,sftp) to transfer to the specified directory of the control node, such as / root/, and then upload the image through the command of openstack as follows: (note: the space is recognized by linux as\)
Create using the following command
Glance image-create-name windwosserver2008r2-file / root/windows\ Server\ 2008.iso-disk-format iso-container-format bare-progress
The image format created is iso, and the upload progress is displayed using-- progress.
After the creation, view the image
To delete an image, you can use the glance image-delete command, followed by ID, such as
Glance image-delete 57e1a4c2-3915-4f13-a0d9-411e777c2082
Third, use openstack cli
Each openstack component service has its own cli, and the command keyword is the component name. For example, the glance command uses the glance component.
Note that the environment variable needs to be set before using openstack cli, as shown in packstack:
Source keystonerc_admin
Every command has the operation of adding, deleting, checking and changing.
CMD-- creare [parm1] [parm2].
CMD-- delete [parm1] [parm2].
CMD-- update [parm1] [parm2].
CMD-list
CMD-- show [parm]
An example of the image management command for glance is as follows:
Glance image-create
Glance image-delete
Glance image-update
Glance image-show
You can use help to view the use of command methods
View glance help image-create
Openstack troubleshoots problems mainly through logs. Each component service has its own log. In packstack, there are mainly two logs, galanceapi.log and glaceregistry.log, which are saved in / var/log/glance.
Api.log records REST API calls
Glance.log log, which records the process of the glace service processing the request and the database operation
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.