Ubuntu 16.04
Sponsored Link

OpenStack Mitaka (三鷹) : Nova 設定2016/05/20

 
OpenStack Compute Service(Nova)をインストールします。
[1] Keystone に Nova 用のユーザー等々を登録しておきます。
# nova ユーザー作成 (service プロジェクト所属)

root@dlp:~#
openstack user create --domain default --project service --password servicepassword nova

+--------------------+----------------------------------+
| Field              | Value                            |
+--------------------+----------------------------------+
| default_project_id | 004097e8a2da45e6a68f6474b5bd7207 |
| domain_id          | 780b41cee03242da9ec0c73e1a76dc6e |
| enabled            | True                             |
| id                 | 857186663df546fa9435271ec00ec481 |
| name               | nova                             |
+--------------------+----------------------------------+

# nova ユーザーを admin ロール に加える

root@dlp:~#
openstack role add --project service --user nova admin
# nova 用サービスエントリ作成

root@dlp:~#
openstack service create --name nova --description "OpenStack Compute service" compute

+-------------+----------------------------------+
| Field       | Value                            |
+-------------+----------------------------------+
| description | OpenStack Compute service        |
| enabled     | True                             |
| id          | 60d5f6a3237f4d58882da61152ca8f31 |
| name        | nova                             |
| type        | compute                          |
+-------------+----------------------------------+

# 自ホストを定義しておく

root@dlp:~#
export controller=10.0.0.30
# nova 用エンドポイント作成 (public)

root@dlp:~#
openstack endpoint create --region RegionOne compute public http://$controller:8774/v2.1/%\(tenant_id\)s

+--------------+------------------------------------------+
| Field        | Value                                    |
+--------------+------------------------------------------+
| enabled      | True                                     |
| id           | a7451b79ad7c419ab128b5b4ae466317         |
| interface    | public                                   |
| region       | RegionOne                                |
| region_id    | RegionOne                                |
| service_id   | 615337fb12404384a6655c1e3524187f         |
| service_name | nova                                     |
| service_type | compute                                  |
| url          | http://10.0.0.30:8774/v2.1/%(tenant_id)s |
+--------------+------------------------------------------+

# nova 用エンドポイント作成 (internal)

root@dlp:~#
openstack endpoint create --region RegionOne compute internal http://$controller:8774/v2.1/%\(tenant_id\)s

+--------------+------------------------------------------+
| Field        | Value                                    |
+--------------+------------------------------------------+
| enabled      | True                                     |
| id           | c9da360c21d940cf843982d657c1e2b6         |
| interface    | internal                                 |
| region       | RegionOne                                |
| region_id    | RegionOne                                |
| service_id   | 615337fb12404384a6655c1e3524187f         |
| service_name | nova                                     |
| service_type | compute                                  |
| url          | http://10.0.0.30:8774/v2.1/%(tenant_id)s |
+--------------+------------------------------------------+

# nova 用エンドポイント作成 (admin)

root@dlp:~#
openstack endpoint create --region RegionOne compute admin http://$controller:8774/v2.1/%\(tenant_id\)s

+--------------+------------------------------------------+
| Field        | Value                                    |
+--------------+------------------------------------------+
| enabled      | True                                     |
| id           | f8ad440c351a40d0b18d5c3f72576467         |
| interface    | admin                                    |
| region       | RegionOne                                |
| region_id    | RegionOne                                |
| service_id   | 615337fb12404384a6655c1e3524187f         |
| service_name | nova                                     |
| service_type | compute                                  |
| url          | http://10.0.0.30:8774/v2.1/%(tenant_id)s |
+--------------+------------------------------------------+
[2] Nova をインストールします。
root@dlp:~#
apt-get -y install nova-api nova-cert nova-conductor nova-consoleauth nova-scheduler nova-novncproxy nova-compute-kvm python-novaclient
[3] Nova 用のユーザーとデータベースを MariaDB に登録しておきます。
root@dlp:~#
mysql -u root -p

Enter password:
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 39
Server version: 10.0.24-MariaDB-7 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)]>
create database nova;

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

Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]>
grant all privileges on nova.* to nova@'localhost' identified by 'password';

Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
grant all privileges on nova.* to nova@'%' identified by 'password';

Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
grant all privileges on nova_api.* to nova@'localhost' identified by 'password';

Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
grant all privileges on nova_api.* to nova@'%' identified by 'password';

Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
flush privileges;

Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]>
exit

