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

Blog ก่อนหน้า Part 5

ใน Blog นี้เราจะแสดงการติดตั้ง openstack neutron และ horizon และ configure neutron ให้เป็นแบบ Distributed Virtual Router (DVR)

1. ตืดตั้ง nuetron database และ endpoint

บน controller:
รัน stage 21 และ 22 เพื่อสร้าง neutron database และ endpoints

$ $ pwd
/home/openstack/OPSInstaller/controller
$
$ /bin/bash ./exe-stage21-USER-neutron-database.sh
/home/openstack/OPSInstaller/controller
Run this script as a user.

1. create neutron database...press
$
$ /bin/bash ./exe-stage22-USER-neutron-endpoints.sh
/home/openstack/OPSInstaller/controller
Run this script as a user.

1. create neutron endpoints...press
+-----------+----------------------------------+
| Field     | Value                            |
+-----------+----------------------------------+
| domain_id | 2e8193a1dc3044429f0c953d96f49b4e |
| enabled   | True                             |
| id        | 11b735b73cff48bb9fd9ecb22bc5b621 |
| name      | neutron                          |
+-----------+----------------------------------+
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Networking             |
| enabled     | True                             |
| id          | 9b8840afe6944ea684c662352ab6083b |
| name        | neutron                          |
| type        | network                          |
+-------------+----------------------------------+
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 24a1e6be14944f5eb765e92a10468a9a |
| interface    | public                           |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 9b8840afe6944ea684c662352ab6083b |
| service_name | neutron                          |
| service_type | network                          |
| url          | http://controller:9696           |
+--------------+----------------------------------+
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | 01627839a5af43a995d9be09310d5376 |
| interface    | internal                         |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 9b8840afe6944ea684c662352ab6083b |
| service_name | neutron                          |
| service_type | network                          |
| url          | http://controller:9696           |
+--------------+----------------------------------+
+--------------+----------------------------------+
| Field        | Value                            |
+--------------+----------------------------------+
| enabled      | True                             |
| id           | eb02f286a1c54d429c413399c4e8c22f |
| interface    | admin                            |
| region       | RegionOne                        |
| region_id    | RegionOne                        |
| service_id   | 9b8840afe6944ea684c662352ab6083b |
| service_name | neutron                          |
| service_type | network                          |
| url          | http://controller:9696           |
+--------------+----------------------------------+
$

2. ติดตั้ง neutron server บน controller
บน controller:
รัน stage 23

$ sudo /bin/bash ./exe-stage23-SUDO-neutron.sh
...
nova-api stop/waiting
nova-api start/running, process 3512
neutron-server stop/waiting
neutron-server start/running, process 3530
$
$ /bin/bash ./exe-stage24-USER-verify-neutron.sh
/home/openstack/OPSInstaller/controller
Run this script as a user.
1. verify neutron
+---------------------------+-----------------------------------------------+
| alias                     | name                                          |
+---------------------------+-----------------------------------------------+
| default-subnetpools       | Default Subnetpools                           |
| network-ip-availability   | Network IP Availability                       |
| network_availability_zone | Network Availability Zone                     |
| auto-allocated-topology   | Auto Allocated Topology Services              |
| ext-gw-mode               | Neutron L3 Configurable external gateway mode |
| binding                   | Port Binding                                  |
| agent                     | agent                                         |
| subnet_allocation         | Subnet Allocation                             |
| l3_agent_scheduler        | L3 Agent Scheduler                            |
| tag                       | Tag support                                   |
| external-net              | Neutron external network                      |
| net-mtu                   | Network MTU                                   |
| availability_zone         | Availability Zone                             |
| quotas                    | Quota management support                      |
| l3-ha                     | HA Router extension                           |
| provider                  | Provider Network                              |
| multi-provider            | Multi Provider Network                        |
| address-scope             | Address scope                                 |
| extraroute                | Neutron Extra Route                           |
| timestamp_core            | Time Stamp Fields addition for core resources |
| router                    | Neutron L3 Router                             |
| extra_dhcp_opt            | Neutron Extra DHCP opts                       |
| security-group            | security-group                                |
| dhcp_agent_scheduler      | DHCP Agent Scheduler                          |
| router_availability_zone  | Router Availability Zone                      |
| rbac-policies             | RBAC Policies                                 |
| standard-attr-description | standard-attr-description                     |
| port-security             | Port Security                                 |
| allowed-address-pairs     | Allowed Address Pairs                         |
| dvr                       | Distributed Virtual Router                    |
+---------------------------+-----------------------------------------------+
$

