kolla Pike on CentOS 7.3

openstack Pike发布很长一段时间了,一直没有时间整理一份在kolla on CentOS7.3 的文档
参考:沙克老师单节点ocata安装

环境准备

1
2
yum install epel-release  
yum install axel vim git curl wget lrzsz ansible gcc python-devel

docker-ce yum

1
2
add docker-ce yum:
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

docker-ce install

1
2
install docker-ce
# yum install docker-ce

docker-ce configuration

1
2
3
4
5
mkdir  /etc/systemd/system/docker.service.d/
tee /etc/systemd/system/docker.service.d/kolla.conf << eof
[Service]
MountFlags=shared
eof

编辑 /usr/lib/systemd/system/docker.service

1
ExecStart=/usr/bin/dockerd --insecure-registry 192.168.200.2:4000

启动docker

1
2
3
4
systemctl daemon-reload
systemctl enable docker
systemctl restart docker
systemctl status docker

kolla-ansible install

  • github项目
  1. openstack kolla镜像地址
  2. openstack-ansible是用ansible部署openstack用的
  3. ceph-ansible是用ansible部署ceph用的
  4. kolla-ansible是用ansible部署kolla用的,其中openstack+ceph环境均分散在一个一个的docker容器里

安装pike版本 kolla-ansible,pip install 安装方式存在版本问题或非最新代码,这里直接git下载代码安装。

1
2
3
4
5
6
7
8
9
10
cd /opt
git clone https://github.com/openstack/kolla-ansible.git
cd /opt/kolla-ansible
git branch -av
git checkout remotes/origin/stable/pike
cp -r /opt/kolla-ansible/etc/kolla/ /etc/

# 安装相关依赖包
cd /opt/kolla-ansible
pip install -r requirements.txt

生成密码

1
2
cd /opt/kolla-ansible/tools
python generate_passwords.py

安装镜像仓库

1
2
3
4
5
6
# docker pull registry

下载最新pike 容器镜像:
http://tarballs.openstack.org/kolla/images/centos-source-registry-pike.tar.gz
tar xf centos-source-registry-pike.tar.gz -C /opt/registry
docker run -d -p 4000:5000 --restart=always --name registry -v /opt/registry/:/var/lib/registry registry

eg:

1
2
3
4
mkdir /registry
tar -zxf /root/docker-registry.tar.gz -C /registry
docker load < /root/registry.tar
docker run -d -p 4000:5000 --restart=always --name registry -v /opt/registry/:/var/lib/registry registry

check docker hub

1
2
3
4
5
curl http://192.168.200.2:4000/v2/_catalog
[root@controller01 ~]# curl 192.168.200.2:4000/v2/99cloud/centos-source-memcached/tags/list
{"name":"99cloud/centos-source-memcached","tags":["4.0.1.1"]}

docker pull 192.168.200.2:4000/99cloud/centos-source-memcached:4.0.1.1

ceph disk set

1
# for i in  vdb vdc vdd; do  parted /dev/$i  -s -- mklabel gpt mkpart KOLLA_CEPH_OSD_BOOTSTRAP 1 -1; done

in case of vm

如果只是在虚机中实验搭建kolla,需要额外配置

1
2
3
4
5
mkdir -p /etc/kolla/config/nova
vim /etc/kolla/config/nova/nova-compute.conf
[libvirt]
virt_type = qemu
cpu_mode = none

创建 /etc/kolla/config/ceph.conf

1
2
3
[global]
osd pool default size = 1
osd pool default min size = 1

如果有需要,请手动调整副本数

1
ceph osd pool set rbd size 1

edit global.yml

1
2
edit /etc/kolla/global.yml
此处略过。。。

kolla-ansible deploy

1
2
3
4
kolla-ansible prechecks
kolla-ansible pull
kolla-ansible deploy
kolla-ansible post-deploy

cli-commands install

1
2
yum  install ceph-common 
pip python-openstackclient python-neutronclient

access dashboard

1
curl http://openstack_VIP/horizon