Openstack architecture-glance component (3)

Source: Internet
Author: User
Tags node server
Preface:

The entire openstack consists of control nodes, computing nodes, network nodes, and storage nodes. The basic management services of control nodes include five services: Keystone, glance, Nova, neutron, and horizon. This article will deploy the galnce component.
Glance: The image Management Service manages images that can be provided during Virtual Machine deployment, including image import, format, and corresponding templates.

Lab environment:

This component is deployed on the controller node server.

Host System IP address Role
Controller Centos7 192.168.37.128 Keystone, Nova,Glance, NTP, mariadb, rabbitmq, memcached, etcd, Apache,
Compute Centos7 192.168.37.130 Nova, NTP
Cinder Centos7 192.168.37.131 Cinder, NTP
Experiment process: 1. Database Operations

1. Create and authorize the Glance database

Mysql-u root-P
Create Database glance;
Grant all privileges on glance.To 'glance '@ 'localhost' identified by '201312 ';
Grant all privileges on glance.
To 'glance '@' % 'identified by '000000 ';

2. Obtain the admin user's environment variables and create service authentication

Source ~ /Admin-openrc
Export | grep OS _

3. Create a glance user

Openstack user create -- domain default -- password-Prompt glance
Password 123456

4. Add Admin users to glance users and projects.

Openstack role add -- Project Service -- User glance Admin

5. the user-role-project has been created. Next, access the related information of glance.

Openstack user list # user information openstack role list # role information openstack project list # service information openstack role assignment list # association information

6. Create a glance service --- openstack Image

Openstack service create -- name glance -- Description "openstack image" Image

7. Create an image Service API endpoint (three URL paths)

Openstack endpoint create -- region regionone ImagePublicHttp: // Controller: 9292
Openstack endpoint create -- region regionone ImageInternalHttp: // Controller: 9292
Openstack endpoint create -- region regionone ImageAdminHttp: // Controller: 9292

Ii. Install the glance Service

1. Install the glance package in yum

Yum install openstack-glance-y

2. Storage of image points (customized)

Mkdir/var/lib/glance/Images
CD/var/lib
Chown-HR glance: glance# Set permissions

3. Configure the interface file
Vim/etc/glance/glance-api.conf

[Database] #1942 connection = MySQL + pymysql: // glance: [email protected]/glance [keystone_authtoken] # 3501auth_uri = http: // Controller: 5000auth_url = http: // Controller: 35357 (! Note that the URL is not URI) # 3552memcached_servers = controller: 11211 # 3659auth_type = feature = default user_domain_name = default # domain name project_name = service # project name username = glance # User Password = 123456 [paste_deploy] #4508 flavor = keystone [glance_store] #2066 stores = file, HTTP # identification type # 2110default_store = file # 2429filesystem_store_datadir =/var/lib/glance/images/

4. Configure the registration file
Vim/etc/glance/glance-registry.conf

[Database] #1188 connection = MySQL + pymysql: // glance: [email protected]/glance [keystone_authtoken] # 1314auth_uri = http: // Controller: 5000auth_url = http: // Controller: 35357 (! Note the URL is not URI) # Signature = Controller: 11211 # 1472auth_type = passwordproject_domain_name = defaultuser_domain_name = defaultproject_name = serviceusername = glancepassword = 123456 [paste_deploy] #2295 flavor = keystone

Note: The configuration file contains many contents and needs to be checked carefully. You can filter the configuration file to check

Grep & quot; ^ [A-Z] & quot;/etc/glance/glance-registry.conf


5. Synchronize the Image Database

Su-S/bin/sh-c "glance-manage db_sync" glance # synchronization # display: database is synced successfully. mysql-u root-pabc123-e 'use glance; show tables; '# Check whether data exists after synchronization.


6. Start related services and set Automatic startup

Systemctl enable openstack-glance-api.service
Systemctl startOpenstack-glance-API.Service
Systemctl enable openstack-glance-registry.service
Systemctl startOpenstack-glance-Registry. Service
SS-NTL | grep 9292

Iii. Verify the glance Image

Use cirros to verify image service operations. This is a small Linux image that helps you test openstack deployment.
For more information about how to download and build images, see the openstack virtual machine image guide https://docs.openstack.org/image-guide/
For information about how to manage images, see openstack End User Guide https://docs.openstack.org/queens/user/

1. Obtain the admin user's environment variables and download the image.

Source ~ /Admin-openrc
Wget http://download.cirros-cloud.net/0.3.5/cirros-0.3.5-x86_64-disk.img
# Waiting Time for download

2. upload an image

# Use the qcow2 disk format, bare container format, and public visibility to upload an image to the image service so that all projects can access it
Openstack Image Create "cirros" -- file cirros-0.3.5-x86_64-disk.img -- Disk-format qcow2 -- container-format bare -- Public

3. View uploaded images

Openstack image list

So far, the glance component has been installed. Thank you for reading!

Openstack architecture-glance component (3)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.