部署要求
[root@controller ~]# mysql -u root -p123456
MariaDB [(none)]> CREATE DATABASE nova; #创建 nova 数据库
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY '123456'; #对nova数据库授予恰当的访问权限
Query OK, 0 rows affected (0.01 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY '123456';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> q
Bye
[root@controller ~]# source admin-openrc.sh #获得 admin 凭证来获取只有管理员能执行命令的访问权限
创建服务证书
[root@controller ~]# openstack user create --domain default --password-prompt nova #创建 nova 用户
User Password: #密码为123456
Repeat User Password:
----------- ----------------------------------
| Field | Value |
----------- ----------------------------------
| domain_id | default |
| enabled | True |
| id | 00a917a5ba494d13b3c48bb51d47384c |
| name | nova |
----------- ----------------------------------
[root@controller ~]# openstack role add --project service --user nova admin #添加admin 角色到 nova 用户,命令没有输出
[root@controller ~]# openstack service create --name nova --description "OpenStack Compute" compute #创建nova 服务实体
------------- ----------------------------------
| Field | Value |
------------- ----------------------------------
| description | OpenStack Compute |
| enabled | True |
| id | 9ced96bbfda44296aba0311fbc52f68e |
| name | nova |
| type | compute |
------------- ----------------------------------
创建计算服务API端点
[root@controller ~]# openstack endpoint create --region RegionOne compute public http://controller:8774/v2/%(tenant_id)s
-------------- -----------------------------------------
| Field | Value |
-------------- -----------------------------------------
| enabled | True |
| id | 02b501d9270345fe887165c35c9ee9b2 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 9ced96bbfda44296aba0311fbc52f68e |
| service_name | nova |
| service_type | compute |
| url | http://controller:8774/v2/%(tenant_id)s |
-------------- -----------------------------------------
[root@controller ~]# openstack endpoint create --region RegionOne compute internal http://controller:8774/v2/%(tenant_id)s
-------------- -----------------------------------------
| Field | Value |
-------------- -----------------------------------------
| enabled | True |
| id | 886844dc06d84b838e623f6d3939818c |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 9ced96bbfda44296aba0311fbc52f68e |
| service_name | nova |
| service_type | compute |
| url | http://controller:8774/v2/%(tenant_id)s |
-------------- -----------------------------------------
[root@controller ~]# openstack endpoint create --region RegionOne compute admin http://controller:8774/v2/%(tenant_id)s
-------------- -----------------------------------------
| Field | Value |
-------------- -----------------------------------------
| enabled | True |
| id | b72dc761e3004e398277d90441ee2cc3 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 9ced96bbfda44296aba0311fbc52f68e |
| service_name | nova |
| service_type | compute |
| url | http://controller:8774/v2/%(tenant_id)s |
-------------- -----------------------------------------