Detailed explanation of OpenStack's Glance component

One: Introduction

    1. Function

       1. Glance is an OpenStack image service used to register, log in, and retrieve virtual machine images.

       2. The Glance service provides a REST API that enables you to query the virtual machine image metadata and retrieve the actual image.

       3. The virtual machine image provided by the image service can be stored in different locations, from simple file system object storage to similar OpenStack object storage systems.

       4. Provides management of the images that can be provided when the virtual machine is deployed, including the import and format of the image, and the production of corresponding templates

 

    2. Mirror status

       1. Queued: Initialize the mirroring state. After the mirror file has just been created, the mirror identifier has been saved in the glance database, but it has not been uploaded to glance. At this time, glance has no description of the mirror data, and its storage space is 0 .

       2. Saving: A transitional state of the original image data during upload. It occurs during the process of uploading image data to glance. Generally speaking, after receiving an image request, glance uploads the image to glance.

       3. Active: A state after the image is successfully uploaded. It indicates the available image in glance.

       4. Killed: When the image upload fails or the image file is unreadable, glance sets the image status to Killed.

       5. Deleted: The image file will be deleted immediately, but the current glance still retains the relevant information and original image data of the image file.

       6. Pending_delete: The image file will be deleted immediately, and the image file cannot be restored.

             

 

    Three, disk format

       1. RAW: RAW is often referred to as the bare format. In fact, it has no format. The biggest feature is simplicity. The data is written into it without any modification. Therefore, the performance is very good, and it does not even need to start the image. The virtual machine only needs to mount files to directly read and write internal data. And because the RAW format is simple, the conversion between RAW and other formats is also easier. In the KVM virtualization environment, there are many virtual machines that use the RAW format.

       2. QCOW2: It is the disk format of QEMU's CopyOn Write feature. The main feature is that the disk file size can grow with the growth of data. For example, if you create a 10GB virtual machine, only 5GB is used inside the actual virtual machine, so the initial qcow2 disk file size is 5GB. Compared with RAW, using this format can save some space resources.

       3. VHD: VHD is also a common disk format. Microsoft's Virtual PC and Hyper-V use the VHD format. VirtualBox also provides support for VHD. If you want to use Hyper-V virtualization on OpenStack, you should upload an image file in VHD format.

       4. VMDK: A virtual machine disk format created by VMware is currently an open general format. In addition to VMware's own products, QEMU and VirtualBox also provide support for the VMDK format.

       5. VDI: The format used by Oracle's VirtualBox virtual software.

       6. ISO: ISO refers to a format for archiving data files on optical discs.

       7. AKI, ARI, AMI: the image format used by Amazon's AWS.

 

    Fourth, the container format

       1. BARE: An image metadata format without a container.

       2. OVF: Open Virtualization Format.

       3. OVA: Open virtualization device format.

       4. AKI, ARI: The image format used by Amazon's AWS.

           

 

Two: Architecture

    One, the core architecture

           

       1. Glance-api: Receive REST API requests, and then use other modules (glance-registry and image store) to complete operations such as mirror search, acquisition, upload, and deletion. The default listening port is 9292.

       2. Glance-registry: used to interact with MariaDB database, used to store or get the metadata of the mirror, listening on port 9191 by default.

       3. Store Adapter: Obtain the mirror image through the provided storage interface

       4. Database: Image's metadata will be kept in the database, mainly using MySQL and SQLite .

 

    Second, the configuration file

       1. Glance-api.conf: Glance api service configuration file.

           1. Glance service installation log and debugging information, for example: debug, log file path log_file and other parameters.

           2. Information about the API server of the Glance service. For example: the service binding IP address, port bind_port and other parameters

           3. The relevant information of the Registry service, such as: the network address of the Registry service, the port number to be monitored, the communication protocol between glance and the Registry, etc.

           4. System message related parameters, this part mainly configures the sending and receiving of glance and system messages. The IP address, listening port and other parameters of the message queue rabbitmq

           5. Mirror the related configuration of the back-end storage. Under normal circumstances, glance-api.config contains the information configuration of common file storage, swift, S3, RBD and other common storage devices.

       2. Glance-registry.conf: Glanceregistry service configuration file, users store metadata related to mirroring.

       3. glance-scrubber.conf: A service used to clean up deleted images.

       4. policy.json: access control for the mirroring service. Here, we can define roles and policies, which are security features in OpenStack Glance.

 

    Three, work flow

       

 

Three: common operations

     

 

Guess you like

Origin blog.csdn.net/qq_42533216/article/details/114081706