3. Note: For Neutron to work properly, a network namespaces-enabled
kernel is required. On RHEL systems, please do an update and reboot
prior to continuing.
>-# yum -y update
# reboot
--<
Due to the quantum/neutron rename, SELinux policies are currently
broken for Havana, so SELinux must be disabled/permissive on
machines running neutron services, edit /etc/selinux/config to set
SELINUX=permissive.
Step 3: Packstackおよび必要パッケージのインストール
>-# yum install -y openstack-packstack python-netaddr
--<
Step 4: Packstackを実行してOpenStackのインストール
PackstackはOpenStackに関した手動設定を排除します。シングルノードでの導入では、
以下のコマンドを実行します。
>-# packstack --allinone
--<
インストールすると1台構成のOpenStack環境を構成できます。
パブリックネットワークには仮のネットワークが設定されているため、外部PCからのアク
セスはできません。
packstackであらかじめ構成を指定した上でOpenStackをデプロイするにはアンサーファ
イルを利用します。packstack --allinoneを実行すると/rootディレクトリにアンサー
ファイルが作成されます。もしくは以下のコマンドを実行するとアンサーファイルを作るこ
とができます。
>-# packstack --gen-answer-file=answer.txt
# vi answer.txt
[general]
# Path to a Public key to install on servers. If a usable key has
not
# been installed on the remote servers the user will be prompted for
a
4. # password and this key will be installed so the password will not
be
# required again
CONFIG_SSH_KEY=
# Set to 'y' if you would like Packstack to install MySQL
CONFIG_MYSQL_INSTALL=y
# Set to 'y' if you would like Packstack to install OpenStack Image
# Service (Glance)
CONFIG_GLANCE_INSTALL=y
(略)
--<
作成したアンサーファイルは1台のマシンにすべてをインストールする設定が行われていま
す。IPアドレスや各種パスワードなどを適宜設定します。
アンサーファイルを設定したら、packstackコマンドでOpenStackの構築開始です。
アンサーファイルを指定して実行します。
>-# packstack --answer-file=~/packstack-answers-*.txt
--<
The installer will ask you to enter the root password for each host
node you are installing on the network, to enable remote
configuration of the host so it can remotely configure each node
using Puppet. If the installer had to upgrade your kernel, packstack
will inform you that manual reboot will be required.
Once the process is complete, you can log in to the OpenStack web
interface "Horizon" by going to http://$YOURIP/dashboard. The
username is "demo". The password can be found in the file
keystonerc_demo in the /root/ directory of the control node.
You can find the demo network topology here: http://$YOURIP/
dashboard/project/network_topology/
Step 5: ネットワーク設定の変更
次に外部と通信できるようにするための設定を行います。
http://openstack.redhat.com/Neutron_with_existing_external_network
◆public用として使うNICの設定ファイルを修正
packstack実行後、eth0をbr-exにつなぐように設定をします(※BOOTPROTOは設定しな
い)
5. >-# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
HWADDR=52:54:00:92:05:AE # your eth0's hwaddr
TYPE=OVSPort
DEVICETYPE=ovs
OVS_BRIDGE=br-ex
--<
◆ブリッジインターフェイスの作成
br-exにeth0のIPアドレスを設定します。
>-# vi /etc/sysconfig/network-scripts/ifcfg-br-ex
DEVICE=br-ex
ONBOOT=yes
DEVICETYPE=ovs
TYPE=OVSBridge
BOOTPROTO=static
IPADDR=192.168.1.140
# Old eth0 IP since we want the network
restart to not kill the connection, otherwise pick something outside
your dhcp range
NETMASK=255.255.255.0 # your netmask
GATEWAY=192.168.1.1
# your gateway
DNS1=8.8.8.8
# nameserver
DNS1=8.8.4.4
--<
/etc/neutron/plugin.iniに次の設定を追加します。
>-network_vlan_ranges = physnet1
bridge_mappings = physnet1:br-ex
--<
ここまでできたらいったんホストを再起動します。
>-# reboot
--<
Step 6: ネットワークの追加
br-exにeth0を割り当てて仮想マシンをハイパーバイザー外部と通信できるようにする為
の経路が確保されていることを確認します。
>-# ovs-vsctl show
903f6cd5-29f3-4b8d-9cda-3411ddf98ecb
Bridge br-int
6. Port "qr-4c4fb9f1-a6"
tag: 1
Interface "qr-4c4fb9f1-a6"
type: internal
Port br-int
Interface br-int
type: internal
Port "tap80d3399f-1e"
tag: 1
Interface "tap80d3399f-1e"
type: internal
Bridge br-ex
Port "qg-bca7776d-14"
Interface "qg-bca7776d-14"
type: internal
Port br-ex
Interface br-ex
type: internal
Port "eth0"
Interface "eth0"
ovs_version: "1.11.0"
--<
OSやハードウェア側の設定が終わったら、OpenStackが利用するネットワークを作成して
みましょう。OpenStackにおけるネットワークの設定は以下の順で行います。
・ルーターを作成
・ネットワークを作成
・ネットワークサブネットを作成
それでは順に行っていきましょう。
◆ルーターの作成
ルーターの作成は次のようにコマンドを実行します。
>-# neutron router-create router1
--<
◆ネットワークの作成
ネットワークの作成は次のようにコマンドを実行します。
・パブリックネットワークの場合
>-# neutron net-create public --tenant-id
449cf61950f5488ca789e07d217d1ca5 --router:external=True
--<
net-createコマンドの先頭にはまずネットワーク名を記述します。tenant-idは