Install & konfigurasi Openstack Newton Multinode di Ubuntu 16.04 – Part 5 (Nova – Compute service)

nova

pada part5 ini kita akan membahas nova compute service yang berfungsi untuk memanagement instance (vm) pada cloud, dan memiliki fungsi yang lainnya seperti nova compute, nova scheduler , nova api dan lain-lain.

untuk menginstall nova compute service ini, lumayan ribet karena nanti kita menginstall di controller node & compute node

sebelum kita menginstall nova compute kita harus buat database terlebih dahulu di controller node

*WARNING = JALANKAN PERINTAH PADA PART5 DI CONTROLLER NODE

[CONTROLLER NODE]

kita akan membuat database nova & nova-api

  • Login ke database dengan user root
root@controller:~# mysql -u root -p
Enter password: password_root
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 71
Server version: 10.0.27-MariaDB-0ubuntu0.16.04.1 Ubuntu 16.04

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> 
  • membuat database nova & nova_api
MariaDB [(none)]> create database nova_api;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> create database nova;
Query OK, 1 row affected (0.00 sec)

kemudian memberikan hak akses user nova & nova_api ke database nova

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' IDENTIFIED BY 'password_nova';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY 'password_nova';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'password_nova';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'password_nova';
Query OK, 0 rows affected (0.00 sec)

seletah itu keluar dari maridb server. dan aktifkan  admin-openrc

root@controller:~# . admin-openrc 
  • Membuat user nova
root@controller:~# openstack user create --domain default --password-prompt nova
User Password: password_nova
Repeat User Password: password_nova
+---------------------+----------------------------------+
| Field               | Value                            |
+---------------------+----------------------------------+
| domain_id           | default                          |
| enabled             | True                             |
| id                  | 5e487c6edd74427f97e17179498a1c20 |
| name                | nova                             |
| password_expires_at | None                             |
+---------------------+----------------------------------+
  • Menambahkan role admin ke user nova
root@controller:~# openstack role add --project service --user nova admin

*pada bagian ini tidak menampilan output

  • membuat entitas nova service
root@controller:~# openstack service  create --name nova --description "Openstack Compute" compute
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | Openstack Compute                |
| enabled     | True                             |
| id          | 8d8da694080e475bbf133cd7d1ef0579 |
| name        | nova                             |
| type        | compute                          |
+-------------+----------------------------------+

okee, setelah itu kita akan membuat API endpoint untuk nova compute

  • Membuat API endpoint untuk compute service
root@controller:~# openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1/%\(tenant_id\)s
+--------------+-------------------------------------------+
| Field        | Value                                     |
+--------------+-------------------------------------------+
| enabled      | True                                      |
| id           | 61bd736b8c1e4743b97e362d41121a3c          |
| interface    | public                                    |
| region       | RegionOne                                 |
| region_id    | RegionOne                                 |
| service_id   | 8d8da694080e475bbf133cd7d1ef0579          |
| service_name | nova                                      |
| service_type | compute                                   |
| url          | http://controller:8774/v2.1/%(tenant_id)s |
+--------------+-------------------------------------------+
root@controller:~# openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1/%\(tenant_id\)s
+--------------+-------------------------------------------+
| Field        | Value                                     |
+--------------+-------------------------------------------+
| enabled      | True                                      |
| id           | a57180684f324cb3b134fef2bb74c34c          |
| interface    | internal                                  |
| region       | RegionOne                                 |
| region_id    | RegionOne                                 |
| service_id   | 8d8da694080e475bbf133cd7d1ef0579          |
| service_name | nova                                      |
| service_type | compute                                   |
| url          | http://controller:8774/v2.1/%(tenant_id)s |
+--------------+-------------------------------------------+
root@controller:~# openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1/%\(tenant_id\)s
+--------------+-------------------------------------------+
| Field        | Value                                     |
+--------------+-------------------------------------------+
| enabled      | True                                      |
| id           | ec8e9ac834084958abe34606a0310e39          |
| interface    | admin                                     |
| region       | RegionOne                                 |
| region_id    | RegionOne                                 |
| service_id   | 8d8da694080e475bbf133cd7d1ef0579          |
| service_name | nova                                      |
| service_type | compute                                   |
| url          | http://controller:8774/v2.1/%(tenant_id)s |
+--------------+-------------------------------------------+

