next up previous contents
Next: 安裝 Openstack-Quantum Up: Quantum 網路服務 Previous: 認識 Openstack Networking   Contents

建立 Openstack-Quantum 用戶

  1. 開始網路服務架設與設定前,請先安裝 kernel-2.6.32-358.114.1.openstack,否則網路會有很多問題。
    [root@kvm4 ~]# vim /etc/yum.repo.d/openstack.repo 
    [openstack]
    name=OpenStack
    baseurl=http://dywang.csie.cyut.edu.tw/OpenStack
    gpgcheck=0
    enabled=1
    
    [root@kvm4 ~]# yum install -y kernel iproute --enablerepo=openstack 
    [root@kvm4 ~]# reboot
    
  2. 載入管理者環境變數。
    [root@kvm4 ~]# source keystonerc_admin 
    [root@kvm4 ~(keystone_admin)]#
    
  3. 在 keystone 產生名稱為 quantum 的網路服務,並記下其 id,以建立此服務的 endpoint。
    [root@kvm4 ~(keystone_admin)]# keystone service-create \
    --name quantum \
    --type network \
    --description 'Openstack Networking Service'
    +-------------+----------------------------------+
    |   Property  |              Value               |
    +-------------+----------------------------------+
    | description |   Openstack Networking Service   |
    |      id     | eeac3353b8a44562b2695721e271aece |
    |     name    |             quantum              |
    |     type    |             network              |
    +-------------+----------------------------------+
    
  4. 建立 quantum 的 endpoint。
    [root@kvm4 ~(keystone_admin)]# keystone endpoint-create \
    --service-id eeac3353b8a44562b2695721e271aece \
    --publicurl http://kvm4.deyu.wang:9696 \
    --adminurl http://kvm4.deyu.wang:9696 \
    --internalurl http://kvm4.deyu.wang:9696
    +-------------+----------------------------------+
    |   Property  |              Value               |
    +-------------+----------------------------------+
    |   adminurl  |    http://kvm4.deyu.wang:9696    |
    |      id     | b86b7c0c90d1445d96c5b1bbc54f6c9c |
    | internalurl |    http://kvm4.deyu.wang:9696    |
    |  publicurl  |    http://kvm4.deyu.wang:9696    |
    |    region   |            regionOne             |
    |  service_id | eeac3353b8a44562b2695721e271aece |
    +-------------+----------------------------------+
    
  5. 產生網路服務用戶,名稱 quantum,密碼 123qwe。
    [root@kvm4 ~(keystone_admin)]# keystone user-create \
    --name quantum --pass 123qwe
    +----------+----------------------------------+
    | Property |              Value               |
    +----------+----------------------------------+
    |  email   |                                  |
    | enabled  |               True               |
    |    id    | 3ba95de7669c4979acbe7b5b6eb4f651 |
    |   name   |             quantum              |
    | tenantId |                                  |
    +----------+----------------------------------+
    
  6. 設定用戶 quantum 在租戶 services 的角色為 admin。
    [root@kvm4 ~(keystone_admin)]# keystone user-role-add \
    --user quantum --role admin --tenant services
    
  7. 列出用戶角色,發現 user_id 並不是 quantum,原因是目前的環境變數為 admin。
    [root@kvm4 ~(keystone_admin)]# keystone user-role-list 
    +----------------------------------+-------+----------------------------------+----------------------------------+
    |                id                |  name |             user_id              |            tenant_id             |
    +----------------------------------+-------+----------------------------------+----------------------------------+
    | 91f1e2429c614bac8efe19cef39e8e7d | admin | 14613b36f501472abd93caa822477e90 | a57da7d8a5f944c9b6258d0d91b8dee2 |
    +----------------------------------+-------+----------------------------------+----------------------------------+
    
  8. 使用 quantum 環境變數列出角色,比對 user_id ,這才是 quantum 的角色。
    [root@kvm4 ~(keystone_admin)]# keystone --os-username quantum \
    --os-password 123qwe \
    --os-tenant-name services user-role-list 
    +----------------------------------+-------+----------------------------------+----------------------------------+
    |                id                |  name |             user_id              |            tenant_id             |
    +----------------------------------+-------+----------------------------------+----------------------------------+
    | 91f1e2429c614bac8efe19cef39e8e7d | admin | 3ba95de7669c4979acbe7b5b6eb4f651 | da7fe21aa92743f9baa51fd4368e6726 |
    +----------------------------------+-------+----------------------------------+----------------------------------+
    



2015-12-29