(2).创建Cinder数据库:
[root@openstack ~]# openstack-db --init --service cinder --rootpw passwd
cinder default DB is not mysql. Would you like to reset to mysql now? (y/n): y
Verified connectivity to MySQL.
Creating 'cinder' database.
Initializing the cinder database, please wait...
/usr/lib64/python2.6/site-packages/Crypto/Util/number.py:57: PowmInsecureWarning: Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.
_warn("Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.", PowmInsecureWarning)
Complete!
上述warning不影响数据库创建,也可以使用:
[root@openstack ~]# su -s /bin/sh -c "cinder-manage db sync" cinder
创建cinder数据库。
9.2.创建User,定义Services 和 API Endpoints
(1).为cinder创建一个cinder用户:
[root@openstack ~]# keystone user-create --name=cinder --pass=service --email=cinder@chensh.net
WARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored).
+----------+----------------------------------+
| Property | Value |
+----------+----------------------------------+
| email | cinder@chensh.net |
| enabled | True |
| id | f67dd31740ca4d0bbca4f673ffff85b0 |
| name | cinder |
| username | cinder |
+----------+----------------------------------+
[root@openstack ~]# keystone user-role-add --user=cinder --tenant=service --role=admin
WARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored).
(2).创建cinder服务,创建endpoint:
[root@openstack ~]# vi /root/config/cinder-user.sh
#!/bin/sh
my_ip=0.0.0.0
keystone service-create --name=cinder --type=volume --description="OpenStack Block Storage"
service=$(keystone service-list | awk '/volume/ {print $2}')
keystone endpoint-create --service-id=$service --publicurl=http://$my_ip:8776/v1/%\(tenant_id\)s --internalurl=http://$my_ip:8776/v1/%\(tenant_id\)s --adminurl=http://$my_ip:8776/v1/%\(tenant_id\)s
keystone service-create --name=cinder --type=volumev2 --description="OpenStack Block Storage V2"
service=$(keystone service-list | awk '/volumev2/ {print $2}')
keystone endpoint-create --service-id=$service --publicurl=http://$my_ip:8776/v2/%\(tenant_id\)s --internalurl=http://$my_ip:8776/v2/%\(tenant_id\)s --adminurl=http://$my_ip:8776/v2/%\(tenant_id\)s
[root@openstack ~]# sh /root/config/cinder-user.sh
WARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored).
+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| description | OpenStack Block Storage |
| enabled | True |
| id | f4f8a1e3ea104a689e6e11da53ed239d |
| name | cinder |
| type | volume |
+-------------+----------------------------------+
WARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored).
+-------------+--------------------------------------+
| Property | Value |
+-------------+--------------------------------------+
| adminurl | http://0.0.0.0:8776/v1/%(tenant_id)s |
| id | 6027a4a61f7f4acba13e52544ca53acb |
| internalurl | http://0.0.0.0:8776/v1/%(tenant_id)s |
| publicurl | http://0.0.0.0:8776/v1/%(tenant_id)s |
| region | regionOne |
| service_id | f4f8a1e3ea104a689e6e11da53ed239d |
+-------------+--------------------------------------+
WARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored).
+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| description | OpenStack Block Storage V2 |
| enabled | True |
| id | 5022d74ed60b4a79b0acef9e71e2fd9d |
| name | cinder |
| type | volumev2 |
+-------------+----------------------------------+
WARNING: Bypassing authentication using a token & endpoint (authentication credentials are being ignored).
+-------------+--------------------------------------+
| Property | Value |
+-------------+--------------------------------------+
| adminurl | http://0.0.0.0:8776/v2/%(tenant_id)s |
| id | ddd42956b4e14e4abb427fdcb3e31b61 |
| internalurl | http://0.0.0.0:8776/v2/%(tenant_id)s |
| publicurl | http://0.0.0.0:8776/v2/%(tenant_id)s |
| region | regionOne |
| service_id | 5022d74ed60b4a79b0acef9e71e2fd9d |
+-------------+--------------------------------------+