Nova
Compute service
Install and configure controller node
Nova API
データベース作成
code:sql
CREATE DATABASE nova_api;
CREATE DATABASE nova;
CREATE DATABASE nova_cell0;
権限周り
code:sql
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost' IDENTIFIED BY 'NOVA_DBPASS';
GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%' IDENTIFIED BY 'NOVA_DBPASS';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost' IDENTIFIED BY 'NOVA_DBPASS';
GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%' IDENTIFIED BY 'NOVA_DBPASS';
GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'localhost' IDENTIFIED BY 'NOVA_DBPASS';
GRANT ALL PRIVILEGES ON nova_cell0.* TO 'nova'@'%' IDENTIFIED BY 'NOVA_DBPASS';
Compute サービス用認証情報
ユーザの追加
code:shell
# openstack user create --domain default --password-prompt nova
管理者ロールに追加
code:shell
$ openstack role add --project service --user nova admin
nova サービスエンティティの作成
code:shell
# openstack service create --name nova --description "OpenStack Compute" compute
Compute API サービスのエンドポイント作成
code:shell
# openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1
# openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1
# openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1
パッケージのインストール
code:shell
# yum install openstack-nova-api openstack-nova-conductor openstack-nova-novncproxy openstack-nova-scheduler
/etc/nova/nova.conf 編集
[neutron] セクションはまた後で
code:shell
# diff -u /etc/nova/nova.conf.org /etc/nova/nova.conf
--- /etc/nova/nova.conf.org 2020-07-20 20:23:02.000000000 +0900
+++ /etc/nova/nova.conf 2020-07-31 23:40:55.917251372 +0900
@@ -491,7 +491,7 @@
# This option has a sample default set, which means that
# its actual default value may vary from the one documented
# below.
-#my_ip=<host_ipv4>
+my_ip=192.168.11.19
#
# The IP address which is used to connect to the block storage network. For more
@@ -602,7 +602,7 @@
#periodic_fuzzy_delay=60
# List of APIs to be enabled by default (list value)
-#enabled_apis=osapi_compute,metadata
+enabled_apis=osapi_compute,metadata
#
# List of APIs with enabled SSL. For more information, refer to the
@@ -826,7 +826,7 @@
# The network address and optional user credentials for connecting to the
# messaging backend, in URL format. The expected format is. For more
# information, refer to the documentation. (string value)
-#transport_url=rabbit://
+transport_url=rabbit://openstack:nova@controller:5672/
# The default exchange under which topics are scoped. May be overridden by an
# exchange name specified in the transport_url option (string value)
@@ -890,7 +890,7 @@
# The only non-default choice, noauth2, is for internal development and
# testing purposes only and should not be used in deployments. This option and
# its middleware, NoAuthMiddlewareV2_18, will be removed in a future release.
-#auth_strategy=keystone
+auth_strategy=keystone
#
# When True, the 'X-Forwarded-For' header is treated as the canonical remote
@@ -1089,7 +1089,7 @@
# The SQLAlchemy connection string to use to connect to the database. Do not set
# this for the nova-compute service (string value)
-#connection=mysql://nova:nova@localhost/nova
+connection=mysql+pymysql://nova:nova@controller/nova_api
# Optional URL parameters to append onto the connection URL at connect time;
# specify as param1=value1&param2=value2& (string value)
@@ -1636,7 +1636,7 @@
# Deprecated group;name - DEFAULT;sql_connection
# Deprecated group;name - DATABASE/sql_connection
# Deprecated group;name - sql/connection
-#connection=<None>
+connection=mysql+pymysql://nova:nova@controller/nova
# The SQLAlchemy connection string to use to connect to the slave database
# (string value)
@@ -1950,7 +1950,7 @@
# options was added in the 17.0.0 Queens release. The api_servers option was
# retained temporarily to allow consumers time to cut over to a real load
# balancing solution.
-#api_servers=<None>
+api_servers=http://controller:9292
#
# Enable glance operation retries. For more information, refer to the
@@ -2026,7 +2026,7 @@
#valid_interfaces=internal,public
# The default region_name for endpoint URL discovery (string value)
-#region_name=<None>
+region_name=RegionOne
# Always use this endpoint URL for requests for this client. NOTE: The
# unversioned endpoint should be specified here; to request a particular API
@@ -2571,7 +2571,8 @@
# endpoint the service user utilizes for validating tokens, because normal end
# users may not be able to reach that endpoint (string value)
# Deprecated group;name - keystone_authtoken/auth_uri
-#www_authenticate_uri=<None>
+www_authenticate_uri=http://controller:5000/
+auth_url = http://controller:5000/
# DEPRECATED: Complete "public" Identity API endpoint. This endpoint should not
# be an "admin" endpoint, as it should be accessible by all end users.
@@ -2632,7 +2633,7 @@
# Optionally specify a list of memcached server(s) to use for caching. If left
# undefined, tokens will instead be cached in-process (list value)
# Deprecated group;name - keystone_authtoken/memcache_servers
-#memcached_servers=<None>
+memcached_servers=controller:11211
# In order to prevent excessive effort spent validating tokens, the middleware
# caches previously-seen tokens for a configurable duration (in seconds). Set to
@@ -2712,7 +2713,12 @@
# Authentication type to load (string value)
# Deprecated group;name - keystone_authtoken/auth_plugin
-#auth_type=<None>
+auth_type = password
+project_domain_name = Default
+user_domain_name = Default
+project_name = service
+username = nova
+password = nova
# Config Section from which to load plugin specific options (string value)
#auth_section=<None>
@@ -3580,7 +3586,7 @@
# only be writable by the user running the processes that need locking. Defaults
# to environment variable OSLO_LOCK_PATH. If external locks are used, a lock
# path must be set (string value)
-#lock_path=/var/lib/nova/tmp
+lock_path=/var/lib/nova/tmp
oslo_messaging_amqp
@@ -4140,13 +4146,13 @@
#project_id=<None>
# Project name to scope to (string value)
-#project_name=<None>
+project_name=service
# Domain ID containing project (string value)
#project_domain_id=<None>
# Domain name containing project (string value)
-#project_domain_name=<None>
+project_domain_name=Default
# Trust ID (string value)
#trust_id=<None>
@@ -4219,6 +4225,11 @@
# used (floating point value)
#status_code_retry_delay=<None>
+auth_type = password
+user_domain_name = Default
+auth_url = http://controller:5000/v3
+username = placement
+password = placement
powervm
#
@@ -5180,7 +5191,7 @@
# Enable VNC related features. For more information, refer to the documentation.
# (boolean value)
# Deprecated group;name - DEFAULT;vnc_enabled
-#enabled=true
+enabled=true
# DEPRECATED:
# Keymap for VNC. For more information, refer to the documentation. (string
@@ -5203,14 +5214,14 @@
# (host address value)
# Deprecated group;name - DEFAULT;vncserver_listen
# Deprecated group;name - vnc/vncserver_listen
-#server_listen=127.0.0.1
+server_listen=$my_ip
#
# Private, internal IP address or hostname of VNC console proxy. For more
# information, refer to the documentation. (host address value)
# Deprecated group;name - DEFAULT;vncserver_proxyclient_address
# Deprecated group;name - vnc/vncserver_proxyclient_address
-#server_proxyclient_address=127.0.0.1
+server_proxyclient_address=$my_ip
#
# Public address of noVNC VNC console proxy. For more information, refer to the
nova-api データベースにデータ投入
code:shell
# su -s /bin/sh -c "nova-manage api_db sync" nova
cell0 データベースの登録
code:shell
# su -s /bin/sh -c "nova-manage cell_v2 map_cell0" nova
作成
code:shell
# su -s /bin/sh -c "nova-manage cell_v2 create_cell --name=cell1 --verbose" nova
nova データベースにデータ投入
code:shell
# su -s /bin/sh -c "nova-manage db sync" nova
nova cell0とcell1が正しく登録されていることを確認
code:shell
# su -s /bin/sh -c "nova-manage cell_v2 list_cells" nova
Compute サービスの起動
code:shell
systemctl enable \
openstack-nova-api.service \
openstack-nova-scheduler.service \
openstack-nova-conductor.service \
openstack-nova-novncproxy.service
code:shell
systemctl start \
openstack-nova-api.service \
openstack-nova-scheduler.service \
openstack-nova-conductor.service \
openstack-nova-novncproxy.service
Nova Compute
Install and configure a compute node for Red Hat Enterprise Linux and CentOS
パッケージのインストール
code:shell
# yum install openstack-nova-compute
上記の nova_api と比べて/etc/nova/nova.conf の下記を変更
novncproxy_base_url=http://controller:6080/vnc_auto.html
コンピュートノードが仮想マシンのハードウェアアクセラレーションをサポートしているか
code:shell
# egrep -c '(vmx|svm)' /proc/cpuinfo
8
0 を返した場合はサポートしてないので、 /etc/nova/nova.conf の [libvirt] セクションの virt_type を qemu にする必要がある
起動設定
code:shell
# systemctl enable libvirtd.service openstack-nova-compute.service
# systemctl start libvirtd.service openstack-nova-compute.service
cell データベースにホスト情報の登録
code:shell
# su -s /bin/sh -c "nova-manage cell_v2 discover_hosts --verbose" nova
動作確認
サービスコンポーネントのリストアップ
code:shell
# openstack compute service list
+----+----------------+------+----------+---------+-------+----------------------------+
| ID | Binary | Host | Zone | Status | State | Updated At |
+----+----------------+------+----------+---------+-------+----------------------------+
| 1 | nova-conductor | reno | internal | enabled | up | 2020-07-31T15:18:31.000000 |
| 3 | nova-scheduler | reno | internal | enabled | up | 2020-07-31T15:18:33.000000 |
| 7 | nova-compute | reno | nova | enabled | up | 2020-07-31T15:18:36.000000 |
+----+----------------+------+----------+---------+-------+----------------------------+
コントローラーノードで有効になっている 2 つのサービスと、コンピュートノードで有効になっている 1 つのサービスコンポーネント
Identity サービスの API エンドポイントをリストアップして、Identity サービスとの接続性を検証
code:shell
# openstack catalog list
+-----------+-----------+-----------------------------------------+
| Name | Type | Endpoints |
+-----------+-----------+-----------------------------------------+
| glance | image | RegionOne |
| | | public: http://controller:9292 |
| | | RegionOne |
| | | admin: http://controller:9292 |
| | | RegionOne |
| | | internal: http://controller:9292 |
| | | |
| nova | compute | RegionOne |
| | | internal: http://controller:8774/v2.1 |
| | | RegionOne |
| | | admin: http://controller:8774/v2.1 |
| | | RegionOne |
| | | public: http://controller:8774/v2.1 |
| | | |
| keystone | identity | RegionOne |
| | | admin: http://controller:5000/v3/ |
| | | RegionOne |
| | | internal: http://controller:5000/v3/ |
| | | RegionOne |
| | | public: http://controller:5000/v3/ |
| | | |
| placement | placement | RegionOne |
| | | internal: http://controller:8778 |
| | | RegionOne |
| | | public: http://controller:8778 |
| | | RegionOne |
| | | admin: http://controller:8778 |
| | | |
+-----------+-----------+-----------------------------------------+
Image との接続性の確認
code:shell
# openstack image list
+--------------------------------------+--------+--------+
| ID | Name | Status |
+--------------------------------------+--------+--------+
| 1451dfe4-5719-48e6-afb8-7dc0f4bc7a1e | cirros | active |
+--------------------------------------+--------+--------+
cell と Placement AP Iが正常に動作し、その他の必要な前提条件が整っていることを確認
code:shell
# nova-status upgrade check
+------------------------------------+
| Upgrade Check Results |
+------------------------------------+
| Check: Cells v2 |
| Result: Success |
| Details: None |
+------------------------------------+
| Check: Placement API |
| Result: Success |
| Details: None |
+------------------------------------+
| Check: Ironic Flavor Migration |
| Result: Success |
| Details: None |
+------------------------------------+
| Check: Cinder API |
| Result: Success |
| Details: None |
+------------------------------------+
| Check: Policy Scope-based Defaults |
| Result: Success |
| Details: None |
+------------------------------------+