由于,OpenStack社区自Queens版本起,便不再提供将打包好的kolla openstack镜像放在
该链接上
所以,我们要获取Kolla的OpenStack镜像,就只能依靠自己手动获取。有如下几种方法。
从官方源下载镜像
安装kolla-ansible1
2 git clone https://github.com/openstack/kolla-ansible -b stable/queens
pip install kolla-ansible/
编辑globals.yml文件,设置相关参数1
2
3
4
kolla_install_type: "source"
kolla_base_distro: "centos"
openstack_release: "queens"
下载镜像1
2 kolla-ansible -i all-in-one bootstrap-servers
kolla-ansible pull
手动构建镜像
下载kolla项目1
git clone https://github.com/openstack/kolla.git -b stable/queens
生成kolla-build.conf文件1
2
3 pip install tox
cd kolla/
tox -e genconfig
构建openstack镜像1
2
3
4
5//构建基于centos系统的source源码安装的openstack镜像
# kolla-build -t source -b centos
//或者,构建基于centos系统的binary二进制包安装的openstack镜像
# kolla-build -t binary -b centos
自动化拉取kolla镜像
由于OpenStack社区,已经开始正式将kolla镜像托管在DockerHub上。所以,我们还可以从Docker Hub上直接拉取kolla镜像,由于openstack镜像少则几十,多则上百,因此,这里我编写了一个bash脚本,用于自动化拉取queens版本的kolla镜像。
为了加快从docker hub上拉取镜像,这里,配置上阿里云的镜像加速器。1
2
3
4
{
"registry-mirrors": ["https://a5aghnme.mirror.aliyuncs.com"]
}
重启docker服务,生效1
systemctl daemon-reload && systemctl restart docker
拉取queens版本的kolla镜像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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153# cat 01_pull_kolla.sh
image_tag=queens #该变量,你可以根据自己需要进行修改
# delete images
docker images | awk '{print $3}' | xargs docker rmi -f
# pull public images
for public_images in memcached kolla-toolbox cron mongodb mariadb rabbitmq keepalived haproxy chrony iscsid tgtd
do
docker pull kolla/centos-source-$public_images:$image_tag
done
# pull monitor manage images
# it is recommended to use telegraf + influxdb + grafana + collectd + Prometheus
for monitor_images in collectd telegraf grafana influxdb prometheus-server prometheus-haproxy-exporter prometheus-node-exporter prometheus-mysqld-exporter prometheus-memcached-exporter prometheus-cadvisor
do
docker pull kolla/centos-source-$monitor_images:$image_tag
done
# pull log manage images
for log_images in fluentd elasticsearch kibana
do
docker pull kolla/centos-source-$log_images:$image_tag
done
# pull nova
for nova in nova-compute nova-consoleauth nova-ssh nova-placement-api nova-api nova-compute-ironic nova-consoleauth nova-serialproxy nova-scheduler nova-novncproxy nova-conductor nova-libvirt
do
docker pull kolla/centos-source-$nova:$image_tag
done
# pull keystone
for keystone in keystone keystone-fernet keystone-ssh
do
docker pull kolla/centos-source-$keystone:$image_tag
done
# pull freezer
docker pull kolla/centos-source-freezer-api:$image_tag
# pull glance
for glance in glance-api glance-registry
do
docker pull kolla/centos-source-$glance:$image_tag
done
# pull cinder
for cinder in cinder-volume cinder-api cinder-backup cinder-scheduler
do
docker pull kolla/centos-source-$cinder:$image_tag
done
# pull neutron
for neutron in neutron-server neutron-lbaas-agent neutron-dhcp-agent neutron-l3-agent neutron-openvswitch-agent neutron-metadata-agent neutron-server-opendaylight opendaylight
do
docker pull kolla/centos-source-$neutron:$image_tag
done
# pull openvswitch
for openvswitch in openvswitch-db-server openvswitch-vswitchd neutron-openvswitch-agent
do
docker pull kolla/centos-source-$openvswitch:$image_tag
done
# pull ceilometer
for ceilometer in ceilometer-api ceilometer-compute ceilometer-notification ceilometer-central
do
docker pull kolla/centos-source-$ceilometer:$image_tag
done
# pull gnocchi
for gnocchi in gnocchi-metricd gnocchi-api gnocchi-statsd
do
docker pull kolla/centos-source-$gnocchi:$image_tag
done
# pull aodh
for aodh in aodh-evaluator aodh-api aodh-listener aodh-notifier
do
docker pull kolla/centos-source-$aodh:$image_tag
done
# pull heat
for heat in heat-api heat-api-cfn heat-engine
do
docker pull kolla/centos-source-$heat:$image_tag
done
# pull horizon
docker pull kolla/centos-source-horizon:$image_tag
# pull murano
for murano in murano-api murano-engine
do
docker pull kolla/centos-source-$murano:$image_tag
done
# pull magnum
for magnum in magnum-api magnum-conductor
do
docker pull kolla/centos-source-$magnum:$image_tag
done
# pull senlin
for senlin in senlin-api senlin-engine
do
docker pull kolla/centos-source-$senlin:$image_tag
done
# pull sahara
for sahara in sahara-engine sahara-api
do
docker pull kolla/centos-source-$sahara:$image_tag
done
# pull trove
for trove in trove-api trove-taskmanager trove-conductor
do
docker pull kolla/centos-source-$trove:$image_tag
done
# pull swift
for swift in swift-rsyncd swift-proxy-server swift-object-expirer swift-object swift-account swift-container swift-base
do
docker pull kolla/centos-source-$swift:$image_tag
done
# pull ironic
for ironic in ironic-conductor ironic-pxe ironic-api ironic-inspector
do
docker pull kolla/centos-source-$ironic:$image_tag
done
docker pull kolla/centos-source-dnsmasq:pike
docker tag kolla/centos-source-dnsmasq:pike kolla/centos-source-dnsmasq:queens
docker rmi -f kolla/centos-source-dnsmasq:pike
# pull cloudkitty
for cloudkitty in cloudkitty-api cloudkitty-processor panko-api
do
docker pull kolla/centos-source-$cloudkitty:$image_tag
done
# pull kuryr
docker pull kolla/centos-source-kuryr-libnetwork:$image_tag
# save images
images=`docker images | grep queens | awk '{print $1}'`
docker save -o kolla_queens_images.tar $images
# clean pull's images
docker images | awk '{print $3}' | xargs docker rmi -f
将镜像push到本地Registry1
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# cat 02_push_kolla.sh
# load images
docker load --input kolla_queens_images.tar
registry=172.17.51.27:4000 #请将该registry地址,改为你自己环境的地址
# tag images
images=`docker images | grep queens | awk '{print $1}'`
for images_tag in $images
do
docker tag $images_tag:queens $registry/$images_tag:queens
done
# delete old's images
delete_images=`docker images | grep '^kolla' | awk '{print $1}'`
for delete_images1 in $delete_images
do
docker rmi $delete_images1:queens
done
# push images
push_images=`docker images | grep queens | awk '{print $1}'`
for push_images1 in $push_images
do
docker push $push_images1:queens
done
综合,比较以上三种方法的优缺点。这里,推荐使用第三种方法,速度更快,也更便捷。
PS:脚本写得有点搓,不喜可喷。