การติดตั้ง OpenStack Mitaka ด้วย VirtualBox บน Notebook ที่มี Ram 8 GB (Part 4) 1

Blog ก่อนหน้า Part 3

1. ติดตั้ง keystone

บน controller

$ /bin/bash ./exe-stage08-USER-keystone-database.sh
$ sudo /bin/bash ./exe-stage09-SUDO-keystone.sh
$

เมื่อเรียกใช้ script นี้จะได้ print out ต่อไปนี้

$ /bin/bash ./exe-stage10-USER-service-endpoints.sh
/home/openstack/OPSInstaller/controller
Run this script as a user.
* create Identity service and endpoint...press
ผลของคำสั่ง: 
openstack service create \
  --name keystone --description "OpenStack Identity" identity
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Identity               |
| enabled     | True                             |
| id          | f539c17fea9f4180832afc8e3eb832d2 |
| name        | keystone                         |
| type        | identity                         |
+-------------+----------------------------------+
ผลของคำสั่ง: 
openstack endpoint create --region RegionOne \
  identity public http://controller:5000/v3
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 03231cba77dd487eb7523aa2f43eb2cb |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | f539c17fea9f4180832afc8e3eb832d2 |
| service_name | keystone                         |
| service_type | identity                         |
| url          | http://controller:5000/v3        |
+--------------+----------------------------------+
ผลของคำสั่ง: 
openstack endpoint create --region RegionOne \
  identity internal http://controller:5000/v3
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | d84d5d147bbb45dcb69d761bb4074eb9 |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | f539c17fea9f4180832afc8e3eb832d2 |
| service_name | keystone                         |
| service_type | identity                         |
| url          | http://controller:5000/v3        |
+--------------+----------------------------------+
ผลของคำสั่ง: 
openstack endpoint create --region RegionOne \
  identity admin http://controller:35357/v3
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 1c1d3c5376794fcfaef5281899b1463d |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | f539c17fea9f4180832afc8e3eb832d2 |
| service_name | keystone                         |
| service_type | identity                         |
| url          | http://controller:35357/v3       |
+--------------+----------------------------------+
* create Admin projects, users, and roles...press
ผลของคำสั่ง: 
openstack domain create --description "Default Domain" default
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | Default Domain                   |
| enabled     | True                             |
| id          | 2e8193a1dc3044429f0c953d96f49b4e |
| name        | default                          |
+-------------+----------------------------------+
ผลของคำสั่ง: 
openstack project create --domain default --description "Admin Project" admin
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | Admin Project                    |
| domain_id   | 2e8193a1dc3044429f0c953d96f49b4e |
| enabled     | True                             |
| id          | 1247ca30e71e41bab8579ee626dabc93 |
| is_domain   | False                            |
| name        | admin                            |
| parent_id   | 2e8193a1dc3044429f0c953d96f49b4e |
+-------------+----------------------------------+
ผลของคำสั่ง: 
openstack user create --domain default --password adminpassword admin
+-----------+----------------------------------+
| Field     | Value                            |
+-----------+----------------------------------+
| domain_id | 2e8193a1dc3044429f0c953d96f49b4e |
| enabled   | True                             |
| id        | 91a50bef1abe4bfdad6f0668234472b4 |
| name      | admin                            |
+-----------+----------------------------------+
ผลของคำสั่ง: 
openstack role create admin
openstack role add --project admin --user admin admin
+-----------+----------------------------------+
| Field     | Value                            |
+-----------+----------------------------------+
| domain_id | None                             |
| id        | 78bea065a4844b1c9b55bbf29077bf9d |
| name      | admin                            |
+-----------+----------------------------------+

3. create Service project...press
ผลของคำสั่ง: 
openstack project create --domain default --description "Service Project" service
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | Service Project                  |
| domain_id   | 2e8193a1dc3044429f0c953d96f49b4e |
| enabled     | True                             |
| id          | 71daf1f8e9154d9790528e67f60b9546 |
| is_domain   | False                            |
| name        | service                          |
| parent_id   | 2e8193a1dc3044429f0c953d96f49b4e |
+-------------+----------------------------------+

