MariaDB [(none)]> grant all privileges on glance .* to 'glance'@'localhost' \
-> identified by 'PASSWORD';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> grant all privileges on glance .* to 'glance'@'%' identified by 'PASSWORD';
Query OK, 0 rows affected (0.00 sec)
2.2、调用admin-openrc凭据
# source admin-openrc
2.3、创建服务凭据
2.3.1、创建glance用户
# openstack user create --domain default --password-prompt glance
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | 243f718f20684941a8a3a3f41594d91d |
| name | glance |
| password_expires_at | None |
+---------------------+----------------------------------+
2.3.2、将admin角色添加到glance用户和 service项目中
# openstack role add --project service --user glance admin
2.3.4、创建glance service entity
# openstack service create --name glance \
> --description "OpenStack Image" image
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Image |
| enabled | True |
| id | 60fb47009a77459c87af0f176277ba82 |
| name | glance |
| type | image |
+-------------+----------------------------------+
2.3.5、创建镜像服务API endpoint,分别创建public、internal、admin
Option "verbose" from group "DEFAULT" is deprecated for removal. Its value may be silently ignored in the future.
/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/enginefacade.py:1171: OsloDBDeprecationWarning: EngineFacade is deprecated; please use oslo_db.sqlalchemy.enginefacade
expire_on_commit=expire_on_commit, _conf=conf)
/usr/lib/python2.7/site-packages/pymysql/cursors.py:166: Warning: (1831, u'Duplicate index `ix_image_properties_image_id_name`. This is deprecated and will be disallowed in a future release.')
result = self._query(query)
NOTICE:忽略此输出中的任何废弃消息。
3.3.4、启动镜像服务并设置为随机自启动
# openstack image list
+--------------------------------------+--------+--------+
| ID | Name | Status |
+--------------------------------------+--------+--------+
| 69c87155-bd76-4ae7-bfce-53ad912b0463 | cirros | active |
+--------------------------------------+--------+--------+