2
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

OpenStack Train for CentOS7 RDO(All-In-One)インストール記録

Posted at

手順は調べればたくさん出てくるのだが「あっちにしかない情報」「こっちにしかない情報」が分散しているので、自分のために情報をまとめ。

環境
# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core) 
  • 最小限インストールした生まれてたての姿。SSH接続できる準備(IPアドレス付与)だけした。
  • 作業内で yum -y update により以下に変わります。
# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)

事前準備

外部ネットワーク接続

全部rootアカウントで実行しているのは許してくれ

# nmcli con mod enp8s0f1 ipv4.dns "8.8.8.8" ipv4.gateway "192.168.200.98"
  • enp8s0f1 は外部につながるRTにつながるIFdevice
  • 192.168.200.98 はうちの環境の外部へのゲートウェイアドレス
  • 8.8.8.8 はGoogle Public DNS
# systemctl restart network
# ping -c 3 google.com
PING google.com (172.217.175.238) 56(84) bytes of data.
64 bytes from nrt12s29-in-f14.1e100.net (172.217.175.238): icmp_seq=1 ttl=112 time=70.4 ms
64 bytes from nrt12s29-in-f14.1e100.net (172.217.175.238): icmp_seq=2 ttl=112 time=68.9 ms
64 bytes from nrt12s29-in-f14.1e100.net (172.217.175.238): icmp_seq=3 ttl=112 time=67.9 ms

--- google.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2002ms
rtt min/avg/max/mdev = 67.956/69.121/70.450/1.068 ms
  • 外部につながることを確認した

不要サービス(OpenStackを構築する上で邪魔になるサービス)の停止

# systemctl stop NetworkManager
# systemctl disable NetworkManager
# systemctl stop firewalld
# systemctl disable firewalld

# sed -e 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config -i
# grep ^SELINUX /etc/selinux/config
SELINUX=disabled
SELINUXTYPE=targeted
# setenforce 0

アップデート

# yum -y update

途中でなぜか NetworkManagersymlinkcreate されたりするので念の為に以下を実施

# systemctl disable NetworkManager
Removed symlink /etc/systemd/system/network-online.target.wants/NetworkManager-wait-online.service.

いったん再起動

SELinuxsetenforce 0 しているので大丈夫だとは思いつつ、
全アップデートしているので一応やっておく。

環境再確認

# cat /etc/redhat-release
CentOS Linux release 7.9.2009 (Core)

私はvim派です

# yum -y install vim

時刻同期

# vim /etc/chrony.conf
----------------------------------------------------------------------
server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
----------------------------------------------------------------------
↓
----------------------------------------------------------------------
server xxx.xxx.xxx.xxx
----------------------------------------------------------------------
※環境のNTPサーバに変更

# chronyc makestep
200 OK

if-bridge作成

# yum -y install bridge-utils
# cd /etc/sysconfig/network-scripts
# cp -p ifcfg-enp8s0f1 ifcfg-br-ex
# vim ifcfg-enp8s0f1 ifcfg-br-ex
ifcfg-enp8s0f1(変更前)
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp8s0f1
UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
DEVICE=enp8s0f1
ONBOOT=yes
IPADDR=192.168.57.101
PREFIX=16
GATEWAY=192.168.200.98
DNS1=8.8.8.8
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_PRIVACY=no

DEFROUTEIPADDRPREFIXGATEWAYDNS1を削除してBRIDGEを追加。

ifcfg-enp8s0f1(変更後)
TYPE=Ethernet
BOOTPROTO=none
IPV4_FAILURE_FATAL=yes
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp8s0f1
UUID=af879466-eabf-4104-b0b3-6ea0026fe52b
DEVICE=enp8s0f1
ONBOOT=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_PRIVACY=no
BRIDGE=br-ex

新たに作ったファイルも編集