4. create Demo project...press
ผลของคำสั่ง: 
openstack project create --domain default --description "Demo Project" demo
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | Demo Project                     |
| domain_id   | 2e8193a1dc3044429f0c953d96f49b4e |
| enabled     | True                             |
| id          | e369f137f311478da2203e161d7a2338 |
| is_domain   | False                            |
| name        | demo                             |
| parent_id   | 2e8193a1dc3044429f0c953d96f49b4e |
+-------------+----------------------------------+
ผลของคำสั่ง:
openstack user create --domain default --password demopassword demo
+-----------+----------------------------------+
| Field     | Value                            |
+-----------+----------------------------------+
| domain_id | 2e8193a1dc3044429f0c953d96f49b4e |
| enabled   | True                             |
| id        | faf3a304ffd845f096ccc4308c93ba13 |
| name      | demo                             |
+-----------+----------------------------------+
ผลของคำสั่ง:
openstack role create user
openstack role add --project demo --user demo user
+-----------+----------------------------------+
| Field     | Value                            |
+-----------+----------------------------------+
| domain_id | None                             |
| id        | 2b130a460fa446b99382132c0ab322bb |
| name      | user                             |
+-----------+----------------------------------+

5. Verify keystone Id Service...get a token by user id... press any key
ผลของคำสั่ง:
openstack --os-auth-url http://controller:35357/v3 \
  --os-project-domain-name default --os-user-domain-name default \
  --os-project-name admin --os-username admin --os-password adminpassword token issue

+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field      | Value                                                                                                                                                                                   |
+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| expires    | 2016-12-20T23:58:08.793450Z                                                                                                                                                             |
| id         | gAAAAABYWbeAgBsAqxLDiZm0BilI8v6STiK0Ct12LztZaFjTFIT-yqAJKVIzTuGmV9Wr3E9TDzUcYwRkOc6Fuz4KLg-qxJW78rfsVCIJdTo_-4w2WGp2TuY7KV63y6Xq4IQz5p7GXoqV8Ug5TEr_D-FSlrUrd_-j-h4rtG9a-zpWUE4fCyHXEy8 |
| project_id | 1247ca30e71e41bab8579ee626dabc93                                                                                                                                                        |
| user_id    | 91a50bef1abe4bfdad6f0668234472b4                                                                                                                                                        |
+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
ผลของคำสั่ง:
openstack --os-auth-url http://controller:5000/v3 \
  --os-project-domain-name default --os-user-domain-name default \
  --os-project-name demo --os-username demo --os-password demopassword token issue
+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field      | Value                                                                                                                                                                                   |
+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| expires    | 2016-12-20T23:58:12.310607Z                                                                                                                                                             |
| id         | gAAAAABYWbeEpR_t3bbW7T1vNu_u9YvfdoALWHmklZoBHPpTGJbvZ8xUqyxvFzLCg1Kj7jI-odwXNQx2uPzxtV1sd_ICE2sJSjiooSEZMTGJw6go1c3cezGMi33RGu_j7BDrOnO2_muYWV2zP1QtMXOmBv07c5ukbA1BPIoSpuk5CKt-aAOHtWA |
| project_id | e369f137f311478da2203e161d7a2338                                                                                                                                                        |
| user_id    | faf3a304ffd845f096ccc4308c93ba13                                                                                                                                                        |
+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
$ 
$ /bin/bash ./exe-stage11-USER-test-envscript.sh
/home/openstack/OPSInstaller/controller
Run this script with sudo or as root.
1. set admin-openrc.sh ..press
ผลของคำสั่ง:
source ./admin-openrc.sh
openstack token issue
+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field      | Value                                                                                                                                                                                   |
+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| expires    | 2016-12-21T00:02:58.629374Z                                                                                                                                                             |
| id         | gAAAAABYWbiikLThN8sT8bmlSTycZTyTJ6e8BrlsAgON6UkeQIKanwPjcMOtJCb9Y_WHPk4PoGAvjdx0tiZnrTDjsTREtxdFv2p_aUSK1RydKZNHkKMadDo01700aACF0E86YSF0JZPHDJMGQJF30yOIb9OHNA6kGM0trt8XVc-b1sHNINOaMhA |
| project_id | 1247ca30e71e41bab8579ee626dabc93                                                                                                                                                        |
| user_id    | 91a50bef1abe4bfdad6f0668234472b4                                                                                                                                                        |
+------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
$

2. ติดตั้ง glance

บน controller

