GNU/Linux >> Belajar Linux >  >> Ubuntu

OpenStack Liberty di Ubuntu 14.04 LTS – Konfigurasi Nova

Panduan ini membantu Anda mengonfigurasi layanan Nova (Compute) di lingkungan OpenStak, di OpenStack, layanan komputasi (node) menghosting sistem komputasi awan. Komputasi OpenStack adalah bagian utama dalam IaaS, ia berinteraksi dengan KeyStone untuk otentikasi, layanan gambar untuk disk dan gambar, dan dasbor untuk antarmuka pengguna dan administratif.

OpenStack Compute dapat menskalakan secara horizontal pada perangkat keras standar, dan mengunduh gambar untuk meluncurkan instance komputasi.

Instal dan konfigurasikan node pengontrol:

Kami akan mengkonfigurasi layanan Compute pada node Controller, login ke server MySQL sebagai pengguna root.

# mysql -u root -p

Buat database nova.

CREATE DATABASE nova;

Berikan izin yang sesuai ke database nova.

GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'password';

GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'password';

Ganti “sandi ” dengan kata sandi yang sesuai. Keluar dari MySQL.

Muat kredensial admin Anda dari skrip lingkungan.

# source admin-openrc.sh

Buat pengguna nova untuk membuat kredensial layanan.

# openstack user create --domain default --password-prompt nova                                                                                        
User Password:
Repeat User Password:
+-----------+----------------------------------+
| Field     | Value                            |
+-----------+----------------------------------+
| domain_id | default                          |
| enabled   | True                             |
| id        | a25d5cdc7efa4375b0907dd615eebde0 |
| name      | nova                             |
+-----------+----------------------------------+

Tambahkan peran admin ke pengguna nova.

# openstack role add --project service --user nova admin

Buat entitas layanan nova.

# openstack service create --name nova --description "Nova" compute
+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | Nova                             |
| enabled     | True                             |
| id          | ad302b8a4e884decb8ed0f4fdf319ba1 |
| name        | nova                             |
| type        | compute                          |
+-------------+----------------------------------+

Buat titik akhir API layanan nova.

# openstack endpoint create --region RegionOne compute public http://controller:8774/v2/%\(tenant_id\)s
+--------------+-----------------------------------------+
| Field        | Value                                   |
+--------------+-----------------------------------------+
| enabled      | True                                    |
| id           | 3d7bba2b7c3446e7975f8b74c0cab712        |
| interface    | public                                  |
| region       | RegionOne                               |
| region_id    | RegionOne                               |
| service_id   | ad302b8a4e884decb8ed0f4fdf319ba1        |
| service_name | nova                                    |
| service_type | compute                                 |
| url          | http://controller:8774/v2/%(tenant_id)s |
+--------------+-----------------------------------------+

# openstack endpoint create --region RegionOne compute internal http://controller:8774/v2/%\(tenant_id\)s
+--------------+-----------------------------------------+
| Field        | Value                                   |
+--------------+-----------------------------------------+
| enabled      | True                                    |
| id           | 240d4430f1c442439c3835c12abf7533        |
| interface    | internal                                |
| region       | RegionOne                               |
| region_id    | RegionOne                               |
| service_id   | ad302b8a4e884decb8ed0f4fdf319ba1        |
| service_name | nova                                    |
| service_type | compute                                 |
| url          | http://controller:8774/v2/%(tenant_id)s |
+--------------+-----------------------------------------+

# openstack endpoint create --region RegionOne compute admin http://controller:8774/v2/%\(tenant_id\)s
+--------------+-----------------------------------------+
| Field        | Value                                   |
+--------------+-----------------------------------------+
| enabled      | True                                    |
| id           | 758d41f12fff4617bc7e4c12bd4502fc        |
| interface    | admin                                   |
| region       | RegionOne                               |
| region_id    | RegionOne                               |
| service_id   | ad302b8a4e884decb8ed0f4fdf319ba1        |
| service_name | nova                                    |
| service_type | compute                                 |
| url          | http://controller:8774/v2/%(tenant_id)s |
+--------------+-----------------------------------------+