3. ติดตั้ง neutron บนเครื่อง network

บน network:

$ ssh 10.0.0.21
password:
...
$ pwd
/home/openstack/OPSInstaller/network
$ ls
clearlog.sh
exe-stage00-SUDO-update.sh
exe-stage02-SUDO-network-preinstall.sh
exe-stage05-SUDO-network-mysql.sh
exe-stage25-SUDO-network-neutron.sh
exe-stage27-SUDO-ovs-service.sh
exe-stage34-SUDO-dvr-network-conf.sh
exe-stage40-SUDO-odl-purge-neutron-ovs-plugin-network.sh
exe-stage43-SUDO-odl-set-ovs-manager-network.sh
exe-stage46-SUDO-set-ext-network.sh
exe-stage48-SUDO-odl-copy-ml2-network.sh
exe-stage51-SUDO-odl-set-l3-network.sh
exe-stage54p2-SUDO-odl-restart-network.sh
exe-stageFIN-SUDO-postinstall.sh
files
header.txt
log
restart.txt
Temp
$
$ sudo /bin/bash ./exe-stage25-SUDO-network-neutron.sh
...
$ exit

4. รัน stage 26 บนเครื่อง controller

บนเครื่อง controller

$ sudo /bin/bash ./exe-stage26-SUDO-reconfig-neutron-nova.sh
/home/openstack/OPSInstaller/controller
Run this script with sudo or as root.
* reconfig nova...pressnova-api stop/waiting
nova-api start/running, process 7802
$

5. กลับไปติดตั้ง openvswitch ที่เครื่อง network

บนเครื่อง network:

$ ssh 10.0.0.21
password: 
...
$ cd /home/openstack/OPSInstaller/network
$
$ sudo /bin/bash ./exe-stage27-SUDO-ovs-service.sh
/home/openstack/OPSInstaller/network
Run with sudo or as root.
1. configure openvswitch service.. press
2. restart neutron agents.. press
openvswitch-switch stop/waiting
openvswitch-switch start/running
neutron-openvswitch-agent stop/waiting
neutron-openvswitch-agent start/running, process 4412
neutron-l3-agent stop/waiting
neutron-l3-agent start/running, process 4540
neutron-dhcp-agent stop/waiting
neutron-dhcp-agent start/running, process 4564
neutron-metadata-agent stop/waiting
neutron-metadata-agent start/running, process 4609
$
$ exit

6. กลับไปที่เครื่อง controller และรัน stage 28

บนเครื่อง controller:

$ pwd
/home/openstack/OPSInstaller/controller
$ /bin/bash ./exe-stage28-USER-verify-neutron2.sh
/home/openstack/OPSInstaller/controller
Run this script as a user.
+--------------------------------------+--------------------+---------+-------------------+-------+----------------+---------------------------+
| id                                   | agent_type         | host    | availability_zone | alive | admin_state_up | binary                    |
+--------------------------------------+--------------------+---------+-------------------+-------+----------------+---------------------------+
| 37704a87-d668-461b-96b0-48cc556ef7c1 | DHCP agent         | network | nova              | :-)   | True           | neutron-dhcp-agent        |
| da560a59-6e84-4d22-87a2-552eea6d589c | Open vSwitch agent | network |                   | :-)   | True           | neutron-openvswitch-agent |
| e7267760-599a-4d22-8ceb-9d7873bace73 | Metadata agent     | network |                   | :-)   | True           | neutron-metadata-agent    |
| f421918a-bc97-4946-935c-1195f506fe44 | L3 agent           | network | nova              | :-)   | True           | neutron-l3-agent          |
+--------------------------------------+--------------------+---------+-------------------+-------+----------------+---------------------------+
$

7. ssh ไปที่เครื่อง compute และรัน stage 29 เพื่อติดตั้ง neutron บนนั้น

บนเครื่อง compute:

