CentOS 7
Sponsored Link

OpenStack Liberty : Nova 設定2015/11/15

 
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 | 11a4bfa2b8c748ad860efb34b5fefb7f |
| domain_id          | default                          |
| enabled            | True                             |
| id                 | 6aadc8713d8742f0a1611a7d1225f2fe |
| 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          | 72d0a53685734a1f94c6dbbc1e62e4a5 |
| 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/%\(tenant_id\)s

+--------------+----------------------------------------+
| Field        | Value                                  |
+--------------+----------------------------------------+
| enabled      | True                                   |
| id           | b375570fd50e4186ae97a8fa6d758259       |
| interface    | public                                 |
| region       | RegionOne                              |
| region_id    | RegionOne                              |
| service_id   | 72d0a53685734a1f94c6dbbc1e62e4a5       |
| service_name | nova                                   |
| service_type | compute                                |
| url          | http://10.0.0.30:8774/v2/%(tenant_id)s |
+--------------+----------------------------------------+

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

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

+--------------+----------------------------------------+
| Field        | Value                                  |
+--------------+----------------------------------------+
| enabled      | True                                   |
| id           | 2e05ac7827b84edda6b69b40115b2d7c       |
| interface    | internal                               |
| region       | RegionOne                              |
| region_id    | RegionOne                              |
| service_id   | 72d0a53685734a1f94c6dbbc1e62e4a5       |
| service_name | nova                                   |
| service_type | compute                                |
| url          | http://10.0.0.30:8774/v2/%(tenant_id)s |
+--------------+----------------------------------------+

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

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

+--------------+----------------------------------------+
| Field        | Value                                  |
+--------------+----------------------------------------+
| enabled      | True                                   |
| id           | c10e501a12cf4b40b6da7e3d14cc26d6       |
| interface    | admin                                  |
| region       | RegionOne                              |
| region_id    | RegionOne                              |
| service_id   | 72d0a53685734a1f94c6dbbc1e62e4a5       |
| service_name | nova                                   |
| service_type | compute                                |
| url          | http://10.0.0.30:8774/v2/%(tenant_id)s |
+--------------+----------------------------------------+
[2] Nova をインストールします。
# Liberty, EPEL からインストール

[root@dlp ~]#
yum --enablerepo=centos-openstack-liberty,epel -y install openstack-nova
[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 21
Server version: 5.5.44-MariaDB MariaDB Server

Copyright (c) 2000, 2015, 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)]>
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)]>
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
# IPv6が不要な場合は記述

use_ipv6=false
state_path=/var/lib/nova
enabled_apis=ec2,osapi_compute,metadata
osapi_compute_listen=0.0.0.0
osapi_compute_listen_port=8774
rootwrap_config=/etc/nova/rootwrap.conf
api_paste_config=api-paste.ini
auth_strategy=keystone
log_dir=/var/log/nova
# Memcached サーバーを指定

memcached_servers=10.0.0.30:11211
scheduler_driver=nova.scheduler.filter_scheduler.FilterScheduler
notification_driver=nova.openstack.common.notifier.rpc_notifier
rpc_backend=rabbit
# Glance サーバーを指定

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

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

[database]
connection=mysql://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
auth_plugin=password
project_domain_id=default
user_domain_id=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 ~]#
vi /etc/nova/nova.conf
# [DEFAULT] セクション内の適当な場所へ追記

network_driver=nova.network.linux_net
libvirt_vif_driver=nova.virt.libvirt.vif.LibvirtGenericVIFDriver
linuxnet_interface_driver=nova.network.linux_net.LinuxBridgeInterfaceDriver
firewall_driver=nova.virt.libvirt.firewall.IptablesFirewallDriver
network_api_class=nova.network.api.API
security_group_api=nova
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=eno16777736
# 適当なブリッジインターフェイス名

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

flat_interface=dummy0
# フラットDHCPブリッジに指定したダミーインターフェースを追加して起動

[root@dlp ~]#
cat > /etc/sysconfig/network-scripts/ifcfg-dummy0 <<EOF
DEVICE=dummy0
BOOTPROTO=none
ONBOOT=yes
TYPE=Ethernet
NM_CONTROLLED=no
EOF
[root@dlp ~]#
echo "alias dummy0 dummy" > /etc/modprobe.d/dummy.conf

[root@dlp ~]#
ifup dummy0

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

[root@dlp ~]#
for service in api cert consoleauth conductor objectstore scheduler compute network; do
systemctl start openstack-nova-$service
systemctl enable openstack-nova-$service
done
# 動作確認

[root@dlp ~]#
nova-manage service list

Binary           Host                 Zone       Status     State Updated_At
nova-cert        dlp.srv.world     internal   enabled    :-)   2015-11-14 11:58:09
nova-consoleauth dlp.srv.world     internal   enabled    :-)   2015-11-14 11:58:01
nova-conductor   dlp.srv.world     internal   enabled    :-)   2015-11-14 11:58:04
nova-scheduler   dlp.srv.world     internal   enabled    :-)   2015-11-14 11:58:09
nova-compute     dlp.srv.world     nova       enabled    :-)   2015-11-14 11:58:02
nova-network     dlp.srv.world     internal   enabled    :-)   2015-11-14 11:58:05
関連コンテンツ