setelah kita membuat API endpoint untuk compute service maka setelah itu kita akan menginstall komponen untuk compute service, namun anda harus perhatikan selama pembuatan API endpoint pastikan tidak ada error.

  • Install dan configurasi komponen untuk compute service pada controller node
root@controller:~# apt install nova-api nova-conductor nova-consoleauth nova-novncproxy nova-scheduler

kemudian setelah itu, kita akan mengedit file /etc/nova/nova.conf

  • pada bagian [DEFAULT] aktifkan API compute dan metadata
[DEFAULT]
....
enabled_apis=osapi_compute,metadata
  • Mengatur hak akses pada bagian [database] & [api_database]
[database]
......
connection = mysql+pymysql://nova:password_nova@controller/nova

[api_database]
........
connection = mysql+pymysql://nova:password_nova_api@controller/nova_api
  • mengatur RabbitMQ akses pada bagian [DEFAULT] dan [oslo_messaging_rabbit]
[DEFAULT]
.......
rpc_backend = rabbit

[oslo_messaging_rabbit]
........
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = password_rabbit
  • Mengatur keystone identity service access pada bagian [DEFAULT] dan [keystone_authtoken]
[DEFAULT]
.........
auth_strategy = keystone

[keystone_authtoken]
..........
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = password_nova
  • Mangatur my_ip dengan mengunakan ip management pada controller node dibagian [DEFAULT]
[DEFAULT]
......
my_ip = 10.0.0.10
  • Mengaktifkan network service pada bagian [DEFAULT]
[DEFAULT]
.........
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
  • Mengkonfigurasi VNC Proxy mengunakan ip management controller node, pada bagian [vnc]
[vnc]
...
vncserver_listen = $my_ip
vncserver_proxyclient_address = $my_ip
  • Mengkonfigurasi glance image service API pada [glance]
[glance]
...
api_servers = http://controller:9292
  • konfigurasi lock path pada [oslo_concurrency]
[oslo_concurrency]
......
lock_path = /var/lib/nova/tmp

untuk mengatasi bug package maka comment (#) log-dir pada [DEFAULT]

kemudian, save dan exit

  • kemudian jalankan perintah dibawah ini untuk mengisi database nova & nova-api  ke mariadb
root@controller:~# su -s /bin/sh -c "nova-manage api_db sync" nova

root@controller:~# su -s /bin/sh -c "nova-manage db sync" nova

pastikan pada saat proses migrasi database tidak ada yang error, untuk memastikan proses migrasi database berjalan dengan baik.

root@controller:~# /etc/init.d/nova-api restart
[ ok ] Restarting nova-api (via systemctl): nova-api.service.
root@controller:~# /etc/init.d/nova-consoleauth restart
[ ok ] Restarting nova-consoleauth (via systemctl): nova-consoleauth.service.
root@controller:~# /etc/init.d/nova-scheduler restart
[ ok ] Restarting nova-scheduler (via systemctl): nova-scheduler.service.
root@controller:~# /etc/init.d/nova-conductor restart
[ ok ] Restarting nova-conductor (via systemctl): nova-conductor.service.
root@controller:~# /etc/init.d/nova-novncproxy restart
[ ok ] Restarting nova-novncproxy (via systemctl): nova-novncproxy.service.

cukup sekian dulu proses installasi openstack part5, nanti kita akan lanjutkan part6 dengan pembahasan install pada compute node

wassalam

About the author
Alan Adi Prastyo

Routecloud Networks

Information about Server, Linux and Computer Network.

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to Routecloud Networks.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.