一、环境准备

1、host

deploy
安装kolla
controller
node0
compute
node3
storage
node5
network
node7

2、软件版本

kolla
stable/newton
docker-engine 1.12.2
python-docker-py 1.7.2-1

3、为cinder volume准备lvm

在node5上执行下面命令

pvcreate /dev/sdc
vgcreate cinder-volumes /dev/sdc

# 如果 使用文件作lvm后端可执行如下操作
qemu-img create -f raw cinder_data.img 50G
mknod /dev/loop2 b 7 2
losetup /dev/loop2 cinder_data.img
pvcreate /dev/loop2
vgcreate cinder-volumes /dev/loop2


二、安装kolla,并构建p_w_picpaths

参看: kolla newton 配置

三、配置kolla

1、编辑/etc/kolla/globals.yml

kolla_base_distro: "centos"
kolla_install_type: "source"
openstack_release: "3.0.1"

kolla_internal_vip_address: "192.168.1.10"
kolla_external_vip_address: "{{ kolla_internal_vip_address }}"

docker_registry: "registry_ip_address:registry_ip_port"
docker_namespace: "kolla"
docker_registry_username: "admin"
docker_registry_password: "registry_password"

network_interface: "eth0"
neutron_external_interface: "eth1"

neutron_plugin_agent: "linuxbridge"

nova_console: "novnc"

enable_haproxy: "no"
enable_keystone: "yes"
enable_glance: "yes"
enable_neutron: "yes"
enable_heat: "no"
enable_nova: "yes"
enable_horizon: "yes"
enable_cinder: "yes"
enable_cinder_backend_lvm: "yes" # 若设置为no,虽可创建cinder volume,然,volume不能挂载到instance
enable_central_logging: "no"
enable_ceph: "no"
enable_ceilometer: "no"
enable_mongodb: "no"
enable_sahara: "no"

cinder_volume_group: "cinder-volumes"

2、为/etc/kolla/passwords.yml生成密码

kolla-genpwd

3、编辑/usr/share/kolla/ansible/inventory/multinode

# 注意:注释掉各节中,原有主机名
[control]
node0
...
[network]
node7
...
[compute]
node3
...
[monitoring]
#monitoring01
...
[storage]
node5

四、部署openstack

1、为network上的docker启用MountFlags shared,在node7上执行

mkdir -p /etc/systemd/system/docker.service.d

# Create the drop-in unit file
tee /etc/systemd/system/docker.service.d/kolla.conf <<-'EOF'
[Service]
MountFlags=shared
EOF

systemctl daemon-reload
systemctl restart docker


2、使用qemu,在kolla主机上执行

mkdir -p /etc/kolla/config/nova/
cat <> /etc/kolla/config/nova/nova-compute.conf
[libvirt]
virt_type=qemu
EOF

3、执行安装前检查

kolla-ansible -i /usr/share/kolla/ansible/inventory/multinode prechecks

4、拉取p_w_picpaths

kolla-ansible -i /usr/share/kolla/ansible/inventory/multinode pull

5、部署openstack

kolla-ansible  -i /usr/share/kolla/ansible/inventory/multinode deploy

6、执行安装后配置

kolla-ansible  -i /usr/share/kolla/ansible/inventory/multinode post-deploy

7、执行初始化,在kolla主机上执行

/usr/share/kolla/init-runonce

至此,部署完毕