安装控制节点controller
注:这里使用的源均为内部源,外界无法获取,大家可以搭建阿里源或者其它源来进行操作
环境:
控制节点:192.168.1.13 chen1
计算节点:192.168.1.14 chen2
mysql -uroot -p123
分别建立三个库
MariaDB [(none)]> CREATE DATABASE nova_api;
MariaDB [(none)]> CREATE DATABASE nova;
MariaDB [(none)]> CREATE DATABASE nova_cell0;
之后创建用户并设置权限
GRANT ALL PRIVILEGES ON nova_api.* TO ‘nova’@‘localhost’
IDENTIFIED BY ‘123’;
GRANT ALL PRIVILEGES ON nova_api.* TO ‘nova’@’%’
IDENTIFIED BY ‘123’;
GRANT ALL PRIVILEGES ON nova.* TO ‘nova’@‘localhost’
IDENTIFIED BY ‘123’;
GRANT ALL PRIVILEGES ON nova.* TO ‘nova’@’%’
IDENTIFIED BY ‘123’;
GRANT ALL PRIVILEGES ON nova_cell0.* TO ‘nova’@‘localhost’
IDENTIFIED BY ‘123’;
GRANT ALL PRIVILEGES ON nova_cell0.* TO ‘nova’@’%’
IDENTIFIED BY ‘123’;
退出数据库,创建nova用户
openstack user create --domain default --password=nova nova
[root@chen1 ~]# openstack user create --domain default --password=nova nova
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | fd6d7fea522c4a7486f53b108d08ca0f |
| name | nova |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+
将nova用户添加为管理员
openstack role add --project service --user nova admin
创建名为nova的project。
openstack service create --name nova
–description “OpenStack Compute” compute
[root@chen1 ~]# openstack service create --name nova \
> --description "OpenStack Compute" compute
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Compute |
| enabled | True |
| id | 98fd205a476c4d7d8dcf2668b9da5692 |
| name | nova |
| type | compute |
+-------------+----------------------------------+
创建服务端点
openstack endpoint create --region RegionOne
compute public http://chen1:8774/v2.1
[root@chen1 ~]# openstack endpoint create --region RegionOne \
> compute public http://chen1r:8774/v2.1
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 00702893077243aea42b7d02c3d23560 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 98fd205a476c4d7d8dcf2668b9da5692 |
| service_name | nova |
| service_type | compute |
| url | http://chen1:8774/v2.1 |
+--------------+----------------------------------+
openstack endpoint create --region RegionOne
compute internal http://chen1:8774/v2.1
[root@chen1 ~]# openstack endpoint create --region RegionOne \
> compute internal http://chen1:8774/v2.1
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 6a11cd392517402e85590259016f7869 |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 98fd205a476c4d7d8dcf2668b9da5692 |
| service_name | nova |
| service_type | compute |
| url | http://chen1:8774/v2.1 |
+---