设置环境变量,否则你用keyston命令行查询要带很多参数不方便
root@control:~# cat creds
#Paste the following:
export OS_TENANT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=123456
exportOS_AUTH_URL="http://172.16.10.200:5000/v2.0/"
root@control:~# source creds
检查keystone结果
root@control:~# keystone user-list
+----------------------------------+---------+---------+--------------------+
| id | name | enabled | email |
+----------------------------------+---------+---------+--------------------+
| 546b18d85b9a4bf8b548bd08e8ecfe87 | admin | True | admin@domain.com |
| a0dbcb1c75814ab285ea0ddc4a156dd6 | cinder | True | cinder@domain.com |
| 1a860d4cd8244bb3bc19e9cfe8259e60 | demo | True | demo@domain.com |
| 08725b7243854901bb0835be1e3a8c5e | glance | True | glance@domain.com |
| 1dcb939697e04229ae14abe02fce6d6f | nova | True | nova@domain.com |
| 5e447437acc148d88e386989d62da44d |quantum | True | quantum@domain.com |
+----------------------------------+---------+---------+--------------------+
root@control:~# keystone endpoint-list
+----------------------------------+-----------+--------------------------------------------+------------------------------------------+------------------------------------------+----------------------------------+
| id | region | publicurl | internalurl | adminurl | service_id |
+----------------------------------+-----------+--------------------------------------------+------------------------------------------+------------------------------------------+----------------------------------+
| 12eac4b2ed91404f93f2235cbaa446f3 |RegionOne | :9292/ | :9292/ | :9292/ | 1372321775df4b6c9d894d299412acc5 |
| 37c6d6ce5e954f449cac46194ea077d0 |RegionOne | :8776/v1/$(tenant_id)s | :8776/v1/$(tenant_id)s| :8776/v1/$(tenant_id)s | af1af90fcd954faa906b8c567f060d0d |
| 3e9f2ce578e248b5945a099f69141312 |RegionOne | :8773/services/Cloud | :8773/services/Cloud | :8773/services/Admin | 46be108df1084f5e9a2702ecfd517aa3 |
| 5240aec5803b4d7094b66dfa4ecd6c55 |RegionOne | :9696/ | :9696/ | :9696/ | 6e4dacf1c7984a7baa216aeec2e5831d |
| 8128afab6f034d03820704fe8d7fc817 |RegionOne | :5000/v2.0 | :5000/v2.0 | :35357/v2.0 | a68ed6a40998477abc0990bd56dcbd86 |
| 960af7efa1b84a778fb6c40a6015a497 |RegionOne | :8774/v2/$(tenant_id)s |:8774/v2/$(tenant_id)s |:8774/v2/$(tenant_id)s | 117539645e29490f8244d4bfc2ed64bf |
+----------------------------------+-----------+--------------------------------------------+------------------------------------------+------------------------------------------+----------------------------------+
2.7 Glance
安装glance
apt-get install -y glance
更新/etc/glance/glance-api-paste.ini
[filter:authtoken]
paste.filter_factory =keystoneclient.middleware.auth_token:filter_factory
delay_auth_decision = true
auth_host = 10.10.10.51
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = 123456
更新/etc/glance/glance-registry-paste.ini
[filter:authtoken]
paste.filter_factory =keystoneclient.middleware.auth_token:filter_factory
auth_host = 10.10.10.51
auth_port = 35357
auth_protocol = http
admin_tenant_name = service
admin_user = glance
admin_password = 123456
更新/etc/glance/glance-api.conf
sql_connection =mysql://glance:glance@10.10.10.51/glance
[paste_deploy]
flavor = keystone
更新/etc/glance/glance-registry.conf
sql_connection =mysql://glance:glance@10.10.10.51/glance
[paste_deploy]
flavor = keystone
重启glance-api 和 glance-registry 服务
service glance-api restart; serviceglance-registry restart
初始化glance数据库
glance-manage db_sync
下载镜像上传镜像
wgethttps://launchpad.net/cirros/trunk/0.3.0/+download/cirros-0.3.0-x86_64-disk.img
glance image-create --name="CirrOS0.3.1" --disk-format=qcow2 \
--container-format=bare --is-public=true <cirros-0.3.1-x86_64-disk.img
root@control:~# filecirros-0.3.1-i386-disk.img
cirros-0.3.1-i386-disk.img: QEMU QCOW Image(v2), 41126400 bytes
查看镜像
root@control:~# glance image-list
+--------------------------------------+--------------+-------------+------------------+------------+--------+
| ID | Name | Disk Format | Container Format |Size | Status |
+--------------------------------------+--------------+-------------+------------------+------------+--------+
| fe4210d1-783c-4b7b-9cfd-10f02f7d3c20 |cirros 0.3.1 | qcow2 | bare | 12251136 | active |
| 918dd333-2e9d-4ad2-bcce-9c6be9aec81b |debian | vmdk |bare | 464421376 | active |
| 4dd939cc-54ce-4af0-a170-3d6b778e651f |Ubuntu-13.04 | qcow2 | bare | 233504768 | active |
| 43c2bb24-2c4f-4b53-a2da-6ac5fa525dbd |win2003sp2 | qcow2 | bare | 1822621696 | active |
+--------------------------------------+--------------+-------------+------------------+------------+--------+
注:关于镜像,可以自己在网上下载,也可以自己制作,还可以从其他虚拟化平台导入:比如vSphere的ovf模板,附件有制作windows镜像文档及导入vmware ovf模板文档。