Instal dan konfigurasikan komponen pengontrol Compute:

Instal paket-paket di bawah ini pada node controller.

# apt-get install nova-api nova-cert nova-conductor nova-consoleauth nova-novncproxy nova-scheduler python-novaclient

Edit /etc/nova/nova.conf.

# nano /etc/nova/nova.conf

Ubah pengaturan di bawah ini dan pastikan untuk menempatkan entri di bagian yang tepat. Jika Anda tidak menemukan bagian yang ada untuk entri di bawah ini, Anda mungkin perlu menambahkan bagian tertentu tersebut pada file.

[DEFAULT]
...
verbose = True
rpc_backend = rabbit
auth_strategy = keystone
## Management IP of Controller Node
my_ip = 192.168.12.21 
network_api_class = nova.network.neutronv2.api.API
security_group_api = neutron
linuxnet_interface_driver = nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver
firewall_driver = nova.virt.firewall.NoopFirewallDriver
enabled_apis=osapi_compute,metadata

[vnc]
## Management IP of Controller Node
vncserver_listen = $my_ip
vncserver_proxyclient_address = $my_ip

[database]
connection = mysql+pymysql://nova:password@controller/nova

## Replace "password" with the password you chose for nova database

[oslo_messaging_rabbit]
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = password

## Replace "password" with the password you chose for the openstack account in RabbitMQ.

