旧OpenStack集群

IP hostname 角色
10.99.2.155 pool1 kola-deploy,controller,neutron,nova,cinder
10.99.2.156 pool2 controller,neutron,nova,cinder
10.99.2.157 pool3 controller,neutron,nova,cinder

新OpenStack集群

IP hostname 角色
10.99.2.158 pool4 controller,neutron,nova,cinder
10.99.2.159 pool5 nova,cinder
10.99.2.160 pool6 nova,cinder

下载docker

1
2
3
4
5
6
# 新集群所有主机执行
mkdir /data/pkgs -p && cd /data/pkgs
wget http://10.99.5.6:10080/docker-engine-1.12.6-1.el7.centos.x86_64.rpm
yum install -y docker-engine-1.12.6-1.el7.centos.x86_64.rpm
# 启动docker
systemctl start docker && systemctl enable docker && systemctl status docker

设置docker镜像源

1
2
3
4
5
6
7
8
9
10
11
# 新集群所有主机
mkdir -p /etc/docker
cat > /etc/docker/daemon.json << EOF
{
"insecure-registries": [
"10.99.5.6:4000"
]
}
EOF

systemctl restart docker

设置docker volume卷挂载方式

1
2
3
4
5
6
7
8
9
# 新集群所有主机
mkdir /etc/systemd/system/docker.service.d
tee /etc/systemd/system/docker.service.d/kolla.conf << 'EOF'
[Service]
MountFlags=shared
EOF

systemctl daemon-reload
systemctl restart docker

设置docker Yum源

1
2
3
4
5
6
7
# 新集群所有主机
vi /etc/yum.repos.d/docker.repo
[docker]
baseurl = http://10.99.5.6:10080/docker-ce/linux/centos/7/x86_64/stable
gpgcheck = 1
gpgkey = http://10.99.5.6:10080/docker-ce/linux/centos/gpg
name = Docker main Repository

拷贝部署文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# 注释掉旧节点主机名

[root@pool1 kolla]# cp multinode add_node
# These initial groups are the only groups required to be modified. The
# additional groups are for more control of the environment.
[control]
# These hostname must be resolvable from your deployment host
#pool1
#pool2
#pool3
pool4
#pool5
#pool6

# The above can also be specified as follows:
#control[01:03] ansible_user=kolla

# The network nodes are where your l3-agent and loadbalancers will run
# This can be the same as a host in the control group
[network]
#pool1
#pool2
#pool3
pool4
pool5
pool6

[compute]
#pool1
#pool2
#pool3
pool4
pool5
pool6

[monitoring]
#pool1
pool4

# When compute nodes and control nodes use different interfaces,
# you need to comment out "api_interface" and other interfaces from the globals.yml
# and specify like below:
#compute01 neutron_external_interface=eth0 api_interface=em1 storage_interface=em1 tunnel_interface=em1

[storage]
#pool1
#pool2
#pool3
pool4
pool5
pool6

[deployment]
#pool1
pool4

旧deploy主机执行下载镜像

1
2
3
4
# 修改/etc/kolla/globals.yml取消注释docker_registry
docker_registry: "10.99.5.6:4000"
# 执行:
[root@pool1 kolla]# kolla-ansible -i /etc/kolla/multinode pull

新deploy主机执行部署

1
[root@pool1 kolla]# kolla-ansible -i /etc/kolla/multinode deploy