Bye
[4] Nova の基本設定です。
root@dlp:~#
mv /etc/nova/nova.conf /etc/nova/nova.conf.org

root@dlp:~#
vi /etc/nova/nova.conf
# 新規作成

[DEFAULT]
# 自ホストのIP

my_ip = 10.0.0.30
state_path = /var/lib/nova
enabled_apis = osapi_compute,metadata
osapi_compute_listen = 0.0.0.0
osapi_compute_listen_port = 8774
rootwrap_config = /etc/nova/rootwrap.conf
api_paste_config = /etc/nova/api-paste.ini
auth_strategy = keystone
log_dir = /var/log/nova
rpc_backend = rabbit
# VNC を有効にする

[vnc]
enabled = True
vncserver_listen = 0.0.0.0
vncserver_proxyclient_address = $my_ip
novncproxy_base_url = http://10.0.0.30:6080/vnc_auto.html
# Glance サーバーを指定

[glance]
api_servers = http://10.0.0.30:9292
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
# RabbitMQ サーバー接続情報

[oslo_messaging_rabbit]
rabbit_host = 10.0.0.30
rabbit_port = 5672
rabbit_userid = openstack
rabbit_password = password
# MariaDB サーバー接続情報

[api_database]
connection = mysql+pymysql://nova:password@10.0.0.30/nova_api
[database]
connection = mysql+pymysql://nova:password@10.0.0.30/nova
# Keystone サーバー接続情報

[keystone_authtoken]
auth_uri = http://10.0.0.30:5000
auth_url = http://10.0.0.30:35357
memcached_servers = 10.0.0.30:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = servicepassword
root@dlp:~#
chmod 640 /etc/nova/nova.conf

root@dlp:~#
chgrp nova /etc/nova/nova.conf

[5] Nova ネットワーク ( nova-network ) を利用する場合のネットワーク設定です。
Neutron Service を利用する場合は、こちらを参照して設定してください
ちなみに、レガシーネットワーク ( nova-network ) は非推奨となっています。
root@dlp:~#
apt-get -y install nova-network

root@dlp:~#
echo 'net.ipv4.ip_forward=1' >> /etc/sysctl.conf

root@dlp:~#
sysctl -p

net.ipv4.ip_forward = 1
root@dlp:~#
vi /etc/nova/nova.conf
# [DEFAULT] セクション内の適当な場所へ追記

use_neutron = False
dhcpbridge_flagfile = /etc/nova/nova.conf
dhcpbridge = /usr/bin/nova-dhcpbridge
force_dhcp_release = True
libvirt_use_virtio_for_bridges = True
libvirt_vif_driver = nova.virt.libvirt.vif.LibvirtGenericVIFDriver
linuxnet_interface_driver = nova.network.linux_net.LinuxBridgeInterfaceDriver
firewall_driver = nova.virt.libvirt.firewall.IptablesFirewallDriver
network_manager = nova.network.manager.FlatDHCPManager
network_size = 254
allow_same_net_traffic = False
multi_host = True
send_arp_for_ha = True
share_dhcp_address = True
force_dhcp_release = True
# パブリック用のインターフェース名

public_interface = eth0
# 適当なブリッジインターフェイス名

flat_network_bridge = br100
# フラットDHCPブリッジに使用するインターフェース名

flat_interface = dummy0
root@dlp:~#
modprobe dummy

root@dlp:~#
echo "alias dummy0 dummy" > /etc/modprobe.d/dummy.conf

root@dlp:~#
vi /etc/network/interfaces
# 最終行に追記

auto dummy0
iface dummy0 inet manual
root@dlp:~#
ifup dummy0
[6] Nova サービスを起動します。
レガシーネットワーク ( nova-network ) を利用しない場合は「network」を除外してください。
root@dlp:~#
su -s /bin/bash nova -c "nova-manage api_db sync"

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

root@dlp:~#
for service in api conductor scheduler cert consoleauth compute novncproxy network; do
systemctl restart nova-$service
done
関連コンテンツ