Bagian ini menjelaskan cara menginstal dan mengkonfigurasi layanan Compute, code-named nova, pada controller node.
Sebelum Anda menginstal dan mengkonfigurasi layanan Compute, Anda harus membuat database, kredensial layanan, dan API endpoints.
Untuk membuat database, lakukan langkah-langkah berikut:
Gunakan klien akses database untuk menghubungkan ke server database sebagai root
user:
$ mysql -u root -p
Create the nova_api
, nova
, and nova_cell0
databases:
MariaDB [(none)]> CREATE DATABASE nova_api;
MariaDB [(none)]> CREATE DATABASE nova;
MariaDB [(none)]> CREATE DATABASE nova_cell0;
Berikanlah akses yang tepat untuk database:
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' \
IDENTIFIED BY 'NOVA_DBPASS';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' \
IDENTIFIED BY 'NOVA_DBPASS';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' \
IDENTIFIED BY 'NOVA_DBPASS';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' \
IDENTIFIED BY 'NOVA_DBPASS';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'localhost' \
IDENTIFIED BY 'NOVA_DBPASS';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' \
IDENTIFIED BY 'NOVA_DBPASS';
Ganti NOVA_DBPASS
dengan password yang sesuai.
Keluar dari klien akses database.
Dapatkan sumber `admin
credential untuk akses ke admin-only CLI commands:
$ . admin-openrc
Create the Compute service credentials:
Buat pengguna nova
:
$ openstack user create --domain default --password-prompt nova
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | 8a7dbf5279404537b1c7b86c033620fe |
| name | nova |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+
Tambahkan peran admin
ke pengguna nova
:
$ openstack role add --project service --user nova admin
Catatan
Command ini tidak memberikan output.
Buat entitas layanan nova
:
$ openstack service create --name nova \
--description "OpenStack Compute" compute
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Compute |
| enabled | True |
| id | 060d59eac51b4594815603d75a00aba2 |
| name | nova |
| type | compute |
+-------------+----------------------------------+
Create the Compute API service endpoints:
$ openstack endpoint create --region RegionOne \
compute public http://controller:8774/v2.1
+--------------+-------------------------------------------+
| Field | Value |
+--------------+-------------------------------------------+
| enabled | True |
| id | 3c1caa473bfe4390a11e7177894bcc7b |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 060d59eac51b4594815603d75a00aba2 |
| service_name | nova |
| service_type | compute |
| url | http://controller:8774/v2.1 |
+--------------+-------------------------------------------+
$ openstack endpoint create --region RegionOne \
compute internal http://controller:8774/v2.1
+--------------+-------------------------------------------+
| Field | Value |
+--------------+-------------------------------------------+
| enabled | True |
| id | e3c918de680746a586eac1f2d9bc10ab |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 060d59eac51b4594815603d75a00aba2 |
| service_name | nova |
| service_type | compute |
| url | http://controller:8774/v2.1 |
+--------------+-------------------------------------------+
$ openstack endpoint create --region RegionOne \
compute admin http://controller:8774/v2.1
+--------------+-------------------------------------------+
| Field | Value |
+--------------+-------------------------------------------+
| enabled | True |
| id | 38f7af91666a47cfb97b4dc790b94424 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 060d59eac51b4594815603d75a00aba2 |
| service_name | nova |
| service_type | compute |
| url | http://controller:8774/v2.1 |
+--------------+-------------------------------------------+
Create a Placement service user using your chosen PLACEMENT_PASS
:
$ openstack user create --domain default --password-prompt placement
User Password:
Repeat User Password:
+---------------------+----------------------------------+
| Field | Value |
+---------------------+----------------------------------+
| domain_id | default |
| enabled | True |
| id | fa742015a6494a949f67629884fc7ec8 |
| name | placement |
| options | {} |
| password_expires_at | None |
+---------------------+----------------------------------+
Add the Placement user to the service project with the admin role:
$ openstack role add --project service --user placement admin
Catatan
Command ini tidak memberikan output.
Create the Placement API entry in the service catalog:
$ openstack service create --name placement --description "Placement API" placement
+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | Placement API |
| enabled | True |
| id | 2d1a27022e6e4185b86adac4444c495f |
| name | placement |
| type | placement |
+-------------+----------------------------------+
Create the Placement API service endpoints:
$ openstack endpoint create --region RegionOne placement public http://controller:8778
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 2b1b2637908b4137a9c2e0470487cbc0 |
| interface | public |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 2d1a27022e6e4185b86adac4444c495f |
| service_name | placement |
| service_type | placement |
| url | http://controller:8778 |
+--------------+----------------------------------+
$ openstack endpoint create --region RegionOne placement internal http://controller:8778
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 02bcda9a150a4bd7993ff4879df971ab |
| interface | internal |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 2d1a27022e6e4185b86adac4444c495f |
| service_name | placement |
| service_type | placement |
| url | http://controller:8778 |
+--------------+----------------------------------+
$ openstack endpoint create --region RegionOne placement admin http://controller:8778
+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| enabled | True |
| id | 3d71177b9e0f406f98cbff198d74b182 |
| interface | admin |
| region | RegionOne |
| region_id | RegionOne |
| service_id | 2d1a27022e6e4185b86adac4444c495f |
| service_name | placement |
| service_type | placement |
| url | http://controller:8778 |
+--------------+----------------------------------+
Catatan
file konfigurasi default bervariasi oleh distribusi. Anda mungkin perlu menambahkan bagian ini dan pilihan daripada memodifikasi bagian dan pilihan yang ada. Juga, elipsis (`` ... ``) dalam cuplikan konfigurasi menunjukkan opsi konfigurasi default potensial yang harus Anda mempertahankan.
Instal paket:
# yum install openstack-nova-api openstack-nova-conductor \
openstack-nova-console openstack-nova-novncproxy \
openstack-nova-scheduler openstack-nova-placement-api
Edit file /etc/nova/nova.conf
dan selesaikan tindakan berikut:
Dalam bagian ``[DEFAULT] ``, aktifkan hanya komputasi dan metadata API:
[DEFAULT]
# ...
enabled_apis = osapi_compute,metadata
Dalam bagian [api_database]
dan `` [Database] ``, konfigurasi akses database:
[api_database]
# ...
connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova_api
[database]
# ...
connection = mysql+pymysql://nova:NOVA_DBPASS@controller/nova
Ganti NOVA_DBPASS
dengan password yang Anda pilih untuk database Compute.
Dalam bagian [DEFAULT]
, lakukan konfigurasi akses antrian pesan RabbitMQ
:
[DEFAULT]
# ...
transport_url = rabbit://openstack:RABBIT_PASS@controller
Ganti RABBIT_PASS
dengan password yang Anda pilih untuk akun openstack
di `` RabbitMQ``.
Dalam bagian ``[api] `` dan ``[keystone_authtoken] ``, lakukan konfigurasi akses layanan Identity:
[api]
# ...
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 = NOVA_PASS
Ganti NOVA_PASS
dengan password yang Anda pilih untuk pengguna nova
dalam pelayanan Identity.
Dalam bagian [DEFAULT] ``, konfigurasi opsi ``my_ip
menggunakan management interface alamat IP dari controller node:
[DEFAULT]
# ...
my_ip = 10.0.0.11
Dalam bagian ``[DEFAULT] ``, aktifkan dukungan untuk layanan Networking:
[DEFAULT]
# ...
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
Catatan
Secara default, Compute menggunakan driver firewall internal. Karena layanan Networking termasuk driver firewall, Anda harus menonaktifkan driver firewall Compute dengan menggunakan driver firewall nova.virt.firewall.NoopFirewallDriver
.
Dalam bagian ``[vnc] ``, konfigurasi proxy VNC menggunakan manajemen antarmuka alamat IP dari controller node:
[vnc]
enabled = true
# ...
vncserver_listen = $my_ip
vncserver_proxyclient_address = $my_ip
Dalam bagian ``[glance] ``, konfigurasikan lokasi layanan Image API:
[glance]
# ...
api_servers = http://controller:9292
Dalam bagian [oslo_concurrency]
, konfigurasi lock path:
[oslo_concurrency]
# ...
lock_path = /var/lib/nova/tmp
In the [placement]
section, configure the Placement API:
[placement]
# ...
os_region_name = RegionOne
project_domain_name = Default
project_name = service
auth_type = password
user_domain_name = Default
auth_url = http://controller:35357/v3
username = placement
password = PLACEMENT_PASS
Replace PLACEMENT_PASS
with the password you choose for the
placement
user in the Identity service. Comment out any other options in
the [placement]
section.
Due to a packaging bug, you must enable
access to the Placement API by adding the following configuration to
/etc/httpd/conf.d/00-nova-placement-api.conf
:
<Directory /usr/bin>
<IfVersion >= 2.4>
Require all granted
</IfVersion>
<IfVersion < 2.4>
Order allow,deny
Allow from all
</IfVersion>
</Directory>
Mulai ulang layanan httpd:
# systemctl restart httpd
Populate the nova-api database:
# su -s /bin/sh -c "nova-manage api_db sync" nova
Catatan
Abaikan pesan bantahan dalam output ini.
Register the cell0
database:
# su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova
Create the cell1
cell:
# su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova
109e1d4b-536a-40d0-83c6-5f121b82b650
Populate the nova database:
# su -s /bin/sh -c "nova-manage db sync" nova
Verify nova cell0 and cell1 are registered correctly:
# nova-manage cell_v2 list_cells
+-------+--------------------------------------+
| Name | UUID |
+-------+--------------------------------------+
| cell1 | 109e1d4b-536a-40d0-83c6-5f121b82b650 |
| cell0 | 00000000-0000-0000-0000-000000000000 |
+-------+--------------------------------------+
Mulai layanan Compute dan mengkonfigurasi mereka untuk mulai booting:
# systemctl enable openstack-nova-api.service \
openstack-nova-consoleauth.service openstack-nova-scheduler.service \
openstack-nova-conductor.service openstack-nova-novncproxy.service
# systemctl start openstack-nova-api.service \
openstack-nova-consoleauth.service openstack-nova-scheduler.service \
openstack-nova-conductor.service openstack-nova-novncproxy.service
Except where otherwise noted, this document is licensed under Creative Commons Attribution 3.0 License. See all OpenStack Legal Documents.