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 Train version dual-node installation (4) install the image service glance

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

Share

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

Part IV: install the image service glance

The glance service provides an image of the system disk (template) for the instance.

Install the glance service on the control node by doing the following

Establish glance database

Mysql-u root-p

Create a glance database:

MariaDB [(none)] > CREATE DATABASE glance

Grant appropriate access to the glance database

MariaDB [(none)] > GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY' GLANCE_DBPASS'

MariaDB [(none)] > GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY' GLANCE_DBPASS'

Exit

Use scripts to import admin environment variables

. Admin-openrc

Create a glance user

Openstack user create-domain default-password GLANCE_PASS glance

Authorize glance users

Openstack role add-project service-user glance admin

Create a glance service entity

Openstack service create-name glance-description "OpenStack Image" image

Create a mirror service API access endpoint

Openstack endpoint create-- region RegionOne image public http://ct:9292

Openstack endpoint create-- region RegionOne image internal http://ct:9292

Openstack endpoint create-- region RegionOne image admin http://ct:9292

Install the package

Yum install openstack-glance-y

Edit the configuration file for glance

Cp / etc/glance/glance-api.conf / etc/glance/glance-api.conf.bak

Grep-Ev'^ $| #'/ etc/glance/glance-api.conf.bak > / etc/glance/glance-api.conf

Vim / etc/glance/glance-api.conf

In the database section, configure database access:

[database]

Connection = mysql+pymysql://glance:GLANCE_DBPASS@ct/glance

In the [keystone_authtoken] and [paste_deploy] sections, configure identity service access:

[keystone_authtoken]

Www_authenticate_uri = http://ct:5000

Auth_url = http://ct:5000

Memcached_servers = ct:11211

Auth_type = password

Project_domain_name = Default

User_domain_name = Default

Project_name = service

Username = glance

Password = GLANCE_PASS

[paste_deploy]

Flavor = keystone

In the [glance_store] section, configure the location of local file system storage and mirrored files:

[glance_store]

Stores = file,http

Default_store = file

Filesystem_store_datadir = / var/lib/glance/images/

Populate the glance database:

Su-s / bin/sh-c "glance-manage db_sync" glance

Start the image service and configure it to start when the system boots:

Systemctl enable openstack-glance-api.service

Systemctl start openstack-glance-api.service

After booting, use netstat-tnlup to check the port situation. If you see port 9292, it means that glance started successfully.

Download the cirros image (cirros is a small Linux system) and verify the installation of glance

Yum install wget-y

. Admin-openrc

Wget http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img (if the download is slow, you can also download it under windows using tools such as Xunlei, and then upload it to the root directory of the control node)

Openstack image create-- file / root/cirros-0.4.0-x86_64-disk.img-- disk-format qcow2-- container-format bare-- public cirros (one of the official document potholes, do not use the glance image-create in the official document here, the new version of OpenStack is no longer supported, try to use the command that begins with openstack)

Openstack image list

View mirrored physical files

Ll / var/lib/glance/images/

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