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

OpenStack stein installation (3) glance

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

Share

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

The    mirroring service enables users to discover, register, and retrieve virtual machine images. It provides a REST API that enables you to query the virtual machine ytterbium image metadata and retrieve the actual ytterbium image. You can store virtual machine images provided by the mirroring service in a variety of locations, from simple file systems to object storage systems such as OpenStack object storage.

The    OpenStack mirroring service is the core of Infrastructure as a Service (IaaS). It accepts API requests for disk or server images, as well as metadata definitions from end users or OpenStack computing components. It also supports storing disk or server images on various repository types, including OpenStack object storage.

   to support caching, there are many periodic processes running on the OpenStack mirroring service. Replication services ensure consistency and availability through clustering. Other cyclical processes include auditors, updates, and harvesters.

The    OpenStack mirroring service includes the following components:

Glance-api

Accept API calls for mirror discovery, retrieval, and storage. Glance-registry

Stores, processes, and retrieves metadata about mirrors. Metadata includes items such as size and type. Database

Store mirrored metadata, and you can choose a database according to your preferences. Most deployments use MySQL or SQLite. Storage repository for image files

Supports a variety of repository types, including normal file systems (or any file system installed on a gles-api controller node), object storage, RADOS block devices, VMware data stores, and HTTP. Note that some repositories only support read-only use. Metadata definition service

A generic API where providers, administrators, services, and users define their own metadata. This metadata can be used for different types of resources, such as images, artifacts, volumes, flavor, and aggregates. Definitions include keys, descriptions, constraints, and resource types that can be associated with new properties. Preparation work before installation

Before installing the mirroring service, we must establish the database, service credentials, and API endpoints.

Set up the database and complete the following steps: ○ connects to the database, and you can also use the mysql client connection: $mysql-u root-proot123 ○ to establish the glance database: MariaDB [(none)] > CREATE DATABASE glance; ○ grants the corresponding permissions to the glance database. The password is unified with a user name followed by 123: MariaDB [(none)] > GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY' glance123'. Load the access credentials for admin and execute the administrative command: $. Admin-openrc

Establish the credentials for the service and complete the following steps:

○ establishes glance user: # openstack user create-- domain default-- password-prompt glance User Password:glance123 Repeat User Password:glance123 +-- +-- + | Field | Value | +-+-+ | domain_id | default | | enabled | True | | id | | 288f544d71f04eefb7389bd8af685b3b | | name | glance | | options | {} | | password_expires_at | None | +-- | -+ ○ add administrator role to glance users and service project: # openstack role add-- project service-- user glance admin Note: this output has no information ○ establishes a glance service entity # openstack service create-- name glance-- description "OpenStack Image" image +-+- -+ | Field | Value | +-+-+ | description | OpenStack Image | | enabled | True | | id | 4dba7578eae342d88c131e1c90768518 | | name | glance | | type | image | +-+-- + ○ build | API endpoint of standing image service: # openstack endpoint create-- region RegionOne image public http://stack.flex.net:9292 +-+ | Field | Value | +- -- +-+ | enabled | True | | id | 340be3625e9b4239a6415d034e98aace | | interface | public | | region | RegionOne | | region_id | RegionOne | | service_id | 8c2c7f1b9b49ea9e63757b5533e6d2 | | service_name | glance | | service_type | image | | url | http://controller:9292 | +-+-| -+ # openstack endpoint create-- region RegionOne image internal http://stack.flex.net:9292 +-+-- + | Field | Value | +- -+-+ | enabled | True | | id | a6e4b153c2ae4c919eccfdbb7dceb5d2 | | interface | internal | | region | RegionOne | | region_ Id | RegionOne | | service_id | 8c2c7f1b9b49ea9e63757b5533e6d2 | | service_name | glance | | service_type | image | | url | http://controller:9292 | +-- -+ # openstack endpoint create-- region RegionOne image admin http://stack.flex.net:9292 +-+-- + | Field | Value | +- -+-+ | enabled | True | | id | 0c37ed58103f4300a84ff125a539032d | | interface | admin | | region | RegionOne | | region_id | RegionOne | | service_id | 8c2c7f1b949ea9e63757b5533e6d2 | | service_name | glance | | service_type | image | | url | http://controller:9292 | +-+-| -+ installation configuration component installation package: # yum install openstack-glance

Vi edit / etc/glance/glance-api.conf and make the following modifications:

○ in the [database] area, configure database access: [database] #... Connection = mysql+pymysql://glance:glance123@dbs.flex.net/glance ○ in the [keystone_authtoken] and [paste_deploy] areas, configure authentication service access: [keystone_authtoken] #... Www_authenticate_uri = http://stack.flex.net:5000 auth_url = http://stack.flex.net:5000 memcached_servers = dbs.flex.net:11211 auth_type = password project_domain_name = Default user_domain_name = Default project_name = service username = glance password = glance123 [paste_deploy] #... Flavor = keystone Note: comment or remove other options that fall in the [keystone_authtoken] area. ○ in the [glance_store] area, configure the location of local file storage and image files: [glance_store] #. Stores = file,http default_store = file filesystem_store_datadir = / var/lib/glance/images/

Edit / etc/glance/glance-registry.conf and make the following changes:

○ In the [database] section, configure database access: [database] #... Connection = mysql+pymysql://glance:glance123@dbs.flex.net/glance ○ In the [keystone_authtoken] and [paste_deploy] sections, configure Identity service access: [keystone_authtoken] #. Www_authenticate_uri = http://stack.flex.net:5000 auth_url = http://stack.flex.net:5000 memcached_servers = dbs.flex.net:11211 auth_type = password project_domain_name = Default user_domain_name = Default project_name = service username = glance password = glance123 [paste_deploy] #... Flavor = keystone Note: comment or remove other options that fall in the [keystone_authtoken] area. Build context service database: # su-s / bin/sh-c "glance-manage db_sync" glance to complete the installation

Allow the service to start automatically and start the service when the system boots:

# systemctl enable openstack-glance-api.service\ openstack-glance-registry.service# systemctl start openstack-glance-api.service\ openstack-glance-registry.service check operation

Use cirros as the mirror service check operation, this is a very small linux image to help us test the openstack environment, execute the following command on the controller node.

Load the access credentials for admin and execute the administrator command: $. Admin-openrc download cirros image: $wget http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img

Upload the image using qcow2 disk format, bare format and public permission access:

$openstack image create "cirros"\-file cirros-0.4.0-x86_64-disk.img\-disk-format qcow2-container-format bare\-public+-+ + | Field | Value | +-+-- + | checksum | 133eae9fb1c98f45894a4e60d8736619 | | container_format | bare | | created_at | 2015-03-26T16:52:10Z | | disk_format | qcow2 | | file | / v2/images/cc5c6982-4910-471eMurb864- 1098015901b5/file | | id | cc5c6982-4910-471e-b864-1098015901b5 | | min_disk | 0 | min_ram | 0 | | name | cirros | | owner | ae7a98326b9c455588edd2656d723b9d | | protected | False | | schema | / v2/schemas/image | | size | 13200896 | | | status | active | | tags | updated_at | 2015-03-26T16:52:10Z | | virtual_size | None | | | visibility | public | +-+-- +

Confirm the uploaded image and ID:

$openstack image list+--+ | ID | Name | Status | +-- -- + | 38047887-61a7-41ea-9b49-27987d5e8bb9 | cirros | active | +-+

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