[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = nova
password = password

## Replace "password" with the password you chose for nova user in the identity service

[glance]
host = controller

[oslo_concurrency]
lock_path = /var/lib/nova/tmp

Isi database Compute.

#  su -s /bin/sh -c "nova-manage db sync" nova

Mulai ulang layanan komputasi.

# service nova-api restart
# service nova-cert restart
# service nova-consoleauth restart
# service nova-scheduler restart
# service nova-conductor restart
# service nova-novncproxy restart

Hapus file database SQLite.

# rm -f /var/lib/nova/nova.sqlite

Instal dan konfigurasikan Nova ( pada node komputasi):

Sekarang, kami akan menginstal dan mengonfigurasi layanan Compute pada node komputasi, layanan ini mendukung beberapa hypervisor untuk menyebarkan instance (VM). Node komputasi kami menggunakan hypervisor QEMU dengan ekstensi KVM untuk mendukung virtualisasi akselerasi perangkat keras.

Verifikasi apakah komputasi Anda mendukung virtualisasi perangkat keras.

# egrep -c '(vmx|svm)' /proc/cpuinfo
1

Jika perintah kembali dengan nilai 1 atau lebih, node komputasi Anda mendukung virtualisasi.

Pastikan Anda telah mengaktifkan repositori OpenStack Kilo di Compute Node, atau ikuti langkah-langkah di bawah ini untuk mengaktifkannya.

Instal keyring dan repositori arsip Ubuntu Cloud.

# apt-get install software-properties-common

# add-apt-repository cloud-archive:liberty

Tingkatkan sistem Anda.

# apt-get update && apt-get dist-upgrade

Instal paket berikut di setiap node Compute Anda.

# apt-get install nova-compute sysfsutils

Edit /etc/nova/nova-compute.conf untuk mengaktifkan QEMU.

# vi /etc/nova/nova-compute.conf

Ubah virt_type=kvm menjadi qemu di bagian libvirt.

[libvirt]
...
virt_type = qemu

Edit /etc/nova/nova.conf.

# vi /etc/nova/nova.conf

Ubah pengaturan di bawah ini dan pastikan untuk menempatkan entri di bagian yang benar.

[DEFAULT]
...
verbose = True
rpc_backend = rabbit
auth_strategy = keystone
## Management IP of Compute Node
my_ip = 192.168.12.22
network_api_class = nova.network.neutronv2.api.API
security_group_api = neutron
linuxnet_interface_driver = nova.network.linux_net.NeutronLinuxBridgeInterfaceDriver
firewall_driver = nova.virt.firewall.NoopFirewallDriver
[vnc]
enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = $my_ip
novncproxy_base_url = http://controller:6080/vnc_auto.html
[oslo_messaging_rabbit]
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = password
## Replace "password" with the password you chose for the openstack account in RabbitMQ.

[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = nova
password = password

## Replace "password" with the password you chose for nova user in the identity service

[glance]
host = controller

## Replace controller with your controller hostname

[oslo_concurrency]
lock_path = /var/lib/nova/tmp

Mulai ulang layanan komputasi.

# service nova-compute restart

Hapus file database SQLite.

# rm -f /var/lib/nova/nova.sqlite

Verifikasi operasi:

Muat kredensial admin di Controller Node.

# source admin-openrc.sh

Buat daftar komponen layanan komputasi yang akan diverifikasi, jalankan perintah berikut di Controller Node.

# nova service-list
+----+------------------+--------------------------+----------+---------+-------+----------------------------+-----------------+
| Id | Binary           | Host                     | Zone     | Status  | State | Updated_at                 | Disabled Reason |
+----+------------------+--------------------------+----------+---------+-------+----------------------------+-----------------+
| 1  | nova-consoleauth | controller.itzgeek.local | internal | enabled | up    | 2015-11-25T14:11:25.000000 | -               |
| 2  | nova-cert        | controller.itzgeek.local | internal | enabled | up    | 2015-11-25T14:11:24.000000 | -               |
| 3  | nova-conductor   | controller.itzgeek.local | internal | enabled | up    | 2015-11-25T14:11:28.000000 | -               |
| 4  | nova-scheduler   | controller.itzgeek.local | internal | enabled | up    | 2015-11-25T14:11:24.000000 | -               |
| 5  | nova-compute     | compute.itzgeek.local    | nova     | enabled | up    | 2015-11-25T14:11:30.000000 | -               |
+----+------------------+--------------------------+----------+---------+-------+----------------------------+-----------------+

Anda akan mendapatkan output dengan empat komponen layanan yang diaktifkan pada node pengontrol dan satu komponen layanan pada node komputasi.

Cantumkan gambar dalam Katalog layanan gambar untuk memverifikasi konektivitas antara komputasi dan layanan gambar.

# nova image-list
+--------------------------------------+---------------------+--------+--------+
| ID                                   | Name                | Status | Server |
+--------------------------------------+---------------------+--------+--------+
| b19c4522-df31-4331-a2e1-5992abcd4ded | Ubuntu_14.04-x86_64 | ACTIVE |        |
+--------------------------------------+---------------------+--------+--------+

That's All!!!, Anda telah berhasil mengkonfigurasi layanan Nova. Selanjutnya adalah mengkonfigurasi OpenStack Networking (Neutron).


Ubuntu
  1. OpenStack Kilo di Ubuntu 14.04.2 – Konfigurasi Nova

  2. OpenStack Kilo di Ubuntu 14.04.2 – Konfigurasi Sekilas

  3. OpenStack Kilo di Ubuntu 14.04.2 – Konfigurasi KeyStone #2

  1. OpenStack Kilo di Ubuntu 14.04.2 – Konfigurasikan KeyStone #1

  2. OpenStack Kilo di Ubuntu 14.04.2 – Konfigurasikan Swift #1

  3. OpenStack Kilo di Ubuntu 14.04.2 – Konfigurasikan Cinder #2

  1. OpenStack Kilo di Ubuntu 14.04.2 – Konfigurasikan Cinder #1

  2. OpenStack Kilo di Ubuntu 14.04.2 – Konfigurasikan Horizon

  3. OpenStack Kilo di Ubuntu 14.04.2 – Konfigurasi Neutron #3