blob: f35e3ceb36a51ac688872eb284a345fab0b90a28 (
plain)
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
|
#!/bin/sh
##############################################################################
# Copyright (c) 2015 Tim Rozet (Red Hat), Dan Radez (Red Hat) and others.
#
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
##############################################################################
set -e
source ./cache.sh
source ./variables.sh
source ./functions.sh
populate_cache "$rdo_images_uri/overcloud-full.tar"
if [ ! -d images/ ]; then mkdir images; fi
tar -xf cache/overcloud-full.tar -C images/
mv -f images/overcloud-full.qcow2 images/overcloud-full_build.qcow2
# Add extra space to the overcloud image
qemu-img resize images/overcloud-full_build.qcow2 +1G
LIBGUESTFS_BACKEND=direct virt-customize -a images/overcloud-full_build.qcow2 \
--run-command 'resize2fs /dev/sda'
##########################################################
##### Prep initial overcloud image with common deps #####
##########################################################
# prep opnfv-puppet-tripleo for undercloud
clone_fork opnfv-puppet-tripleo
pushd opnfv-puppet-tripleo > /dev/null
git archive --format=tar.gz --prefix=tripleo/ HEAD > ../opnfv-puppet-tripleo.tar.gz
popd > /dev/null
# download customized os-net-config
rm -fr os-net-config
git clone https://github.com/trozet/os-net-config.git -b hiera_nic_mapping
pushd os-net-config > /dev/null
pushd os_net_config > /dev/null
git archive --format=tar.gz --prefix=os_net_config/ HEAD > ../../os-net-config.tar.gz
popd > /dev/null
popd > /dev/null
pushd images > /dev/null
dpdk_pkg_str=''
for package in ${dpdk_rpms[@]}; do
curl -O "$dpdk_uri_base/$package"
dpdk_pkg_str+=" --upload $package:/root/dpdk_rpms"
done
# installing forked opnfv-puppet-tripleo
# enable connection tracking for protocal sctp
# upload dpdk rpms but do not install
LIBGUESTFS_BACKEND=direct virt-customize \
--upload ../opnfv-puppet-tripleo.tar.gz:/etc/puppet/modules \
--run-command "cd /etc/puppet/modules && rm -rf tripleo && tar xzf opnfv-puppet-tripleo.tar.gz" \
--run-command "echo 'nf_conntrack_proto_sctp' > /etc/modules-load.d/nf_conntrack_proto_sctp.conf" \
--run-command "mkdir /root/dpdk_rpms" \
$dpdk_pkg_str \
--install "centos-release-qemu-ev" \
--run-command "yum update -y" \
--run-command "yum remove -y qemu-system-x86" \
--upload ../os-net-config.tar.gz:/usr/lib/python2.7/site-packages \
--run-command "cd /usr/lib/python2.7/site-packages/ && rm -rf os_net_config && tar xzf os-net-config.tar.gz" \
-a overcloud-full_build.qcow2
mv -f overcloud-full_build.qcow2 overcloud-full.qcow2
popd > /dev/null
|