$ ssh 10.0.0.31
password: 
...
$ ls
OPSInstaller  OPSInstaller.tar
$ cd OPSInstaller/compute/
$ ls
clearlog.sh
exe-stage00-SUDO-update.sh
exe-stage03-SUDO-compute-preinstall.sh
exe-stage06-SUDO-compute-mysql.sh
exe-stage19-SUDO-nova-compute.sh
exe-stage29-SUDO-compute-neutron.sh
exe-stage35-SUDO-dvr-compute-conf.sh
exe-stage41-SUDO-odl-purge-neutron-ovs-plugin-compute.sh
exe-stage44-SUDO-odl-set-ovs-manager-compute.sh
exe-stage49-SUDO-odl-copy-ml2-compute.sh
exe-stageFIN-SUDO-postinstall.sh
files
header.txt
log
Temp
$
$ sudo /bin/bash ./exe-stage29-SUDO-compute-neutron.sh
...
openvswitch-switch stop/waiting
openvswitch-switch start/running
stop: Unknown instance:
nova-compute start/running, process 3326
neutron-openvswitch-agent stop/waiting
neutron-openvswitch-agent start/running, process 3339
$
$ exit

8. กลับไปที่เครื่อง controller และรัน stage 30

บนเครื่อง controller:

$ /bin/bash ./exe-stage30-USER-verify-neutron3.sh
/home/openstack/OPSInstaller/controller
Run this script as a user.
+--------------------------------------+--------------------+---------+-------------------+-------+----------------+---------------------------+
| id                                   | agent_type         | host    | availability_zone | alive | admin_state_up | binary                    |
+--------------------------------------+--------------------+---------+-------------------+-------+----------------+---------------------------+
| 37704a87-d668-461b-96b0-48cc556ef7c1 | DHCP agent         | network | nova              | :-)   | True           | neutron-dhcp-agent        |
| 4359e27a-8fa2-496a-9236-26038e215570 | Open vSwitch agent | compute |                   | :-)   | True           | neutron-openvswitch-agent |
| da560a59-6e84-4d22-87a2-552eea6d589c | Open vSwitch agent | network |                   | :-)   | True           | neutron-openvswitch-agent |
| e7267760-599a-4d22-8ceb-9d7873bace73 | Metadata agent     | network |                   | :-)   | True           | neutron-metadata-agent    |
| f421918a-bc97-4946-935c-1195f506fe44 | L3 agent           | network | nova              | :-)   | True           | neutron-l3-agent          |
+--------------------------------------+--------------------+---------+-------------------+-------+----------------+---------------------------+
$

ถัดจากนี้ขอให้ข้าม stage 31 ไปก่อนเพราะเราจะติดตั้ง network แบบ DVR เลย ดังนั้นผมจะติดตั้ง hoeizon web interface ด้วย stage 32 แล้วติดตั้ง DVR ด้วย script 33 บน controller ตามด้วย stage 34 บน network แล้วต่อด้วย stage 35 บนเครื่อง compute และกลับมาที่เครื่อง controller รัน stage 37 และตามด้วย stage 31 เพื่อสร้าง network สำหรับทดสอบระบบ

8. บนเครื่อง controller และรัน stage 32 ติดตั้ง horizon

บนเครื่อง controller:

$ sudo /bin/bash ./exe-stage32-SUDO-horizon.sh
...
$

9. กำหนดให้ neutron เป็น DVR (stage 33 stage 34 stage 35)

บนเครื่อง controller:

$ sudo /bin/bash ./exe-stage33-SUDO-dvr-controller-conf.sh
/home/openstack/OPSInstaller/controller
Run this script with sudo or as root.
neutron-server stop/waiting
neutron-server start/running, process 9643
$

บนเครื่อง network:

$ ssh 10.0.0.21
password:
$ cd OPSInstaller/network
$ sudo /bin/bash ./exe-stage34-SUDO-dvr-network-conf.sh
/home/openstack/OPSInstaller/network
Run with sudo or as root.
1. configure openvswitch service.. press
2. restart neutron agents.. press
openvswitch-switch stop/waiting
openvswitch-switch start/running
neutron-openvswitch-agent stop/waiting
neutron-openvswitch-agent start/running, process 12062
neutron-l3-agent stop/waiting
neutron-l3-agent start/running, process 12282
neutron-dhcp-agent stop/waiting
neutron-dhcp-agent start/running, process 12546
neutron-metadata-agent stop/waiting
neutron-metadata-agent start/running, process 12613
$
$ exit