ifcfg-br-ex(新規作成:ifcfg-enp8s0f1をコピーして作る)
TYPE=Ethernet
BOOTPROTO=none
DEFROUTE=yes
NAME=br-ex
DEVICE=br-ex
ONBOOT=yes
IPADDR=192.168.57.101
PREFIX=16
GATEWAY=192.168.200.98
DNS1=8.8.8.8
# echo "192.168.57.101  `hostname`" >> /etc/hosts
# ip l add br-ex type bridge
# ip link show br-ex
12: br-ex: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether b2:9b:2c:a5:4d:be brd ff:ff:ff:ff:ff:ff
# ip link set up br-ex

コンソール接続に切り替えて以下を実施

# systemctl restart network
# ip link set up br-ex
# ip addr add 192.168.57.101/16 dev br-ex

OpenStackインストール

Openstack Trainリポジトリ追加

# yum -y install centos-release-openstack-train epel
# yum -y install openstack-packstack --disablerepo=epel

--disablerepo=epelをしないとleathermanなどのパッケージが最新化されてしまい、以降の手順でパッケージの版数違いによる失敗が発生してしまう。

answerファイル作成

# packstack --gen-answer-file=/root/answer.txt --default-password=******** --os-neutron-l2-agent=openvswitch
※パスワードは任意
  • 今回は Cinder , Swift を使わない特殊要件なので無効化
answer.txt
  # Specify 'y' to install OpenStack Block Storage (cinder). ['y', 'n']
- CONFIG_CINDER_INSTALL=y
+ CONFIG_CINDER_INSTALL=n

  # Specify 'y' to install OpenStack Object Storage (swift). ['y', 'n']
- CONFIG_SWIFT_INSTALL=y
+ CONFIG_SWIFT_INSTALL=n

NTPサーバも指定

answer.txt
  # Comma-separated list of NTP servers. Leave plain if Packstack
  # should not install ntpd on instances.
- CONFIG_NTP_SERVERS=
+ CONFIG_NTP_SERVERS=192.168.110.210

DB接続タイムアウトを更新

/usr/share/openstack-puppet/modules/nova/manifests/db/online_data_migrations.pp
/usr/share/openstack-puppet/modules/nova/manifests/db/sync.pp
/usr/share/openstack-puppet/modules/nova/manifests/db/sync_api.pp
/usr/share/openstack-puppet/modules/neutron/manifests/db/sync.pp

上記のファイルの$db_sync_timeout = 300$db_sync_timeout = 0にする。

なんかわからんけどタイムアウト値更新

PuppetError: Error appeared during Puppet run: 192.168.57.101_controller.pp
Error: /Stage[main]/Keystone::Roles::Admin/Keystone_user_role[admin@admin]: Could not evaluate: Command: 'openstack ["role", "list", "--quiet", "--format", "csv", ["--project", "340c6675f1ee44558d1cd4a27fc68ef9", "--user", "982d7c8b6e66446b9af61dc0da17d1e1"]]' has been running for more than 40 seconds (tried 4, for a total of 170 seconds)^[[0m
You will find full trace in log /var/tmp/packstack/20201209-181903-Been0k/manifests/192.168.57.101_controller.pp.log

こんなエラーが出た時の対策

/usr/share/openstack-puppet/modules/openstacklib/lib/puppet/provider/openstack.rb
  @@no_retry_actions = %w(create remove delete)
  @@command_timeout  = 40
  # Fails on the 5th retry for a max of 212s (~3.5min) before total
  # failure.
  @@request_timeout  = 10800
  @@retry_sleep      = 3

/usr/share/openstack-puppet/modules/openstacklib/lib/puppet/provider/openstack.rb
  @@no_retry_actions = %w(create remove delete)
  @@command_timeout  = 3600
  # Fails on the 5th retry for a max of 212s (~3.5min) before total
  # failure.
  @@request_timeout  = 10800
  @@retry_sleep      = 3

It's Show Time !!

# packstack --answer-file /root/answer.txt --timeout=0 --debug

失敗した時のリカバリ手順とか

====> remove installed files
# yum remove openstack-packstack
# yum remove centos-release-openstack-train
# yum remove mariadb
# rm -rf /var/lib/mysql
# rm /root/.my.cnf

====> install packages
# yum -y install centos-release-openstack-train epel-release 
# yum -y install openstack-packstack python-pip --disablerepo=epel
2
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
6

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?