$ /bin/bash ./exe-stage12-USER-glance-database.sh
...
$  
$ /bin/bash ./exe-stage13-USER-glance-endpoints.sh
/home/openstack/OPSInstaller/controller
Run this script as a user.
+-----------+----------------------------------+
| Field     | Value                            |
+-----------+----------------------------------+
| domain_id | 2e8193a1dc3044429f0c953d96f49b4e |
| enabled   | True                             |
| id        | b0b265aabab04f688e273132fe6fe819 |
| name      | glance                           |
+-----------+----------------------------------+
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Image service          |
| enabled     | True                             |
| id          | 68af8fa7ea144c1683db8c921c2cf288 |
| name        | glance                           |
| type        | image                            |
+-------------+----------------------------------+
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | a7b4fb3b8c3b41f795b4629fdc47aa7b |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 68af8fa7ea144c1683db8c921c2cf288 |
| service_name | glance                           |
| service_type | image                            |
| url          | http://controller:9292           |
+--------------+----------------------------------+
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 0aa9fec04ee94338a340918a457e1ae8 |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 68af8fa7ea144c1683db8c921c2cf288 |
| service_name | glance                           |
| service_type | image                            |
| url          | http://controller:9292           |
+--------------+----------------------------------+
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 956a63f49fe3477a9baca1bdff1d5705 |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 68af8fa7ea144c1683db8c921c2cf288 |
| service_name | glance                           |
| service_type | image                            |
| url          | http://controller:9292           |
+--------------+----------------------------------+
$
$ sudo /bin/bash ./exe-stage14-SUDO-glance.sh
...
$  /bin/bash ./exe-stage15-USER-verify-glance.sh
/home/openstack/OPSInstaller/controller
Run this script as a user.
1. get cirros image...pressexport OS_IMAGE_API_VERSION=2
--2016-12-21 06:16:45--  http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
Resolving download.cirros-cloud.net (download.cirros-cloud.net)... 64.90.42.85, 2607:f298:6:a036::bd6:a72a
Connecting to download.cirros-cloud.net (download.cirros-cloud.net)|64.90.42.85|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 13287936 (13M) [text/plain]
Saving to: ‘cirros-0.3.4-x86_64-disk.img’

100%[==================================================>] 13,287,936   283KB/s   in 49s

2016-12-21 06:17:35 (264 KB/s) - ‘cirros-0.3.4-x86_64-disk.img’ saved [13287936/13287936]


2. upload cirros image to glance...press
+------------------+------------------------------------------------------+
| Field            | Value                                                |
+------------------+------------------------------------------------------+
| checksum         | ee1eca47dc88f4879d8a229cc70a07c6                     |
| container_format | bare                                                 |
| created_at       | 2016-12-20T23:17:37Z                                 |
| disk_format      | qcow2                                                |
| file             | /v2/images/91b165af-76f2-4921-b5ea-2e4a8a8e5ed2/file |
| id               | 91b165af-76f2-4921-b5ea-2e4a8a8e5ed2                 |
| min_disk         | 0                                                    |
| min_ram          | 0                                                    |
| name             | cirros-0.3.4-x86_64-disk                             |
| owner            | 1247ca30e71e41bab8579ee626dabc93                     |
| protected        | False                                                |
| schema           | /v2/schemas/image                                    |
| size             | 13287936                                             |
| status           | active                                               |
| tags             |                                                      |
| updated_at       | 2016-12-20T23:17:37Z                                 |
| virtual_size     | None                                                 |
| visibility       | public                                               |
+------------------+------------------------------------------------------+

3. list glnace images and remove cirros file...
+--------------------------------------+--------------------------+--------+
| ID                                   | Name                     | Status |
+--------------------------------------+--------------------------+--------+
| 91b165af-76f2-4921-b5ea-2e4a8a8e5ed2 | cirros-0.3.4-x86_64-disk | active |
+--------------------------------------+--------------------------+--------+
$

อันดับถัดไป ติดตั้ง Nova

One comment on “การติดตั้ง OpenStack Mitaka ด้วย VirtualBox บน Notebook ที่มี Ram 8 GB (Part 4)

  1. Pingback: การติดตั้ง OpenStack Mitaka ด้วย VirtualBox บน Notebook ที่มี Ram 8 GB (Part 5) ← Science Cloud Community

Leave a Reply