บนเครื่อง compute:

$ ssh 10.0.0.31
password:
$ cd OPSInstaller/compute
$ sudo /bin/bash ./exe-stage35-SUDO-dvr-compute-conf.sh
....
neutron-l3-agent start/running, process 11187
Processing triggers for libc-bin (2.19-0ubuntu6.9) ...
Processing triggers for ureadahead (0.100.0-16) ...
openvswitch-switch stop/waiting
openvswitch-switch start/running
neutron-openvswitch-agent stop/waiting
neutron-openvswitch-agent start/running, process 11463
neutron-l3-agent stop/waiting
neutron-l3-agent start/running, process 11798
neutron-metadata-agent stop/waiting
neutron-metadata-agent start/running, process 11845
$
$ exit

. บนเครื่อง controller รัน stage 37 เพื่อเช็ค agent status และ stage 31 ทดสอบและสร้าง network เริ่มต้น

บนเครื่อง controller:

$ /bin/bash ./exe-stage37-USER-verify-dvr-network.sh
/home/openstack/OPSInstaller/controller
Run this script as a user.
+--------------------------------------+--------------------+---------+-------------------+-------+----------------+---------------------------+
| id                                   | agent_type         | host    | availability_zone | alive | admin_state_up | binary                    |
+--------------------------------------+--------------------+---------+-------------------+-------+----------------+---------------------------+
| 37704a87-d668-461b-96b0-48cc556ef7c1 | DHCP agent         | network | nova              | :-)   | True           | neutron-dhcp-agent        |
| 4359e27a-8fa2-496a-9236-26038e215570 | Open vSwitch agent | compute |                   | :-)   | True           | neutron-openvswitch-agent |
| 8842d747-b7d0-42e4-b5d4-a5f1f0f94595 | L3 agent           | compute | nova              | :-)   | True           | neutron-l3-agent          |
| 9cbd0dd3-9483-4f21-adbd-83145ab70fca | Metadata agent     | compute |                   | :-)   | True           | neutron-metadata-agent    |
| da560a59-6e84-4d22-87a2-552eea6d589c | Open vSwitch agent | network |                   | :-)   | True           | neutron-openvswitch-agent |
| e7267760-599a-4d22-8ceb-9d7873bace73 | Metadata agent     | network |                   | :-)   | True           | neutron-metadata-agent    |
| f421918a-bc97-4946-935c-1195f506fe44 | L3 agent           | network | nova              | :-)   | True           | neutron-l3-agent          |
+--------------------------------------+--------------------+---------+-------------------+-------+----------------+---------------------------+
$
$ /bin/bash ./exe-stage31-USER-initial-network.sh
/home/openstack/OPSInstaller/controller
Run this script as a user.
Created a new network:
+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| admin_state_up            | True                                 |
| availability_zone_hints   |                                      |
| availability_zones        |                                      |
| created_at                | 2016-12-22T19:32:29                  |
| description               |                                      |
| id                        | b986c3a9-8267-481d-9ee5-6da40b8ba8d8 |
| ipv4_address_scope        |                                      |
| ipv6_address_scope        |                                      |
| is_default                | False                                |
| mtu                       | 1500                                 |
| name                      | ext-net                              |
| port_security_enabled     | True                                 |
| provider:network_type     | flat                                 |
| provider:physical_network | external                             |
| provider:segmentation_id  |                                      |
| router:external           | True                                 |
| shared                    | False                                |
| status                    | ACTIVE                               |
| subnets                   |                                      |
| tags                      |                                      |
| tenant_id                 | 1247ca30e71e41bab8579ee626dabc93     |
| updated_at                | 2016-12-22T19:32:29                  |
+---------------------------+--------------------------------------+
Created a new subnet:
+-------------------+----------------------------------------------+
| Field             | Value                                        |
+-------------------+----------------------------------------------+
| allocation_pools  | {"start": "10.0.0.100", "end": "10.0.0.200"} |
| cidr              | 10.0.0.0/24                                  |
| created_at        | 2016-12-22T19:32:33                          |
| description       |                                              |
| dns_nameservers   |                                              |
| enable_dhcp       | False                                        |
| gateway_ip        | 10.0.0.1                                     |
| host_routes       |                                              |
| id                | ef20c175-d772-47d6-af81-95bbcc5e68e0         |
| ip_version        | 4                                            |
| ipv6_address_mode |                                              |
| ipv6_ra_mode      |                                              |
| name              | ext-subnet                                   |
| network_id        | b986c3a9-8267-481d-9ee5-6da40b8ba8d8         |
| subnetpool_id     |                                              |
| tenant_id         | 1247ca30e71e41bab8579ee626dabc93             |
| updated_at        | 2016-12-22T19:32:33                          |
+-------------------+----------------------------------------------+
Created a new network:
+-------------------------+--------------------------------------+
| Field                   | Value                                |
+-------------------------+--------------------------------------+
| admin_state_up          | True                                 |
| availability_zone_hints |                                      |
| availability_zones      |                                      |
| created_at              | 2016-12-22T19:32:38                  |
| description             |                                      |
| id                      | 4d842374-5e6f-439c-8a93-9558e2da8dac |
| ipv4_address_scope      |                                      |
| ipv6_address_scope      |                                      |
| mtu                     | 1458                                 |
| name                    | demo-net                             |
| port_security_enabled   | True                                 |
| router:external         | False                                |
| shared                  | False                                |
| status                  | ACTIVE                               |
| subnets                 |                                      |
| tags                    |                                      |
| tenant_id               | e369f137f311478da2203e161d7a2338     |
| updated_at              | 2016-12-22T19:32:39                  |
+-------------------------+--------------------------------------+
Created a new subnet:
+-------------------+--------------------------------------------------+
| Field             | Value                                            |
+-------------------+--------------------------------------------------+
| allocation_pools  | {"start": "192.168.1.2", "end": "192.168.1.254"} |
| cidr              | 192.168.1.0/24                                   |
| created_at        | 2016-12-22T19:32:43                              |
| description       |                                                  |
| dns_nameservers   |                                                  |
| enable_dhcp       | True                                             |
| gateway_ip        | 192.168.1.1                                      |
| host_routes       |                                                  |
| id                | 49efeb3d-ac66-4a90-ad9c-43dbc5e53e53             |
| ip_version        | 4                                                |
| ipv6_address_mode |                                                  |
| ipv6_ra_mode      |                                                  |
| name              | demo-subnet                                      |
| network_id        | 4d842374-5e6f-439c-8a93-9558e2da8dac             |
| subnetpool_id     |                                                  |
| tenant_id         | e369f137f311478da2203e161d7a2338                 |
| updated_at        | 2016-12-22T19:32:43                              |
+-------------------+--------------------------------------------------+
Created a new router:
+-------------------------+--------------------------------------+
| Field                   | Value                                |
+-------------------------+--------------------------------------+
| admin_state_up          | True                                 |
| availability_zone_hints |                                      |
| availability_zones      |                                      |
| description             |                                      |
| external_gateway_info   |                                      |
| id                      | 90440a65-e22f-4448-9ad0-03da55d78a3c |
| name                    | demo-router                          |
| routes                  |                                      |
| status                  | ACTIVE                               |
| tenant_id               | e369f137f311478da2203e161d7a2338     |
+-------------------------+--------------------------------------+
Added interface 0226b334-ecbf-4290-a8d4-3a87ec9d7351 to router demo-router.
Set gateway for router demo-router
wait 1 minute...
verify connectivity
PING 10.0.0.100 (10.0.0.100) 56(84) bytes of data.
64 bytes from 10.0.0.100: icmp_seq=1 ttl=64 time=1.42 ms
64 bytes from 10.0.0.100: icmp_seq=2 ttl=64 time=0.486 ms
...
$

ในขณะนี้ นศ น่าจะมี OpenStack รันอยู่บนเครื่อง notebook หรือ PC ของคุณแล้ว

อันดับถัดไป ทดสอบและใช้งาน OpenStack Mitaka และ DVR networking
ซึ่งจะมีคำถามให้ นศ ได้ทำตอบเป็นสวนต่อไปของ Project

ถัดไป: Part 7: http://sciencecloud-community.cs.tu.ac.th/?p=711

Leave a Reply