手机版
你好,游客 登录 注册
背景:
阅读新闻

在Ubuntu 14.04上部署OpenStack Juno

[日期:2015-12-13] 来源:www.renhl.com  作者:任怀林 [字体:大 中 小]

13 启用EC2兼容API

请在控制节点上运行下面的命令

$ source admin-openrc.sh

1 创建EC2的服务

# keystone service-create --name=ec2 \
                        --type=ec2 \
                        --description="EC2 Compatibility Layer"

+-------------+----------------------------------+
|   Property  |              Value               |
+-------------+----------------------------------+
| description |     EC2 Compatibility Layer      |
|   enabled   |               True               |
|      id     | a18a1b887b484ed6a1130174ccb8eb5f |
|     name    |               ec2                |
|     type    |               ec2                |
+-------------+----------------------------------+

2 创建EC2 API端点

# keystone endpoint-create --region regionOne --service-id  $(keystone service-list | awk '/ ec2 / {print $2}') \
        --publicurl "http://$CONTROLLER_PUBLIC_ADDRESS:8773/services/Cloud" \
        --adminurl "http://$CONTROLLER_ADMIN_ADDRESS:8773/services/Admin" \
        --internalurl "http://$CONTROLLER_INTERNAL_ADDRESS:8773/services/Cloud"
+-------------+--------------------------------------------+
|   Property  |                   Value                    |
+-------------+--------------------------------------------+
|   adminurl  |   http://controller:8773/services/Admin    |
|      id     |      b903c22bab8d412b96ff6839f5131f24      |
| internalurl |   http://controller:8773/services/Cloud    |
|  publicurl  | http://192.168.234.202:8773/services/Cloud |
|    region   |                 RegionOne                  |
|  service_id |      a18a1b887b484ed6a1130174ccb8eb5f      |
+-------------+--------------------------------------------+

$EC2SERVICE就是上一条命令创建的a18a1b887b484ed6a1130174ccb8eb5f
本文中$CONTROLLER
PUBLICADDRESS为:192.168.234.202,$CONTROLLERADMIN_ADDRESS为:10.0.0.11

重启服务

# service nova-cert restart
# service nova-api restart

3 验证安装

首先要为用户生成AK(access key)和SK(secret key),我们来为demo这个用户来生成AK和SK.

$ keystone tenant-list
+----------------------------------+---------+---------+
|                id                |   name  | enabled |
+----------------------------------+---------+---------+
| 357abecb4def441eb7a36e7cf5d173c4 |  admin  |   True  |
| 6245a74d882e451c8d7663a46103b8b2 |   demo  |   True  |
| 0357b13cb33941bda442094eda169625 |   lxl   |   True  |
| ef36de18149b4c809c4b26b63b6dda37 | service |   True  |
| 04015ed1fdb94efb80bab7916fbf1660 |   zlq   |   True  |
+----------------------------------+---------+---------+

$ keystone user-list
+----------------------------------+-----------------------------+---------+-----------------------------+
|                id                |             name            | enabled |            email            |
+----------------------------------+-----------------------------+---------+-----------------------------+
| c2ba205513e448098f0e0daf80f2f649 |            admin            |   True  |      admin@example.com      |
| d839485477e44aa8baabbefd19829392 |          ceilometer         |   True  |                             |
| fd7b1e90d1144b669d20040b9c334d88 |            cinder           |   True  |                             |
| 54a55d3f3c1f4797bb82d196e6c02ccd |             demo            |   True  |       demo@example.com      |
| 924b65933a294f0bb5e26945689c2c38 |            glance           |   True  |                             |
| 0c138994a2304fe5b38eb2a709d6e3fd | liqiang.zhang@ecloud.com.cn |   True  | liqiang.zhang@ecloud.com.cn |
| f0d885f2c2e9498189b61ebb28475f35 |             lxl             |   True  |      xiaoreqing@126.com     |
| d9ea6a6733934f139a42dfad12f1009a |           neutron           |   True  |                             |
| 952eae64d8124b06812a5bb595f3690f |             nova            |   True  |                             |
+----------------------------------+-----------------------------+---------+-----------------------------+


$ keystone ec2-credentials-create --tenant-id=357abecb4def441eb7a36e7cf5d173c4 --user-id=c2ba205513e448098f0e0daf80f2f649
+-----------+----------------------------------+
|  Property |              Value               |
+-----------+----------------------------------+
|   access  | 6ccf7c40bebe4984964e1ada23680941 |
|   secret  | 6cdaaa769e3c4fb58aeac0de49b01658 |
| tenant_id | 357abecb4def441eb7a36e7cf5d173c4 |
|  trust_id |                                  |
|  user_id  | c2ba205513e448098f0e0daf80f2f649 |
+-----------+----------------------------------+

把下面的变量加入admin-openrc.sh

export EC2_ACCESS_KEY=6ccf7c40bebe4984964e1ada23680941
export EC2_SECRET_KEY=6cdaaa769e3c4fb58aeac0de49b01658
export EC2_URL=http://controller:8773/services/Cloud

参考:  https://github.com/openstack/keystone/blob/master/tools/sample_data.sh
https://github.com/gc3-uzh-ch/gridka-school/blob/master/tutorial/nova_api.rst

更多Ubuntu相关信息见Ubuntu 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=2

本文永久更新链接地址:http://www.linuxidc.com/Linux/2015-12/126219.htm

linux
相关资讯       OpenStack  OpenStack Juno 
本文评论   查看全部评论 (0)
表情: 表情 姓名: 字数

       

评论声明
  • 尊重网上道德,遵守中华人民共和国的各项有关法律法规
  • 承担一切因您的行为而直接或间接导致的民事或刑事法律责任
  • 本站管理人员有权保留或删除其管辖留言中的任意内容
  • 本站有权在网站内转载或引用您的评论
  • 参与本评论即表明您已经阅读并接受上述条款